Skip to content

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

@jpkraemer

Description

@jpkraemer

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:

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

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

--

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions