mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 15:55:19 +00:00
fix(python): support Cohere embed-v4.0 in CohereEmbeddingFunction (#4805)
`CohereEmbeddingFunction(name="embed-v4.0")` raised `ValueError: Model embed-v4.0 not supported`. **Cause.** `ndims()` uses a closed list of v2/v3 model names and raises for everything else, so Cohere's current embedding model was rejected. **Fix.** Add `embed-v4.0` to `ndims()`, returning its default output dimension (1536). **Test.** `test_cohere_embed_v4_is_supported` creates the function with `name="embed-v4.0"` and checks `ndims() == 1536`. It fails before the change with the `ValueError` and passes after; the existing Cohere default-model test still passes. This change was prepared with the help of an AI assistant (Claude Code), and the author is responsible for the change. ---------
This commit is contained in:
@@ -20,6 +20,7 @@ Supported models are:
|
||||
- embed-multilingual-v3.0
|
||||
- embed-english-light-v3.0
|
||||
- embed-multilingual-light-v3.0
|
||||
- embed-v4.0 (1536-dimensional by default)
|
||||
|
||||
The v2.0 models (`embed-english-v2.0`, `embed-english-light-v2.0` and `embed-multilingual-v2.0`) were retired by Cohere on April 4, 2026.
|
||||
|
||||
@@ -33,7 +34,7 @@ Supported parameters (to be passed in `create` method) are:
|
||||
|
||||
| Parameter | Type | Default Value | Description |
|
||||
|---|---|--------|---------|
|
||||
| `name` | `str` | `"embed-multilingual-v3.0"` | The model ID of the cohere model to use. Supported base models for Text Embeddings: embed-english-v3.0, embed-multilingual-v3.0, embed-english-light-v3.0, embed-multilingual-light-v3.0 |
|
||||
| `name` | `str` | `"embed-multilingual-v3.0"` | The model ID of the cohere model to use. Supported base models for Text Embeddings: embed-english-v3.0, embed-multilingual-v3.0, embed-english-light-v3.0, embed-multilingual-light-v3.0, embed-v4.0 (1536-dimensional by default) |
|
||||
| `source_input_type` | `str` | `"search_document"` | The type of input data to be used for the source column. |
|
||||
| `query_input_type` | `str` | `"search_query"` | The type of input data to be used for the query. |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user