PHP code example of evolvoltd / laravel-openai-assistants
1. Go to this page and download the library: Download evolvoltd/laravel-openai-assistants library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
evolvoltd / laravel-openai-assistants example snippets
public function parseResponse(string $response)
{
return strtoupper($response);
}
public function executeFunctions(string $name, $arguments, $toolCall)
{
if ($name == 'get_weather') {
return [
'tool_call_id' => $toolCall->id,
'output' => "25 degrees celsius"
];
} else return [];
}