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>
This commit is contained in:
mrkhalil6
2023-07-08 00:03:59 +05:00
committed by GitHub
parent 01dca1e438
commit 4e7d0c115b
+2 -1
View File
@@ -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,