-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(cohere): add support from Reasoning/Vision/Translate models #8597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 9 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="core/llm/llms/Cohere.ts">
<violation number="1" location="core/llm/llms/Cohere.ts:83">
Wrapping assistant content in a `{type: "text"}` block assigns arrays of `MessagePart`s to the `text` field, corrupting structured assistant replies when they are already multi-part.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| } else { | ||
| msg.content.push({ | ||
| type: "text", | ||
| text: m.content, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrapping assistant content in a {type: "text"} block assigns arrays of MessageParts to the text field, corrupting structured assistant replies when they are already multi-part.
Prompt for AI agents
Address the following comment on core/llm/llms/Cohere.ts at line 83:
<comment>Wrapping assistant content in a `{type: "text"}` block assigns arrays of `MessagePart`s to the `text` field, corrupting structured assistant replies when they are already multi-part.</comment>
<file context>
@@ -48,36 +47,44 @@ class Cohere extends BaseLLM {
+ } else {
+ msg.content.push({
+ type: "text",
+ text: m.content,
});
- lastToolPlan = undefined;
</file context>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxbrunet could you check this feedback?
RomneyDa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxbrunet appreciate this contribution and thanks for the tests.
Pretty much looks good to me, could you check on the comments briefly including the cubic one? Then should be good to merge
| { | ||
| model: "command-a-translate-08-2025", | ||
| displayName: "Command A Translate 08-2025", | ||
| contextLength: 8000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably 8192, not critical
| switch (value.type) { | ||
| // https://docs.cohere.com/v2/docs/streaming#content-delta | ||
| case "content-delta": | ||
| if (value.delta.message.content.thinking) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxbrunet just to double check can content deltas also have text that would be lost here? or is it thinking OR text?
| } else { | ||
| msg.content.push({ | ||
| type: "text", | ||
| text: m.content, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxbrunet could you check this feedback?
Description
[ What changed? Feel free to be brief. ]
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Add Cohere Reasoning, Vision, and Translate model support across the provider, UI, and docs. Enables thinking traces, image input, and new models with correct tool-calling behavior and tests.
Written for commit 9525ea8. Summary will update automatically on new commits.