-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
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
thinkingConfigenabled) - Register a kernel function/tool
- Send a prompt that triggers function calling
- Model returns function call with
thoughtSignaturein 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
thoughtSignaturetokens 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
"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:
thinkingConfigsupport added in PR Add IncludeThoughts parameter to Google Connector for accessing Gemini reasoning content #13383thoughtSignaturecapture from responses: NOT implementedthoughtSignaturerestore in requests: NOT implemented
API Behavior:
- For function calls:
thoughtSignatureis mandatory (HTTP 400 without it) - For text responses:
thoughtSignatureis recommended for optimal performance - Parallel function calls: Only the first
functionCallpart has athoughtSignature
Related: #13360 (IncludeThoughts / Thought Signatures)
Workaround: Disable thinking (loses reasoning quality benefits) or use custom Gemini client.