Skip to content

Commit

Permalink
Update facade and factory for the assistants api
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrisandro committed Nov 23, 2023
1 parent 0e49530 commit c822231
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"php": "^8.1.0",
"guzzlehttp/guzzle": "^7.7.0",
"laravel/framework": "^9.46.0|^10.14.1",
"openai-php/client": "^0.7.8"
"openai-php/client": "dev-add-assistant-api"
},
"require-dev": {
"laravel/pint": "^1.10.3",
Expand Down
2 changes: 2 additions & 0 deletions src/Facades/OpenAI.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use OpenAI\Responses\StreamResponse;

/**
* @method static \OpenAI\Resources\Assistants assistants()
* @method static \OpenAI\Resources\Audio audio()
* @method static \OpenAI\Resources\Chat chat()
* @method static \OpenAI\Resources\Completions completions()
Expand All @@ -20,6 +21,7 @@
* @method static \OpenAI\Resources\Images images()
* @method static \OpenAI\Resources\Models models()
* @method static \OpenAI\Resources\Moderations moderations()
* @method static \OpenAI\Resources\Threads threads()
*/
final class OpenAI extends Facade
{
Expand Down
1 change: 1 addition & 0 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function register(): void
return OpenAI::factory()
->withApiKey($apiKey)
->withOrganization($organization)
->withHttpHeader('OpenAI-Beta', 'assistants=v1')
->withHttpClient(new \GuzzleHttp\Client(['timeout' => config('openai.request_timeout', 30)]))
->make();
});
Expand Down

0 comments on commit c822231

Please sign in to comment.