client icon indicating copy to clipboard operation
client copied to clipboard

Fix #692 [Bug]: Passing invalid parameters to gemini throws Undefined…

Open alxlab-zone66x opened this issue 3 months ago • 3 comments

… array key "choices" /www/htdocs/vendor/openai-php/client/src/Responses/Chat/CreateResponse.php 54

Change-Id: Ibbf64cc554ef68844fd8338583f3fc8ec5fde413

What:

  • [ ] Bug Fix

Description:

Related:

Fix issue #692

alxlab-zone66x avatar Oct 02 '25 00:10 alxlab-zone66x

Yeah sure. That would make sense.

alxlab-zone66x avatar Oct 02 '25 14:10 alxlab-zone66x

Hmm for the ErrorException type what do you thing would be best? Google returns:

[[
            'error' => [
                'code' => 400,
                'message' => 'Invalid JSON payload received. Unknown name "ddd": Cannot find field.',
                'status' => 'INVALID_ARGUMENT',
                'details' => [
                    [
                        '@type' => 'type.googleapis.com/google.rpc.BadRequest',
                        'fieldViolations' => [
                            [
                                'description' => 'Invalid JSON payload received. Unknown name "ddd": Cannot find field.',
                            ],
                        ],
                    ],
                ],
            ],
        ]]

type.googleapis.com/google.rpc.BadRequest would be more in line with OpenAI's type invalid_request_error, but INVALID_ARGUMENT is more informative imho.

alxlab-zone66x avatar Oct 03 '25 20:10 alxlab-zone66x

type.googleapis.com/google.rpc.BadRequest would be more in line with OpenAI's type invalid_request_error, but INVALID_ARGUMENT is more informative imho.

Probably the message/status of the higher object. I think you can ignore inner details stuff.

iBotPeaches avatar Oct 03 '25 20:10 iBotPeaches