Skip to content

Commit 1aafd5a

Browse files
committed
Fix imports
1 parent abd1b18 commit 1aafd5a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libs/langchain-mongodb/langchain_mongodb/vectorstores.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from pymongo import MongoClient
2525
from pymongo.collection import Collection
2626
from pymongo.errors import CollectionInvalid
27-
from pymongo_vectorsearch_utils import bulk_embed_and_insert_texts
27+
from pymongo_search_utils import bulk_embed_and_insert_texts
2828

2929
from langchain_mongodb.index import (
3030
create_vector_search_index,
@@ -355,7 +355,7 @@ def add_texts(
355355
metadatas_batch = []
356356
size = 0
357357
i = 0
358-
for j, (text, metadata) in enumerate(zip(texts, _metadatas)):
358+
for j, (text, metadata) in enumerate(zip(texts, _metadatas, strict=False)):
359359
size += len(text) + len(metadata)
360360
texts_batch.append(text)
361361
metadatas_batch.append(metadata)
@@ -444,7 +444,8 @@ def add_documents(
444444
start = 0
445445
for end in range(batch_size, n_docs + batch_size, batch_size):
446446
texts, metadatas = zip(
447-
*[(doc.page_content, doc.metadata) for doc in documents[start:end]]
447+
*[(doc.page_content, doc.metadata) for doc in documents[start:end]],
448+
strict=False,
448449
)
449450
result_ids.extend(
450451
bulk_embed_and_insert_texts(

libs/langchain-mongodb/tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from pymongo.driver_info import DriverInfo
2727
from pymongo.operations import SearchIndexModel
2828
from pymongo.results import BulkWriteResult, DeleteResult, InsertManyResult
29-
from pymongo_vectorsearch_utils import bulk_embed_and_insert_texts
29+
from pymongo_search_utils import bulk_embed_and_insert_texts
3030

3131
from langchain_mongodb import MongoDBAtlasVectorSearch
3232
from langchain_mongodb.agent_toolkit.database import MongoDBDatabase

0 commit comments

Comments
 (0)