mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-05 20:58:25 +00:00
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:
parent
01dca1e438
commit
4e7d0c115b
@ -166,7 +166,8 @@ class Pinecone(VectorStore):
|
|||||||
k: int = 4,
|
k: int = 4,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> List[Tuple[Document, float]]:
|
) -> 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(
|
def max_marginal_relevance_search_by_vector(
|
||||||
self,
|
self,
|
||||||
|
Loading…
Reference in New Issue
Block a user