Skip to content

Commit 6ea4c7e

Browse files
Add project
1 parent 96f4407 commit 6ea4c7e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/OpenAI.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
expect($openAI)->toBeInstanceOf(Client::class);
1818
});
1919

20+
it('sets project when provided', function () {
21+
$openAI = OpenAI::client('foo', 'nunomaduro', 'openai_proj');
22+
23+
expect($openAI)->toBeInstanceOf(Client::class);
24+
});
25+
2026
it('may create a client via factory', function () {
2127
$openAI = OpenAI::factory()
2228
->withApiKey('foo')
@@ -33,6 +39,15 @@
3339
expect($openAI)->toBeInstanceOf(Client::class);
3440
});
3541

42+
it('sets an project via factory', function () {
43+
$openAI = OpenAI::factory()
44+
->withOrganization('nunomaduro')
45+
->withProject('openai_proj')
46+
->make();
47+
48+
expect($openAI)->toBeInstanceOf(Client::class);
49+
});
50+
3651
it('sets a custom client via factory', function () {
3752
$openAI = OpenAI::factory()
3853
->withHttpClient(new GuzzleClient())

0 commit comments

Comments
 (0)