Skip to content

Fix: $acceptedPredictionTokens must be of type int, null given | #524 😇 #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
private function __construct(
public readonly ?int $audioTokens,
public readonly int $reasoningTokens,
public readonly int $acceptedPredictionTokens,
public readonly int $rejectedPredictionTokens
public readonly ?int $acceptedPredictionTokens,
public readonly ?int $rejectedPredictionTokens
) {}

/**
Expand All @@ -21,8 +21,8 @@
return new self(
$attributes['audio_tokens'] ?? null,
$attributes['reasoning_tokens'],
$attributes['accepted_prediction_tokens'],
$attributes['rejected_prediction_tokens'],
$attributes['accepted_prediction_tokens'] ?? null,

Check failure on line 24 in src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-lowest

Offset 'accepted_prediction…' on array{audio_tokens?: int, reasoning_tokens: int, accepted_prediction_tokens: int, rejected_prediction_tokens: int} on left side of ?? always exists and is not nullable.

Check failure on line 24 in src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-stable

Offset 'accepted_prediction…' on array{audio_tokens?: int, reasoning_tokens: int, accepted_prediction_tokens: int, rejected_prediction_tokens: int} on left side of ?? always exists and is not nullable.
$attributes['rejected_prediction_tokens'] ?? null,

Check failure on line 25 in src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-lowest

Offset 'rejected_prediction…' on array{audio_tokens?: int, reasoning_tokens: int, accepted_prediction_tokens: int, rejected_prediction_tokens: int} on left side of ?? always exists and is not nullable.

Check failure on line 25 in src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-stable

Offset 'rejected_prediction…' on array{audio_tokens?: int, reasoning_tokens: int, accepted_prediction_tokens: int, rejected_prediction_tokens: int} on left side of ?? always exists and is not nullable.
);
}

Expand All @@ -41,6 +41,6 @@
$result['audio_tokens'] = $this->audioTokens;
}

return $result;

Check failure on line 44 in src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-lowest

Method OpenAI\Responses\Chat\CreateResponseUsageCompletionTokensDetails::toArray() should return array{audio_tokens?: int, reasoning_tokens: int, accepted_prediction_tokens: int, rejected_prediction_tokens: int} but returns array{reasoning_tokens: int, accepted_prediction_tokens: int|null, rejected_prediction_tokens: int|null, audio_tokens?: int}.

Check failure on line 44 in src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-stable

Method OpenAI\Responses\Chat\CreateResponseUsageCompletionTokensDetails::toArray() should return array{audio_tokens?: int, reasoning_tokens: int, accepted_prediction_tokens: int, rejected_prediction_tokens: int} but returns array{reasoning_tokens: int, accepted_prediction_tokens: int|null, rejected_prediction_tokens: int|null, audio_tokens?: int}.
}
}
Loading