Skip to content

Comments

chore(cohere): Correct Cohere embedding type comment to clarify AI SDK limitation#11297

Merged
lgrammel merged 3 commits intomainfrom
copilot/support-embedding-types-cohere
Dec 19, 2025
Merged

chore(cohere): Correct Cohere embedding type comment to clarify AI SDK limitation#11297
lgrammel merged 3 commits intomainfrom
copilot/support-embedding-types-cohere

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

Background

The comment in cohere-embedding-model.ts incorrectly stated that Cohere API only supports 'float' embeddings for all models. This is factually incorrect—Cohere's API supports multiple embedding types (int8, uint8, binary, ubinary), but the AI SDK implementation only supports 'float'.

Summary

Updated the inline comment to accurately reflect that the limitation is in the AI SDK, not the Cohere API:

// Before:
// The AI SDK only supports 'float' embeddings which are also the only ones
// the Cohere API docs state are supported for all models.

// After:
// The AI SDK only supports 'float' embeddings. Note that the Cohere API
// supports other embedding types, but they are not currently supported by the AI SDK.

Manual Verification

Documentation-only change. Verified tests pass.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Future Work

Support for additional Cohere embedding types (int8, uint8, binary, ubinary) could be added if there's demand.

Original prompt

This section details on the original issue you should resolve

<issue_title>Support embeddingTypes for Cohere embed</issue_title>
<issue_description>### Description

Currently, the @ai-sdk/cohere package hard-codes the embedding type to float, with no way to configure it. The source code even claims that Cohere does not support any embedding types other than float, which is incorrect.

https://github.com/vercel/ai/blob/main/packages/cohere/src/cohere-embedding-model.ts

// The AI SDK only supports 'float' embeddings which are also the only ones
// the Cohere API docs state are supported for all models.
// https://docs.cohere.com/v2/reference/embed#request.body.embedding_types
embedding_types: ['float'],

AI SDK Version

  • ai: ^6.0.0-beta.148
  • @ai-sdk/cohere: ^3.0.0-beta.48

Code of Conduct

  • I agree to follow this project's Code of Conduct</issue_description>

<agent_instructions>update the internal note. cohere may support more types, but the ai sdk does not.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Support embeddingTypes for Cohere embed Correct Cohere embedding type comment to clarify AI SDK limitation Dec 19, 2025
Copilot AI requested a review from lgrammel December 19, 2025 10:16
@lgrammel lgrammel changed the title Correct Cohere embedding type comment to clarify AI SDK limitation chore(cohere): Correct Cohere embedding type comment to clarify AI SDK limitation Dec 19, 2025
@lgrammel lgrammel marked this pull request as ready for review December 19, 2025 10:17
@lgrammel lgrammel merged commit 8b8a2db into main Dec 19, 2025
17 checks passed
@lgrammel lgrammel deleted the copilot/support-embedding-types-cohere branch December 19, 2025 10:21
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.

Support embeddingTypes for Cohere embed

2 participants