Skip to content

Commit 55a46f1

Browse files
committed
Test that MongoDBAtlasVectorSearch can take default argument of None and standrd test suite passes. Added #TODO to fold AutoEmbeddingVectorStore into core one.
1 parent 3f1b560 commit 55a46f1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libs/langchain-mongodb/langchain_mongodb/vectorstores.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
DEFAULT_INSERT_BATCH_SIZE = 100
4949

5050

51+
# TODO: fold the autoembedding indexes into MongoDBAtlasVectorSearch
52+
# Add flag containing type: e.g. self.embedding_type in ["manual", "auto"], autoembedding (bool)
53+
# - OR add model (str) param and infer: e.g. if embedding is not None: self.embedding_type = "manual"
54+
# - assert not embedding and model
5155
class MongoDBAtlasVectorSearch(VectorStore):
5256
"""MongoDB Atlas vector store integration.
5357
@@ -204,7 +208,7 @@ class MongoDBAtlasVectorSearch(VectorStore):
204208
def __init__(
205209
self,
206210
collection: Collection[Dict[str, Any]],
207-
embedding: Embeddings,
211+
embedding: Embeddings = None,
208212
index_name: str = "vector_index",
209213
text_key: Union[str, List[str]] = "text",
210214
embedding_key: str = "embedding",
@@ -1061,7 +1065,7 @@ def similarity_search_with_score(
10611065
def from_texts(
10621066
cls,
10631067
texts: List[str],
1064-
embedding: Embeddings = VoyageAIEmbeddings(model="voyage-3-large"),
1068+
embedding: Embeddings = None, # VoyageAIEmbeddings(model="voyage-3-large"),
10651069
metadatas: Optional[List[Dict]] = None,
10661070
collection: Optional[Collection] = None,
10671071
ids: Optional[List[str]] = None,

0 commit comments

Comments
 (0)