Add support for filters and namespaces in similarity search in Pinecone similarity_score_threshold (#7301)

At the moment, pinecone vectorStore does not support filters and
namespaces when using similarity_score_threshold search type.
In this PR, I've implemented that. It passes all the kwargs except
"score_threshold" as that is not a supported argument for method
"similarity_search_with_score".
---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
pull/7377/head
mrkhalil6 1 year ago committed by GitHub
parent 01dca1e438
commit 4e7d0c115b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -166,7 +166,8 @@ class Pinecone(VectorStore):
k: int = 4,
**kwargs: Any,
) -> List[Tuple[Document, float]]:
return self.similarity_search_with_score(query, k)
kwargs.pop("score_threshold", None)
return self.similarity_search_with_score(query, k, **kwargs)
def max_marginal_relevance_search_by_vector(
self,

Loading…
Cancel
Save