[PR #4587] [MERGED] Update Ollama AI Provider to Support Parsing "Thinking" Content From New Message Schema #4680

Closed
opened 2026-02-22 18:36:19 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4587
Author: @angelplusultra
Created: 10/28/2025
Status: Merged
Merged: 11/20/2025
Merged by: @timothycarambat

Base: masterHead: 4576-ollama-update-thinking


📝 Commits (4)

  • 2d3b5de add className prop to OllamaAILLM
  • d009f79 Enhance OllamaAILLM.handleStream to support parsing thinking content from the message.thinking property.
  • 0827253 refactor thinking property handler
  • 9eb07c9 Merge branch 'master' into 4576-ollama-update-thinking

📊 Changes

2 files changed (+110 additions, -29 deletions)

View changed files

📝 server/utils/AiProviders/ollama/index.js (+61 -13)
📝 server/utils/agents/aibitat/providers/ollama.js (+49 -16)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4576
resolves #4535
resolves #4561
resolves #4564

What is in this change?

This PR enhances the Ollama AI Provider to support parsing "thinking" content from reasoning models in versions v0.9.0+ of Ollama. This update is backwards compatible with older versions of Ollama.

Additional Information

I have tested functionality with latest version of Ollama and pre v0.9.0 versions.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4587 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 11/20/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4576-ollama-update-thinking` --- ### 📝 Commits (4) - [`2d3b5de`](https://github.com/Mintplex-Labs/anything-llm/commit/2d3b5de93006fdcb20056fd7203febd0e1d4214a) add className prop to OllamaAILLM - [`d009f79`](https://github.com/Mintplex-Labs/anything-llm/commit/d009f79bb0d99c8c2510765ae19ba5c136304482) Enhance `OllamaAILLM.handleStream` to support parsing thinking content from the `message.thinking` property. - [`0827253`](https://github.com/Mintplex-Labs/anything-llm/commit/0827253e06949ea068213130ac97350e89112c50) refactor thinking property handler - [`9eb07c9`](https://github.com/Mintplex-Labs/anything-llm/commit/9eb07c98eebce7d4f4dc2235b56604400caa290e) Merge branch 'master' into 4576-ollama-update-thinking ### 📊 Changes **2 files changed** (+110 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/AiProviders/ollama/index.js` (+61 -13) 📝 `server/utils/agents/aibitat/providers/ollama.js` (+49 -16) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [x] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4576 resolves #4535 resolves #4561 resolves #4564 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> This PR enhances the Ollama AI Provider to support parsing "thinking" content from reasoning models in versions v0.9.0+ of Ollama. This update is backwards compatible with older versions of Ollama. ### Additional Information I have tested functionality with latest version of Ollama and pre v0.9.0 versions. <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:19 -05:00
yindo closed this issue 2026-02-22 18:36:19 -05:00
yindo changed title from [PR #4587] Update Ollama AI Provider to Support Parsing "Thinking" Content From New Message Schema to [PR #4587] [MERGED] Update Ollama AI Provider to Support Parsing "Thinking" Content From New Message Schema 2026-06-05 15:19:47 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4680