Skip to content

Conversation

@pawel-twardziak
Copy link

What has been done:

  • Store Ollama model "thinking" responses in additional_kwargs.reasoning_content instead of mixing with main content
  • Preserve additional_kwargs when constructing non-chunk messages from streams
  • Add unit test verifying thinking content is properly separated
  • Add integration tests ensuring reasoning_content is populated when think=true and absent when think=false
  • Fixes issue where thinking tags or content were appearing in the main response content

Fixes #9089

- Store Ollama model "thinking" responses in additional_kwargs.reasoning_content instead of mixing with main content
- Preserve additional_kwargs when constructing non-chunk messages from streams
- Add unit test verifying thinking content is properly separated
- Add integration tests ensuring reasoning_content is populated when think=true and absent when think=false
- Fixes issue where thinking tags or content were appearing in the main response content
@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2025

⚠️ No Changeset found

Latest commit: 289a522

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Oct 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Updated (UTC)
langchainjs-docs Ignored Ignored Oct 14, 2025 4:37pm

@pawel-twardziak
Copy link
Author

I need to update my branch with main since main has changed in the area of my work

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChatOllama: AIMessageChunk missing reasoning_content in additional_kwargs (concatenated into content instead)

1 participant