From c70532bab3a2cd1c40e9e2e9107c39e6c3c0fce9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:39:53 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: pallavi jaini --- comps/retrievers/langchain/pinecone/retriever_pinecone.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/comps/retrievers/langchain/pinecone/retriever_pinecone.py b/comps/retrievers/langchain/pinecone/retriever_pinecone.py index d28aea5294..ba8e6526f5 100644 --- a/comps/retrievers/langchain/pinecone/retriever_pinecone.py +++ b/comps/retrievers/langchain/pinecone/retriever_pinecone.py @@ -54,14 +54,10 @@ def retrieve(input: EmbedDoc) -> SearchedDoc: elif input.search_type == "similarity_distance_threshold": if input.distance_threshold is None: raise ValueError("distance_threshold must be provided for " + "similarity_distance_threshold retriever") - docs_and_similarities = vector_db.similarity_search_by_vector_with_score( - embedding=input.embedding, k=input.k - ) + docs_and_similarities = vector_db.similarity_search_by_vector_with_score(embedding=input.embedding, k=input.k) search_res = [doc for doc, similarity in docs_and_similarities if similarity > input.distance_threshold] elif input.search_type == "similarity_score_threshold": - docs_and_similarities = vector_db.similarity_search_by_vector_with_score( - query=input.text, k=input.k - ) + docs_and_similarities = vector_db.similarity_search_by_vector_with_score(query=input.text, k=input.k) search_res = [doc for doc, similarity in docs_and_similarities if similarity > input.score_threshold] elif input.search_type == "mmr": search_res = vector_db.max_marginal_relevance_search(