Skip to content
Source
Sign inSign up
TanStack/ai

Gemini Thinking output is added to content instead of thinking chunks. #209

Closedjpkraemer(GitHub profile, opens in a new tab) opened this issue 0 comments

TanStack AI version

0.2.1

Framework/Library version

React 19.0

Describe the bug and the steps to reproduce it

When I enable thinking for Gemini with: modelOptions: { thinkingConfig: { includeThoughts: true, thinkingBudget: 500, } }

I receive all the thinking output as part of the content chunks.

This is caused by the processStreamChunks method in the Gemini text adapter: https://github.com/TanStack/ai/blob/1ce1e88300da473074c4e7b72586dfcf0656f4cc/packages/typescript/ai-gemini/src/adapters/text.ts#L214

When if (part.text) the code should further check if part.thought is true. If it is we shall yield { type: 'thinking', ... }.

--

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. AlemTuzlak closed this

Sign in to join this conversation.