Skip to content

Function call is missing a thought_signature in functionCall parts from Gemini API (model: gemini-3-flash-preview) #756

@HhSen

Description

@HhSen

Describe the bug

Function call is missing a thought_signature in functionCall parts. Status: INVALID_ARGUMENT
When the response contains candidate with extra parts with though_signature like:

"candidates": [
            {
                "content": {
                    "parts": [
                        {
                            "functionCall": {
                                ...
                            }
                        },
                        {
                            "text": "",
                            "thoughtSignature": "...thoughtSignature here..."
                        }
                    ],
                    "role": "model"
                },
                "finishReason": "STOP",
                "groundingMetadata": {
                    "retrievalMetadata": {},
                    "searchEntryPoint": {
                        "renderedContent": "..."
                    },
                    "webSearchQueries": [
                        ...
                    ]
                }
            }
        ],

To Reproduce

This case happens occasionally, and this case is not included in the document of thoughtSignature in https://docs.cloud.google.com/vertex-ai/generative-ai/docs/thought-signatures yet sometimes it returns such response

Expected behavior

Set the thoughtSignature in the first part of functionCall event with an extra candidate part and no thoughtSignature in functionCall part.

Screenshots

Version:

gemini@0.1.28

Environment:

The output of go env.

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugThis is a bug-report. Bug-fix PRs use `C-enhancement` instead.D-chatmodel-implDomain: This is an issue related to particular ChatModel implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions