From 953e58d0040773c76f68e633c3db3cd371c9c350 Mon Sep 17 00:00:00 2001 From: Rajat Saxena Date: Tue, 28 Mar 2023 03:34:53 +0530 Subject: [PATCH] similarity_search is not accepting filters (#1964) I have changed the name of the argument from `where` to `filter` which is expected by `similarity_search_with_score`. Fixes #1838 --------- Co-authored-by: Rajat Saxena --- langchain/vectorstores/chroma.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/langchain/vectorstores/chroma.py b/langchain/vectorstores/chroma.py index 2a0db589..f9048eec 100644 --- a/langchain/vectorstores/chroma.py +++ b/langchain/vectorstores/chroma.py @@ -128,9 +128,9 @@ class Chroma(VectorStore): filter (Optional[Dict[str, str]]): Filter by metadata. Defaults to None. Returns: - List[Document]: List of documents most simmilar to the query text. + List[Document]: List of documents most similar to the query text. """ - docs_and_scores = self.similarity_search_with_score(query, k, where=filter) + docs_and_scores = self.similarity_search_with_score(query, k, filter=filter) return [doc for doc, _ in docs_and_scores] def similarity_search_by_vector(