Skip to content

Commit

Permalink
update input_type to always be query
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed Nov 11, 2023
1 parent ad200b0 commit 8c9c694
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions semantic_router/encoders/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def __init__(
def __call__(self, texts: list[str]) -> list[list[float]]:
if self.client is None:
raise ValueError("Cohere client is not initialized.")
if len(texts) == 1:
input_type = "search_query"
else:
input_type = "search_document"
embeds = self.client.embed(texts, input_type=input_type, model=self.name)
embeds = self.client.embed(
texts,
input_type="search_query",
model=self.name
)
return embeds.embeddings

0 comments on commit 8c9c694

Please sign in to comment.