Skip to content

Commit

Permalink
Add project
Browse files Browse the repository at this point in the history
  • Loading branch information
ManukMinasyan authored Apr 17, 2024
1 parent 96f4407 commit 6ea4c7e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/OpenAI.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
expect($openAI)->toBeInstanceOf(Client::class);
});

it('sets project when provided', function () {
$openAI = OpenAI::client('foo', 'nunomaduro', 'openai_proj');

expect($openAI)->toBeInstanceOf(Client::class);
});

it('may create a client via factory', function () {
$openAI = OpenAI::factory()
->withApiKey('foo')
Expand All @@ -33,6 +39,15 @@
expect($openAI)->toBeInstanceOf(Client::class);
});

it('sets an project via factory', function () {
$openAI = OpenAI::factory()
->withOrganization('nunomaduro')
->withProject('openai_proj')
->make();

expect($openAI)->toBeInstanceOf(Client::class);
});

it('sets a custom client via factory', function () {
$openAI = OpenAI::factory()
->withHttpClient(new GuzzleClient())
Expand Down

0 comments on commit 6ea4c7e

Please sign in to comment.