Skip to content

Conversation

alxlab-zone66x
Copy link

… 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

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

Change-Id: Ibbf64cc554ef68844fd8338583f3fc8ec5fde413
Copy link
Collaborator

@iBotPeaches iBotPeaches left a 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.

@alxlab-zone66x
Copy link
Author

Yeah sure. That would make sense.

@alxlab-zone66x
Copy link
Author

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.

@iBotPeaches
Copy link
Collaborator

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.

… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants