-
-
Notifications
You must be signed in to change notification settings - Fork 566
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]: Undefined array key "index" #526
Labels
bug
Something isn't working
Comments
I found the same when using Gemini. The issue appears to be that Google do not return an id attribute with their responses. A quick fix was to null coalesce $attributes['id'] in the CreateResponse class for both Chats and Completions (lines 54 and 53 respectively):-
NB I gave them a random value rather than empty or null just in case. |
I've fixed it by using my custom HTTP client
HttpClient.php
|
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Warning: Undefined array key "index"
caused in Responses/Completions/CreateResponseChoice.php#L23Steps To Reproduce
By receiving the following attributes:

from Openrouter.ai with different models, using
OpenAI PHP Client Version
v0.10.3
PHP Version
8.4.3
Notes
No response
The text was updated successfully, but these errors were encountered: