Skip to content

Commit

Permalink
Merge pull request #431 from aurelio-labs/ashraq/fix-cohere-types
Browse files Browse the repository at this point in the history
fix: cohere type
  • Loading branch information
jamescalam authored Sep 23, 2024
2 parents c3fa297 + ed368b1 commit e308619
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "MIT"
python = ">=3.9,<3.13"
pydantic = "^2.5.3"
openai = ">=1.10.0,<2.0.0"
cohere = ">=5.00,<6.00"
cohere = ">=5.9.4,<6.00"
mistralai= {version = ">=0.0.12,<0.1.0", optional = true}
numpy = "^1.25.2"
colorlog = "^6.8.0"
Expand Down
4 changes: 2 additions & 2 deletions semantic_router/encoders/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List, Optional

import cohere
from cohere.types.embed_response import EmbedResponse_EmbeddingsByType
from cohere.types.embed_response import EmbeddingsByTypeEmbedResponse

from semantic_router.encoders import BaseEncoder
from semantic_router.utils.defaults import EncoderDefault
Expand Down Expand Up @@ -46,7 +46,7 @@ def __call__(self, docs: List[str]) -> List[List[float]]:
texts=docs, input_type=self.input_type, model=self.name
)
# Check for unsupported type.
if isinstance(embeds, EmbedResponse_EmbeddingsByType):
if isinstance(embeds, EmbeddingsByTypeEmbedResponse):
raise NotImplementedError(
"Handling of EmbedByTypeResponseEmbeddings is not implemented."
)
Expand Down

0 comments on commit e308619

Please sign in to comment.