Download the PHP package evolvoltd/laravel-openai-assistants without Composer

On this page you can find all versions of the php package evolvoltd/laravel-openai-assistants. 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 laravel-openai-assistants

laravel-openai-assistants

Get Started

First, install by using Composer

Then, make sure to set your .env variables

Note that this package uses queues. Queues need to be configured. The queue being used is 'default' by default. You can set the .env variable below to change this.

You can also set a maximum retry count. The default is 60. You can set the .env variable below to change this

Usage

The key part of this package is the ask function

This function will add a message to an assistant's thread, run the thread and dispatch a job to check on the run's status and retrieve the response when the run is completed.

The first parameter 'message' requires you to pass in the message you want to send to the assistant.

The second parameter 'parser' requires you to create and pass in a class that implements interface ParseGPTResponse

ParseGPTResponse Interface

This interface has three functions:

public function parseResponse();

This function allows you to set up the functionality to parse the response from the assistant according to your requirements. Example below:

public function executeFunctions());

This function allows you to set up your assistant's predefined functions for when it requests data from them. An example is displayed below. Note that the $name is entirely based on the functions you assigned to your assistant. The output is hardcoded in this example but could return any data of your choice.

public function statusUpdate();

This function allows you to set up your own way to store the status and data of the run for future reference. An example is displayed below. Note that in this example, GptQuery is a model of a database table. You will need to create your own database table and model to use this function.

Multiple Queues/Assistants

You can also pass in optional variables when using the ask function to specify the queue and assistant for the specific message sent. This allows you to use multiple queues and/or assistants in your application. An example is below:

Here, $assistantId allows you to pass in the assistant you want to use in this request, and $queueName allows you to pass in the name of the queue you want to use in this request. The ask function checks if these variables are provided. It uses the provided variable if available, otherwise it uses the value from the config.


All versions of laravel-openai-assistants with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^11.0
php Version >=8.2.0
openai-php/laravel Version ^0.8.1
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 evolvoltd/laravel-openai-assistants contains the following files

Loading the files please wait ....