Added missing input type checking (Cohere Embed); Removed fingerprint from BaseEmbeddingsResponse

This commit is contained in:
Joao Galego
2024-03-28 08:05:39 +00:00
parent b24a43f6f4
commit c3b7395028
2 changed files with 5 additions and 2 deletions

View File

@@ -483,8 +483,12 @@ def get_embeddings_model(model_id: str) -> BedrockEmbeddingsModel:
class CohereEmbeddingsModel(BedrockEmbeddingsModel):
def _parse_args(self, embeddings_request: EmbeddingsRequest) -> dict:
if isinstance(embeddings_request.input, str):
texts = [embeddings_request.input]
elif isinstance(embeddings_request.input, list):
texts = embeddings_request.input
args = {
"texts": embeddings_request.input,
"texts": texts,
"input_type": embeddings_request.input_type if embeddings_request.input_type else "search_document",
"truncate": embeddings_request.truncate if embeddings_request.truncate else "NONE",
}