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:

  1. Setting thought_signature: "INCLUDE_THOUGHTS_NEW_CONVERSATION" for new conversations
  2. Passing back the thought_signature from previous responses for follow-up messages

Proposed Solution

  1. Add ThoughtSignature option to googleai.Options
  2. Handle thought_signature in request building
  3. Parse and expose thought_signature from responses for multi-turn conversations
  4. Consider auto-handling for agentic loops (tool calling)

References

Workaround

Currently, use gemini-2.5-flash or gemini-2.5-pro which don't require thought signatures.