Fix #692 [Bug]: Passing invalid parameters to gemini throws Undefined…#693
Fix #692 [Bug]: Passing invalid parameters to gemini throws Undefined…#693alxlab-zone66x wants to merge 3 commits intoopenai-php:mainfrom
Conversation
… Undefined array key "choices" /www/htdocs/vendor/openai-php/client/src/Responses/Chat/CreateResponse.php 54 Change-Id: Ibbf64cc554ef68844fd8338583f3fc8ec5fde413
iBotPeaches
left a comment
There was a problem hiding this comment.
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.
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.
|
Hi! Any update on this? Maybe Google should fix it ? I suppose every SDK has issues with error payloads ? |
|
I wish Google would fix it. If you are making a parity API for OpenAI, at least make it match. My last comment is still outstanding. |
… array key "choices" /www/htdocs/vendor/openai-php/client/src/Responses/Chat/CreateResponse.php 54
Change-Id: Ibbf64cc554ef68844fd8338583f3fc8ec5fde413
What:
Description:
Related:
Fix issue #692