Describe the bug
When using Gemini 2.5 Pro or Gemini 3 Pro with thinking enabled (thinkingConfig), function calling fails with HTTP 400:
Function call is missing a thought_signature in functionCall parts
The Gemini connector does not preserve thoughtSignature tokens from API responses, which are mandatory for function calling when thinking is enabled.
To Reproduce
- Configure Gemini connector with Gemini 3 Pro (or 2.5 Pro with
thinkingConfig enabled)
- Register a kernel function/tool
- Send a prompt that triggers function calling
- Model returns function call with
thoughtSignature in response
- Connector builds follow-up request with function result
- See HTTP 400 error: "Function call is missing a thought_signature in functionCall parts"
Expected behavior
Function calling should work correctly. The connector should:
- Capture
thoughtSignature tokens from Gemini responses
- Include them in subsequent requests when sending function results
This is required by the Gemini API Thought Signatures documentation.
Screenshots
N/A - API error response.
Platform
- Language: C#
- Source: NuGet package
Microsoft.SemanticKernel.Connectors.Google (latest) / main branch
- AI model: Google Gemini 2.5 Pro, Gemini 3 Pro (any model with thinking enabled)
- IDE: Visual Studio / VS Code
- OS: Windows, Linux, Mac (all platforms affected)
Additional context
Per Google's documentation:
"When a model generates a response that includes thinking, it provides an encrypted representation of its thought process called a thought signature. This signature must be sent back with subsequent turns to maintain the reasoning context."
Current state:
API Behavior:
- For function calls:
thoughtSignature is mandatory (HTTP 400 without it)
- For text responses:
thoughtSignature is recommended for optimal performance
- Parallel function calls: Only the first
functionCall part has a thoughtSignature
Related: #13360 (IncludeThoughts / Thought Signatures)
Workaround: Disable thinking (loses reasoning quality benefits) or use custom Gemini client.
Describe the bug
When using Gemini 2.5 Pro or Gemini 3 Pro with thinking enabled (
thinkingConfig), function calling fails with HTTP 400:The Gemini connector does not preserve
thoughtSignaturetokens from API responses, which are mandatory for function calling when thinking is enabled.To Reproduce
thinkingConfigenabled)thoughtSignaturein responseExpected behavior
Function calling should work correctly. The connector should:
thoughtSignaturetokens from Gemini responsesThis is required by the Gemini API Thought Signatures documentation.
Screenshots
N/A - API error response.
Platform
Microsoft.SemanticKernel.Connectors.Google(latest) / main branchAdditional context
Per Google's documentation:
Current state:
thinkingConfigsupport added in PR Add IncludeThoughts parameter to Google Connector for accessing Gemini reasoning content #13383thoughtSignaturecapture from responses: NOT implementedthoughtSignaturerestore in requests: NOT implementedAPI Behavior:
thoughtSignatureis mandatory (HTTP 400 without it)thoughtSignatureis recommended for optimal performancefunctionCallpart has athoughtSignatureRelated: #13360 (IncludeThoughts / Thought Signatures)
Workaround: Disable thinking (loses reasoning quality benefits) or use custom Gemini client.