[PR #5654] [MERGED] Support reasoning content in v2 stream handler #5511

Closed
opened 2026-06-05 15:21:35 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5654
Author: @timothycarambat
Created: 5/19/2026
Status: Merged
Merged: 5/19/2026
Merged by: @timothycarambat

Base: masterHead: support-reasoning-content-v2


📝 Commits (4)

  • 3011478 refactor LMStudio for reasoning_content
  • 834f838 Lemonade stream/completion reasoning optional via v2 change
  • 2b5f035 migrate Deepseek and GiteeAI
  • 96d5c5b Merge branch 'master' into support-reasoning-content-v2

📊 Changes

5 files changed (+83 additions, -280 deletions)

View changed files

📝 server/utils/AiProviders/deepseek/index.js (+2 -139)
📝 server/utils/AiProviders/giteeai/index.js (+2 -139)
📝 server/utils/AiProviders/lemonade/index.js (+17 -1)
📝 server/utils/AiProviders/lmStudio/index.js (+17 -1)
📝 server/utils/helpers/chat/responses.js (+45 -0)

📄 Description

Pull Request Type

  • feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

closes #5584
resolves #5583
resolves #5585

Description

Adds option-chained resoning_content to the responseHandlerStreamV2 function that can optional preprend thinking blocks to the output for Lemonade and LMStudio runtimes with reasoning models.

Migrated deepseek and giteeAI to use this same stream handler as well since they are exact same code now.

Visuals (if applicable)

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • 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/5654 **Author:** [@timothycarambat](https://github.com/timothycarambat) **Created:** 5/19/2026 **Status:** ✅ Merged **Merged:** 5/19/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `support-reasoning-content-v2` --- ### 📝 Commits (4) - [`3011478`](https://github.com/Mintplex-Labs/anything-llm/commit/3011478220575d301a5da3257492141db36c098d) refactor LMStudio for reasoning_content - [`834f838`](https://github.com/Mintplex-Labs/anything-llm/commit/834f83890c0c778e46c4c8346f4610d4f27d2baf) Lemonade stream/completion reasoning optional via v2 change - [`2b5f035`](https://github.com/Mintplex-Labs/anything-llm/commit/2b5f0352935cedd751a5b850609d36906266e298) migrate Deepseek and GiteeAI - [`96d5c5b`](https://github.com/Mintplex-Labs/anything-llm/commit/96d5c5bc945af86884394bbd0ef344bfcf6d32a5) Merge branch 'master' into support-reasoning-content-v2 ### 📊 Changes **5 files changed** (+83 additions, -280 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/AiProviders/deepseek/index.js` (+2 -139) 📝 `server/utils/AiProviders/giteeai/index.js` (+2 -139) 📝 `server/utils/AiProviders/lemonade/index.js` (+17 -1) 📝 `server/utils/AiProviders/lmStudio/index.js` (+17 -1) 📝 `server/utils/helpers/chat/responses.js` (+45 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat (New feature) - [ ] 🐛 fix (Bug fix) - [x] ♻️ refactor (Code refactoring without changing behavior) - [ ] 💄 style (UI style changes) - [ ] 🔨 chore (Build, CI, maintenance) - [ ] 📝 docs (Documentation updates) ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> closes #5584 resolves #5583 resolves #5585 ### Description Adds option-chained `resoning_content` to the responseHandlerStreamV2 function that can optional preprend thinking blocks to the output for `Lemonade` and `LMStudio` runtimes with reasoning models. Migrated `deepseek` and `giteeAI` to use this same stream handler as well since they are exact same code now. <!-- Describe the changes in this PR that are impactful to the repo. What problem does it solve? --> ### Visuals (if applicable) <!-- Add screenshots or screen recordings to demonstrate the changes, especially for UI updates. --> ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [ ] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated (if applicable) - [ ] 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-06-05 15:21:35 -04:00
yindo closed this issue 2026-06-05 15:21:35 -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#5511