Download the PHP package ahsanzameer/php-openai-chat-assistant without Composer
On this page you can find all versions of the php package ahsanzameer/php-openai-chat-assistant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download ahsanzameer/php-openai-chat-assistant
More information about ahsanzameer/php-openai-chat-assistant
Files in ahsanzameer/php-openai-chat-assistant
Download ahsanzameer/php-openai-chat-assistant
More information about ahsanzameer/php-openai-chat-assistant
Files in ahsanzameer/php-openai-chat-assistant
Vendor ahsanzameer
Package php-openai-chat-assistant
Short Description OpenAI Chat Assistant Class for PHP
License MIT
Homepage https://github.com/ahsanzameer/php-openai-chat-assistant
Package php-openai-chat-assistant
Short Description OpenAI Chat Assistant Class for PHP
License MIT
Homepage https://github.com/ahsanzameer/php-openai-chat-assistant
Please rate this library. Is it a good library?
Informations about the package php-openai-chat-assistant
PHP Class for OpenAI Assistant
This class allows you to create interactive chat assistant using OpenAI
Create Object
$key = 'CHAT_API_KEY'
$chat = new AhsanZameer\ChatAssistant($key);
Set Chat Model
$chat->setChatModel(''gpt-4-turbo-preview'); //default is 'gpt-4-turbo-preview
Set Instructions
$chat->setInstrutions('You are a very good customer support chatbot');
Set Tools
$chat->setTools([["type" => "retrieval"]]);
Upload File
$pdf = 'pdf-file.pdf';
$uploadFile = $chat->uploadFile($pdf); //array
Get File
$fileId= 'file-random-string';
$file = $chat->getFile($fileId);
Create Assistant
$assistant = $chat->createAssistant('my-new-assistant'); //array
Create Assistant with File
$fileArray = ['file-woer23223423']; //array
$assistant = $chat->createAssistant('assistant-with-file',$fileArray);
Get Assistant
$assistantId = 'asst_random-id-string';
$getAssistant = $chat->getAssistant($assistantId); //array
Create Thread
$createThread = $chat->createThread(); //array
Create Message
$threadId = $createThread['id'];
$message = ["role"=>"user","content"=>"ok cool"];
$createMessage = $chat->createMessage($threadId,$message);
Run Thread
$runData = ['assistant_id'=>$assistantId];
$run = $chat->run($threadId,$runData);
Retrieve Run
$runId = $run['id'];
$runStatus = $chat->retrieveRun($threadId,$runId);
List Messages
$getMsges = $chat->listMessages($threadId);
All versions of php-openai-chat-assistant with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0.0
The package ahsanzameer/php-openai-chat-assistant contains the following files
Loading the files please wait ....