Skip to content

Commit 82bf88e

Browse files
committed
Update facade and factory for the assistants api
1 parent 0e49530 commit 82bf88e

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^8.1.0",
1414
"guzzlehttp/guzzle": "^7.7.0",
1515
"laravel/framework": "^9.46.0|^10.14.1",
16-
"openai-php/client": "^0.7.8"
16+
"openai-php/client": "dev-add-assistant-api"
1717
},
1818
"require-dev": {
1919
"laravel/pint": "^1.10.3",

src/Facades/OpenAI.php

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use OpenAI\Responses\StreamResponse;
1111

1212
/**
13+
* @method static \OpenAI\Resources\Assistants assistants()
1314
* @method static \OpenAI\Resources\Audio audio()
1415
* @method static \OpenAI\Resources\Chat chat()
1516
* @method static \OpenAI\Resources\Completions completions()
@@ -20,6 +21,7 @@
2021
* @method static \OpenAI\Resources\Images images()
2122
* @method static \OpenAI\Resources\Models models()
2223
* @method static \OpenAI\Resources\Moderations moderations()
24+
* @method static \OpenAI\Resources\Threads threads()
2325
*/
2426
final class OpenAI extends Facade
2527
{

src/ServiceProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function register(): void
3232
return OpenAI::factory()
3333
->withApiKey($apiKey)
3434
->withOrganization($organization)
35+
->withHttpHeader('OpenAI-Beta', 'assistants=v1')
3536
->withHttpClient(new \GuzzleHttp\Client(['timeout' => config('openai.request_timeout', 30)]))
3637
->make();
3738
});

0 commit comments

Comments
 (0)