Skip to content

Commit 817ed8c

Browse files
authored
feat: Add getters to ConfiguresProviders (#145)
1 parent a17dc1b commit 817ed8c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Diff for: src/Concerns/ConfiguresProviders.php

+10
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,14 @@ public function usingProviderConfig(array $config): self
4141

4242
return $this;
4343
}
44+
45+
public function model(): string
46+
{
47+
return $this->model;
48+
}
49+
50+
public function providerKey(): string
51+
{
52+
return $this->providerKey;
53+
}
4454
}

Diff for: tests/Text/PendingRequestTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
->toHaveKey('openai', ['key' => 'value']);
4040
});
4141

42+
test('it allows you to get the model and provider', function (): void {
43+
$request = $this->pendingRequest
44+
->using(Provider::OpenAI, 'gpt-4');
45+
46+
expect($request->model())->toBe('gpt-4');
47+
expect($request->providerKey())->toBe('openai');
48+
});
49+
4250
test('it configures the client options', function (): void {
4351
$request = $this->pendingRequest
4452
->using(Provider::OpenAI, 'gpt-4')

0 commit comments

Comments
 (0)