Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci

Signed-off-by: pallavi jaini <[email protected]>
  • Loading branch information
pre-commit-ci[bot] authored and pallavijaini0525 committed Aug 7, 2024
1 parent 1fec971 commit c70532b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions comps/retrievers/langchain/pinecone/retriever_pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c70532b

Please sign in to comment.