Download the PHP package aerobit/openai-agents without Composer

On this page you can find all versions of the php package aerobit/openai-agents. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package openai-agents

OpenAI Agents for Laravel

This package provides a lightweight integration of the OpenAI PHP client with Laravel 12, inspired by the OpenAI Agents Python SDK.

Installation

Publish the configuration file:

Set your OPENAI_API_KEY in the environment file or edit config/agents.php.

Usage

Send a message to the default agent:

You can control the number of turns or provide a system prompt using options:

You can also resolve the AgentManager service from the container to create agents programmatically.

The returned Agent instance retains the conversation history, allowing for multi-turn chats:

The agent can also convert text responses to speech:

You can optionally provide a system prompt when constructing the agent:

For more advanced scenarios you can use the Runner class which loops until the agent returns a final response or a turn limit is reached. Tools and basic handoffs can be registered on the runner:

The runner can request structured JSON output by providing an output schema:

Tools may also be defined with JSON schemas for OpenAI function calling:

If you need non-blocking execution you can run the runner inside a PHP Fiber:

You can also stream results as they're generated:

Voice pipeline

Use the VoicePipeline class to handle audio transcription and text-to-speech in one step:

Tracing

The package includes a simple tracing system that lets you observe each turn of a Runner execution. Enable tracing in config/agents.php and register one or more processors to handle trace records:

When enabled, each call to Runner::run() will emit start and end span events as well as per-turn events containing the input and output.

Guardrails

Guardrails let you validate input and output during a run. They can transform the content or throw an exception to stop execution.

Configuration

The config/agents.php file allows you to customize the default model and parameters used when interacting with OpenAI. It also contains options to enable tracing and provide custom processors for handling trace data.

License

Released under the MIT license.


All versions of openai-agents with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^12.0
openai-php/client Version ^0.6
symfony/http-client Version ^7.3
nyholm/psr7 Version ^1.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aerobit/openai-agents contains the following files

Loading the files please wait ...