diff --git a/semantic_router/encoders/cohere.py b/semantic_router/encoders/cohere.py index 0ed2ecc0..b16f63be 100644 --- a/semantic_router/encoders/cohere.py +++ b/semantic_router/encoders/cohere.py @@ -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