googleai: Add support for Gemini 3 thought_signature parameter
Author: ElecTwixCreated Jan 16, 2026Updated Feb 28, 2026
Problem
When using Gemini 3 models (e.g., gemini-3-flash-preview), the API returns an error requiring a thought_signature parameter:
googleapi: Error 400: Thought signature is required for thinking models.
Please set `thought_signature` to a thought signature from a previous response,
or to `INCLUDE_THOUGHTS_NEW_CONVERSATION` to start a new conversation.Gemini 3 introduced a new "thinking" feature where the model can show its reasoning process. This requires:
- Setting
thought_signature: "INCLUDE_THOUGHTS_NEW_CONVERSATION"for new conversations - Passing back the
thought_signaturefrom previous responses for follow-up messages
Proposed Solution
- Add
ThoughtSignatureoption togoogleai.Options - Handle
thought_signaturein request building - Parse and expose
thought_signaturefrom responses for multi-turn conversations - Consider auto-handling for agentic loops (tool calling)
References
- Gemini 3 thinking documentation
- Affects:
gemini-3-flash-preview,gemini-3-pro-preview, and future thinking models
Workaround
Currently, use gemini-2.5-flash or gemini-2.5-pro which don't require thought signatures.
Source: tmc/langchaingo