Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
50.00% |
2 / 4 |
|
33.33% |
1 / 3 |
CRAP | |
0.00% |
0 / 1 |
BaseClient | |
50.00% |
2 / 4 |
|
33.33% |
1 / 3 |
4.12 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setClient | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
chat | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
setModel | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getModel | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Mbvb1223\ChatAiMulticlient\Clients; |
6 | |
7 | abstract class BaseClient |
8 | { |
9 | protected string $model; |
10 | protected string $apiKey; |
11 | |
12 | public function __construct(string $apiKey) |
13 | { |
14 | $this->apiKey = $apiKey; |
15 | $this->setClient($apiKey); |
16 | } |
17 | |
18 | abstract public function setClient(string $apiKey): void; |
19 | |
20 | abstract public function chat(string $text, string $model = null, array $options = []): string; |
21 | |
22 | public function setModel(string $model): void |
23 | { |
24 | $this->model = $model; |
25 | } |
26 | |
27 | public function getModel(): string |
28 | { |
29 | return $this->model; |
30 | } |
31 | } |