The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community: Fix AWS DocumentDB similarity_search when filter is None (#24777)
Pere Pasamonte98175860adf5
diff --git a/libs/community/langchain_community/vectorstores/documentdb.py b/libs/community/langchain_community/vectorstores/documentdb.pyindex 730c517a15..d6a9687283 100644--- a/libs/community/langchain_community/vectorstores/documentdb.py+++ b/libs/community/langchain_community/vectorstores/documentdb.py@@ -327,6 +327,10 @@ class DocumentDBVectorSearch(VectorStore):Returns:A list of documents closest to the query vector"""+ # $match can't be null, so intializes to {} when None to avoid+ # "the match filter must be an expression in an object"+ if not filter:+ filter = {}pipeline: List[dict[str, Any]] = [{"$match": filter},{