Skip to content
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

[Bug]: $acceptedPredictionTokens must be of type int, null given #524

Open
fgrueninger opened this issue Feb 12, 2025 · 2 comments
Open
Labels
bug Something isn't working

Comments

@fgrueninger
Copy link

Description

Hi, I'm using v0.10.3 with Azure and with GPT-4o, all was working fine.

After switching to o1-mini, I'm getting this error:

PHP Fatal error: Uncaught TypeError: OpenAI\\Responses\\Chat\\CreateResponseUsageCompletionTokensDetails::__construct(): Argument #3 ($acceptedPredictionTokens) must be of type int, null given, called in /var/www/ai.local/vendor/openai-php/client/src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php on line 21 and defined in /var/www/ai.local/vendor/openai-php/client/src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php:9\nStack trace:\n#0 /var/www/ai.local/vendor/openai-php/client/src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php(21): OpenAI\\Responses\\Chat\\CreateResponseUsageCompletionTokensDetails->__construct()\n#1 /var/www/ai.local/vendor/openai-php/client/src/Responses/Chat/CreateResponseUsage.php(27): OpenAI\\Responses\\Chat\\CreateResponseUsageCompletionTokensDetails::from()\n#2 /var/www/ai.local/vendor/openai-php/client/src/Responses/Chat/CreateResponse.php(59): OpenAI\\Responses\\Chat\\CreateResponseUsage::from()\n#3 /var/www/ai.local/vendor/openai-php/client/src/Resources/Chat.php(35): OpenAI\\Responses\\Chat\\CreateResponse::from()\n#4 /var/www/ai.local/index.php(53): OpenAI\\Resources\\Chat->create()\n#5 {main}\n thrown in /var/www/ai.local/vendor/openai-php/client/src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php on line 9, referer: https://ai.local/

Somebody knows what this could be caused by, or how I could work around this? Thank you :)

Steps To Reproduce

Try to use o1-mini on Azure, with any message.

OpenAI PHP Client Version

v0.10.3

PHP Version

8.2.26

Notes

No response

@fgrueninger fgrueninger added the bug Something isn't working label Feb 12, 2025
@zhaozhenxiang
Copy link

I have same issue.
Many you shoud use createStreamed.

@zhaozhenxiang
Copy link

I have same issue. Many you shoud use createStreamed.

I think openai modify HTTP Response struct.
Before with:
accepted_prediction_tokens
Now without:
accepted_prediction_tokens

200-0K added a commit to 200-0K/client that referenced this issue Feb 17, 2025
200-0K added a commit to 200-0K/client that referenced this issue Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants