File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
libs/langchain-mongodb/langchain_mongodb Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -873,8 +873,8 @@ def create_vector_search_index(
873873
874874 def similarity_search_by_vector (
875875 self ,
876- query_vector : list [float ],
877- * args : Any ,
876+ embedding : list [float ],
877+ k : int = 4 ,
878878 ** kwargs : Any ,
879879 ) -> list [Document ]:
880880 """Return MongoDB documents most similar to the given query vector.
@@ -883,7 +883,7 @@ def similarity_search_by_vector(
883883 search system alongside your database.
884884
885885 Args:
886- query_vector : Embedding vector to search for.
886+ embedding : Embedding vector to search for.
887887 k: (Optional) number of documents to return. Defaults to 4.
888888 pre_filter: List of MQL match expressions comparing an indexed field
889889 post_filter_pipeline: (Optional) Pipeline of MongoDB aggregation stages
@@ -897,9 +897,9 @@ def similarity_search_by_vector(
897897 Returns:
898898 List of documents most similar to the query vector.
899899 """
900- tuple_list = self .vector_store . _similarity_search_with_score (
901- query_vector ,
902- * args ,
900+ tuple_list = self ._similarity_search_with_score (
901+ embedding ,
902+ k = k ,
903903 ** kwargs ,
904904 )
905905 return [doc for doc , _ in tuple_list ]
You can’t perform that action at this time.
0 commit comments