-
-
Notifications
You must be signed in to change notification settings - Fork 648
Fix #692 [Bug]: Passing invalid parameters to gemini throws Undefined… #693
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
base: main
Are you sure you want to change the base?
Conversation
… Undefined array key "choices" /www/htdocs/vendor/openai-php/client/src/Responses/Chat/CreateResponse.php 54 Change-Id: Ibbf64cc554ef68844fd8338583f3fc8ec5fde413
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test to confirm this? I think the HttpTransporter tests is the area to make a formulated Gemini exception to confirm this.
Yeah sure. That would make sense. |
Hmm for the
|
Probably the message/status of the higher object. I think you can ignore inner details stuff. |
… Undefined array key "choices" /www/htdocs/vendor/openai-php/client/src/Responses/Chat/CreateResponse.php 54 Add tests for gemini with invalid parameter. Set ErrorException type to return error status for invalid gemini parameter. Change-Id: I076016d0470eb3060d3f972702e4e3701b52207d
54d60ea
to
6591d36
Compare
if (! isset($data[0]['error']['type']) && isset($data[0]['error']['status'])) { | ||
$data[0]['error']['type'] = $data[0]['error']['status']; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is the only thing I'm iffy on right now. I'd rather the ErrorException class navigate the water of different error structures to normalize them. So the HTTPTransporter isn't required to formulate things perfectly for an exception class.
… array key "choices" /www/htdocs/vendor/openai-php/client/src/Responses/Chat/CreateResponse.php 54
Change-Id: Ibbf64cc554ef68844fd8338583f3fc8ec5fde413
What:
Description:
Related:
Fix issue #692