Skip to content

Commit 1130412

Browse files
committed
Fixed OpenAI tests
1 parent 16c7de6 commit 1130412

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Instrumentation/OpenAIPHP/src/OpenAIPHPInstrumentation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public static function register(): void
7474

7575
private static function hookApi(CachedInstrumentation $instrumentation, $class, string $resource, string $operation)
7676
{
77+
/** @psalm-suppress UnusedFunctionCall */
7778
hook(
7879
$class,
7980
$operation,

src/Instrumentation/OpenAIPHP/tests/Integration/OpenAIPHPInstrumentationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function tearDown(): void
5252

5353
private function loadFile(string $file): string
5454
{
55-
return file_get_contents(__DIR__ . '/../resources/' . $file . '.json');
55+
return file_get_contents(__DIR__ . '/../resources/' . $file . '.json') ?: '';
5656
}
5757

5858
private function createClient(string $fixture): Client
@@ -99,7 +99,7 @@ public function dataProvider(): array
9999
public function test_openai_operation($api, $operation, $args, $fixture, array $spanAttributes): void
100100
{
101101
$client = $this->createClient($fixture);
102-
$response = $client->$api()->$operation(...$args);
102+
$client->$api()->$operation(...$args);
103103

104104
$this->assertCount(1, $this->storage);
105105

@@ -127,7 +127,7 @@ public function test_will_set_status()
127127
->make();
128128

129129
try {
130-
$response = $client->completions()->create([
130+
$client->completions()->create([
131131
'model' => 'gpt-3.5-turbo-instruct',
132132
'prompt' => 'Say this is a test',
133133
'max_tokens' => 7,

0 commit comments

Comments
 (0)