From ba06c2a6707a1b82499ab2b17b547654cd6c9eee Mon Sep 17 00:00:00 2001 From: ZanSara Date: Wed, 21 Feb 2024 18:08:35 +0100 Subject: [PATCH] mypy --- .../retrievers/mongodb_atlas/embedding_retriever.py | 2 +- .../document_stores/mongodb_atlas/document_store.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integrations/mongodb_atlas/src/haystack_integrations/components/retrievers/mongodb_atlas/embedding_retriever.py b/integrations/mongodb_atlas/src/haystack_integrations/components/retrievers/mongodb_atlas/embedding_retriever.py index f11162d68..db3ed99ac 100644 --- a/integrations/mongodb_atlas/src/haystack_integrations/components/retrievers/mongodb_atlas/embedding_retriever.py +++ b/integrations/mongodb_atlas/src/haystack_integrations/components/retrievers/mongodb_atlas/embedding_retriever.py @@ -85,7 +85,7 @@ def run( top_k = top_k or self.top_k docs = self.document_store.embedding_retrieval( - query_embedding=query_embedding, + query_embedding_np=query_embedding, filters=filters, top_k=top_k, ) diff --git a/integrations/mongodb_atlas/src/haystack_integrations/document_stores/mongodb_atlas/document_store.py b/integrations/mongodb_atlas/src/haystack_integrations/document_stores/mongodb_atlas/document_store.py index a3ee8743b..8151c4820 100644 --- a/integrations/mongodb_atlas/src/haystack_integrations/document_stores/mongodb_atlas/document_store.py +++ b/integrations/mongodb_atlas/src/haystack_integrations/document_stores/mongodb_atlas/document_store.py @@ -174,7 +174,7 @@ def embedding_retrieval( msg = "Query embedding must not be empty" raise ValueError(msg) - query_embedding = np.array(query_embedding).astype(np.float32) + query_embedding_np = np.array(query_embedding).astype(np.float32) filters = haystack_filters_to_mongo(filters) pipeline = [ @@ -182,7 +182,7 @@ def embedding_retrieval( "$vectorSearch": { "index": self.vector_search_index, "path": "embedding", - "queryVector": query_embedding.tolist(), + "queryVector": query_embedding_np.tolist(), "numCandidates": 100, "limit": top_k, # "filter": filters,