Skip to content

Commit e6eedf4

Browse files
authored
Fix: $acceptedPredictionTokens must be of type int, null given
#DZR-12375 openai-php#525
1 parent 17d1a23 commit e6eedf4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ final class CreateResponseUsageCompletionTokensDetails
99
private function __construct(
1010
public readonly ?int $audioTokens,
1111
public readonly int $reasoningTokens,
12-
public readonly int $acceptedPredictionTokens,
13-
public readonly int $rejectedPredictionTokens
12+
public readonly ?int $acceptedPredictionTokens,
13+
public readonly ?int $rejectedPredictionTokens
1414
) {}
1515

1616
/**
@@ -21,8 +21,8 @@ public static function from(array $attributes): self
2121
return new self(
2222
$attributes['audio_tokens'] ?? null,
2323
$attributes['reasoning_tokens'],
24-
$attributes['accepted_prediction_tokens'],
25-
$attributes['rejected_prediction_tokens'],
24+
$attributes['accepted_prediction_tokens'] ?? null,
25+
$attributes['rejected_prediction_tokens'] ?? null,
2626
);
2727
}
2828

0 commit comments

Comments
 (0)