Skip to content
Snippets Groups Projects
Unverified Commit 8c9c6944 authored by James Briggs's avatar James Briggs
Browse files

update input_type to always be query

parent ad200b0c
No related branches found
No related tags found
No related merge requests found
......@@ -20,9 +20,9 @@ class CohereEncoder(BaseEncoder):
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% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment