[PR #4703] [MERGED] Feat/cohere agent implementation #4722

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

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4703
Author: @17ColinMiPerry
Created: 12/2/2025
Status: Merged
Merged: 12/12/2025
Merged by: @timothycarambat

Base: masterHead: feat/cohere-agent-implementation


📝 Commits (8)

  • 31c2f81 implement cohere agent support
  • c493783 run yarn lint
  • 9164c2e Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into pr-4703-branch
  • c94c657 moderize Cohere
  • ebf106c change default model to real model tag
  • 192a1cd remove debug
  • 2c216df update default
  • 15b9144 only whitelist known labels

📊 Changes

10 files changed (+340 additions, -6 deletions)

View changed files

📝 frontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx (+1 -1)
📝 server/endpoints/utils.js (+3 -0)
📝 server/package.json (+1 -0)
📝 server/utils/agents/aibitat/index.js (+2 -0)
📝 server/utils/agents/aibitat/providers/ai-provider.js (+6 -1)
server/utils/agents/aibitat/providers/cohere.js (+251 -0)
📝 server/utils/agents/aibitat/providers/index.js (+2 -0)
📝 server/utils/agents/index.js (+7 -0)
📝 server/utils/helpers/customModels.js (+1 -1)
📝 server/yarn.lock (+66 -3)

📄 Description

Pull Request Type

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

Relevant Issues

resolves #4490

What is in this change?

Adds @agent support for Cohere. Uses v1 SDK to be consistent with the LLM provider implementation.

#convertChatHistoryCohere: converts standard messages to the format expected by Cohere.
#handleFunctionCallStream/Chat: Complies to Cohere API by passing message + chat_history
streamingFunctionCall: Overridden from UnTooled to handle Cohere's stream event format
stream/complete: Overrides to handle Cohere's SDK response structure

Additional Information

Currently, we don't have the @langchain/cohere package, so there is no LangChain integration.
https://docs.cohere.com/v1/reference/about

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/4703 **Author:** [@17ColinMiPerry](https://github.com/17ColinMiPerry) **Created:** 12/2/2025 **Status:** ✅ Merged **Merged:** 12/12/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `feat/cohere-agent-implementation` --- ### 📝 Commits (8) - [`31c2f81`](https://github.com/Mintplex-Labs/anything-llm/commit/31c2f81a7b27a3c9ad8373b31646215759081639) implement cohere agent support - [`c493783`](https://github.com/Mintplex-Labs/anything-llm/commit/c49378344dc8b8125a4396dac9be37dd5b0e2582) run yarn lint - [`9164c2e`](https://github.com/Mintplex-Labs/anything-llm/commit/9164c2e99da4fe4efefa51a7fa263d6a0ab5c9aa) Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into pr-4703-branch - [`c94c657`](https://github.com/Mintplex-Labs/anything-llm/commit/c94c657b68c56fdb044a0aa3ef4719a7d0c728f4) moderize Cohere - [`ebf106c`](https://github.com/Mintplex-Labs/anything-llm/commit/ebf106c9a4bc41cfcb73d2bded3ff87be3f4edf2) change default model to real model tag - [`192a1cd`](https://github.com/Mintplex-Labs/anything-llm/commit/192a1cd43c5818d36ddf3ae87c18099ddf51722b) remove debug - [`2c216df`](https://github.com/Mintplex-Labs/anything-llm/commit/2c216dfbd1ce7ceb459d3e87e4916bc3858c506d) update default - [`15b9144`](https://github.com/Mintplex-Labs/anything-llm/commit/15b9144c3d6db3ea019a4dbc0e19e7d0403877b6) only whitelist known labels ### 📊 Changes **10 files changed** (+340 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx` (+1 -1) 📝 `server/endpoints/utils.js` (+3 -0) 📝 `server/package.json` (+1 -0) 📝 `server/utils/agents/aibitat/index.js` (+2 -0) 📝 `server/utils/agents/aibitat/providers/ai-provider.js` (+6 -1) ➕ `server/utils/agents/aibitat/providers/cohere.js` (+251 -0) 📝 `server/utils/agents/aibitat/providers/index.js` (+2 -0) 📝 `server/utils/agents/index.js` (+7 -0) 📝 `server/utils/helpers/customModels.js` (+1 -1) 📝 `server/yarn.lock` (+66 -3) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4490 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> Adds `@agent` support for Cohere. Uses v1 SDK to be consistent with the LLM provider implementation. `#convertChatHistoryCohere`: converts standard messages to the format expected by Cohere. `#handleFunctionCallStream/Chat`: Complies to Cohere API by passing message + chat_history `streamingFunctionCall`: Overridden from `UnTooled` to handle Cohere's stream event format `stream/complete`: Overrides to handle Cohere's SDK response structure ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> Currently, we don't have the `@langchain/cohere` package, so there is no LangChain integration. https://docs.cohere.com/v1/reference/about ### 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 - [x] 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:24 -05:00
yindo closed this issue 2026-02-22 18:36:24 -05:00
yindo changed title from [PR #4703] Feat/cohere agent implementation to [PR #4703] [MERGED] Feat/cohere agent implementation 2026-06-05 15:20:02 -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#4722