Skip to content

Conversation

@ksheasby-va
Copy link

@ksheasby-va ksheasby-va commented Jan 7, 2026

This pull request enhances the handling of "thinking" (internal reasoning) content for Google Gemini 3 models in the llms/googleaiv2 integration. The changes ensure that thought content is extracted, streamed, and returned in a standardized way, improving compatibility with other providers and enabling richer reasoning features. Unit tests are also updated to verify the new behavior.

Gemini 3 "thinking" content extraction and streaming:

  • Refactored the convertThinkingConfig function to only set ThinkingLevel for HIGH mode, enabling more natural "thinking" for other modes by just enabling IncludeThoughts without forcing extended behavior.
  • Updated convertCandidates to extract and separate reasoning/thought content from regular text, storing it in both the response and metadata (ReasoningContent and ThinkingContent). [1] [2] [3]
  • Enhanced streaming support to emit thought chunks via a new StreamingReasoningFunc callback, prevent duplicate thoughts, and accumulate all streamed thoughts for inclusion in the final response. [1] [2] [3] [4] [5] [6]

Testing improvements:

  • Added and extended unit tests to verify extraction and correct assignment of thinking content, including checks for content separation, metadata, and token counts. [1] [2]

DALE-937

…ing thinking content in candidate responses.

DALE-937
…ion to improve response generation. Only set ThinkingLevel for HIGH mode, allowing natural thought processing for other modes.

DALE-937
@ksheasby-va ksheasby-va changed the title Kyle dale 937 gemini 3 thinking wip(gemini 3): Add support for streaming Gemini 3 thoughts Jan 7, 2026
… support for low and high thinking levels.

DALE-937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants