Skip to content

Conversation

@njbrake
Copy link
Contributor

@njbrake njbrake commented Oct 15, 2025

  • Updated the CohereProvider to support reasoning in completion responses.
  • Modified the response conversion methods to handle V2ChatResponse and reasoning content.

Description

PR Type

🆕 New Feature ## Relevant issues

Checklist

  • I have added unit tests that prove my fix/feature works
  • New and existing tests pass locally
  • Documentation was updated where necessary
  • I have read and followed the contribution guidelines```

- Updated the CohereProvider to support reasoning in completion responses.
- Modified the response conversion methods to handle V2ChatResponse and reasoning content.
- Added a new model mapping for the Cohere provider in the test configuration.
@njbrake njbrake linked an issue Oct 15, 2025 that may be closed by this pull request
@njbrake njbrake requested a review from daavoo October 15, 2025 19:35
@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/any_llm/providers/cohere/utils.py 75.00% 0 Missing and 4 partials ⚠️
Files with missing lines Coverage Δ
src/any_llm/providers/cohere/cohere.py 91.46% <100.00%> (+0.10%) ⬆️
src/any_llm/providers/cohere/utils.py 77.92% <75.00%> (-0.87%) ⬇️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@daavoo daavoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration tests: https://github.com/mozilla-ai/any-llm/actions/runs/18554330010/job/52888075644#step:6:75

Not as part of this PR, but I think we should handle reasoning_effort in cohere similar to how we handle it in gemini, by mapping to token_budget values:

https://docs.cohere.com/reference/chat#request.body.thinking

@njbrake njbrake merged commit 1dd5a6d into main Oct 16, 2025
13 checks passed
@njbrake njbrake deleted the 280-cohere-completion-api-reasoning-support branch October 16, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cohere Completion API Reasoning Support

3 participants