Skip to content

Commit 730a482

Browse files
Merge branch 'main' into fix/2939-sparse-vector-storage
2 parents f0aac56 + 10d60da commit 730a482

File tree

109 files changed

+389
-179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+389
-179
lines changed

integrations/cohere/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [integrations/cohere-v8.1.0] - 2026-03-19
4+
5+
### 🚀 Features
6+
7+
- Add list of models supported by Cohere components (#2993)
8+
9+
### 🧹 Chores
10+
11+
- Enable ANN ruff ruleset for cohere integration (#2983)
12+
13+
314
## [integrations/cohere-v8.0.1] - 2026-03-17
415

516
### 🐛 Bug Fixes

integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44
from dataclasses import replace
5-
from typing import Any
5+
from typing import Any, ClassVar
66

77
from haystack import Document, component, default_from_dict, default_to_dict
88
from haystack.utils import Secret, deserialize_secrets_inplace
@@ -36,6 +36,16 @@ class CohereDocumentEmbedder:
3636
```
3737
"""
3838

39+
SUPPORTED_MODELS: ClassVar[list[str]] = [
40+
"embed-v4.0",
41+
"embed-english-v3.0",
42+
"embed-english-light-v3.0",
43+
"embed-multilingual-v3.0",
44+
"embed-multilingual-light-v3.0",
45+
]
46+
"""A non-exhaustive list of embed models supported by this component.
47+
See https://docs.cohere.com/docs/models#embed for the full list."""
48+
3949
def __init__(
4050
self,
4151
api_key: Secret = Secret.from_env_var(["COHERE_API_KEY", "CO_API_KEY"]),

integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_image_embedder.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
from dataclasses import replace
6-
from typing import Any
6+
from typing import Any, ClassVar
77

88
from haystack import Document, component, default_from_dict, default_to_dict, logging
99
from haystack.components.converters.image.image_utils import (
@@ -59,6 +59,16 @@ class CohereDocumentImageEmbedder:
5959
```
6060
"""
6161

62+
SUPPORTED_MODELS: ClassVar[list[str]] = [
63+
"embed-v4.0",
64+
"embed-english-v3.0",
65+
"embed-english-light-v3.0",
66+
"embed-multilingual-v3.0",
67+
"embed-multilingual-light-v3.0",
68+
]
69+
"""A non-exhaustive list of embed models supported by this component.
70+
See https://docs.cohere.com/docs/models#embed for the full list."""
71+
6272
def __init__(
6373
self,
6474
*,

integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
22
#
33
# SPDX-License-Identifier: Apache-2.0
4-
from typing import Any
4+
from typing import Any, ClassVar
55

66
from haystack import component, default_from_dict, default_to_dict
77
from haystack.utils import Secret, deserialize_secrets_inplace
@@ -32,6 +32,16 @@ class CohereTextEmbedder:
3232
```
3333
"""
3434

35+
SUPPORTED_MODELS: ClassVar[list[str]] = [
36+
"embed-v4.0",
37+
"embed-english-v3.0",
38+
"embed-english-light-v3.0",
39+
"embed-multilingual-v3.0",
40+
"embed-multilingual-light-v3.0",
41+
]
42+
"""A non-exhaustive list of embed models supported by this component.
43+
See https://docs.cohere.com/docs/models#embed for the full list."""
44+
3545
def __init__(
3646
self,
3747
api_key: Secret = Secret.from_env_var(["COHERE_API_KEY", "CO_API_KEY"]),

integrations/cohere/src/haystack_integrations/components/generators/cohere/chat/chat_generator.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
22
from collections.abc import AsyncIterator, Iterator
3-
from typing import Any, Literal, get_args
3+
from typing import Any, ClassVar, Literal, get_args
44

55
from haystack import component, default_from_dict, default_to_dict, logging
66
from haystack.components.generators.utils import _convert_streaming_chunks_to_chat_message
@@ -480,6 +480,24 @@ def weather(city: str) -> str:
480480
```
481481
"""
482482

483+
SUPPORTED_MODELS: ClassVar[list[str]] = [
484+
"command-a-03-2025",
485+
"command-r7b-12-2024",
486+
"command-a-translate-08-2025",
487+
"command-a-reasoning-08-2025",
488+
"command-a-vision-07-2025",
489+
"command-r-08-2024",
490+
"command-r-plus-08-2024",
491+
"command-r-03-2024",
492+
"command-r-plus-04-2024",
493+
"command-r-plus",
494+
"command-r",
495+
"command-light",
496+
"command",
497+
]
498+
"""A non-exhaustive list of chat models supported by this component.
499+
See https://docs.cohere.com/docs/models#command for the full list."""
500+
483501
def __init__(
484502
self,
485503
api_key: Secret = Secret.from_env_var(["COHERE_API_KEY", "CO_API_KEY"]),

integrations/cohere/src/haystack_integrations/components/generators/cohere/generator.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44
from collections.abc import Callable
5-
from typing import Any
5+
from typing import Any, ClassVar
66

77
from haystack import component, logging
88
from haystack.dataclasses import ChatMessage
@@ -30,6 +30,24 @@ class CohereGenerator(CohereChatGenerator):
3030
```
3131
"""
3232

33+
SUPPORTED_MODELS: ClassVar[list[str]] = [
34+
"command-a-03-2025",
35+
"command-r7b-12-2024",
36+
"command-a-translate-08-2025",
37+
"command-a-reasoning-08-2025",
38+
"command-a-vision-07-2025",
39+
"command-r-08-2024",
40+
"command-r-plus-08-2024",
41+
"command-r-03-2024",
42+
"command-r-plus-04-2024",
43+
"command-r-plus",
44+
"command-r",
45+
"command-light",
46+
"command",
47+
]
48+
"""A non-exhaustive list of chat models supported by this component.
49+
See https://docs.cohere.com/docs/models#command for the full list."""
50+
3351
def __init__(
3452
self,
3553
api_key: Secret = Secret.from_env_var(["COHERE_API_KEY", "CO_API_KEY"]),

integrations/cohere/tests/test_chat_generator.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ def test_multiple_images_in_single_message(self):
148148

149149

150150
class TestCohereChatGenerator:
151+
def test_supported_models(self) -> None:
152+
"""SUPPORTED_MODELS is a non-empty list of strings."""
153+
models = CohereChatGenerator.SUPPORTED_MODELS
154+
assert isinstance(models, list)
155+
assert len(models) > 0
156+
assert all(isinstance(m, str) for m in models)
157+
151158
def test_init_default(self, monkeypatch):
152159
monkeypatch.setenv("COHERE_API_KEY", "test-api-key")
153160

integrations/cohere/tests/test_document_embedder.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515

1616

1717
class TestCohereDocumentEmbedder:
18+
def test_supported_models(self) -> None:
19+
"""SUPPORTED_MODELS is a non-empty list of strings."""
20+
models = CohereDocumentEmbedder.SUPPORTED_MODELS
21+
assert isinstance(models, list)
22+
assert len(models) > 0
23+
assert all(isinstance(m, str) for m in models)
24+
1825
def test_init_default(self, monkeypatch):
1926
monkeypatch.setenv("COHERE_API_KEY", "test-api-key")
2027
embedder = CohereDocumentEmbedder()

integrations/cohere/tests/test_document_image_embedder.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020

2121

2222
class TestCohereDocumentImageEmbedder:
23+
def test_supported_models(self) -> None:
24+
"""SUPPORTED_MODELS is a non-empty list of strings."""
25+
models = CohereDocumentImageEmbedder.SUPPORTED_MODELS
26+
assert isinstance(models, list)
27+
assert len(models) > 0
28+
assert all(isinstance(m, str) for m in models)
29+
2330
def test_init_default(self, monkeypatch):
2431
monkeypatch.setenv("COHERE_API_KEY", "test-api-key")
2532
embedder = CohereDocumentImageEmbedder()

integrations/cohere/tests/test_generator.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515

1616

1717
class TestCohereGenerator:
18+
def test_supported_models(self) -> None:
19+
"""SUPPORTED_MODELS is a non-empty list of strings."""
20+
models = CohereGenerator.SUPPORTED_MODELS
21+
assert isinstance(models, list)
22+
assert len(models) > 0
23+
assert all(isinstance(m, str) for m in models)
24+
1825
def test_init_default(self, monkeypatch):
1926
monkeypatch.setenv("COHERE_API_KEY", "foo")
2027
component = CohereGenerator()

0 commit comments

Comments
 (0)