@@ -364,11 +364,24 @@ def add_texts(
364364 if (j + 1 ) % batch_size == 0 or size >= 47_000_000 :
365365 if ids :
366366 batch_res = bulk_embed_and_insert_texts (
367- texts_batch , metadatas_batch , ids [i : j + 1 ]
367+ embedding_model = self ._embedding ,
368+ collection = self ._collection ,
369+ text_key = self ._text_key ,
370+ embedding_key = self ._embedding_key ,
371+ metadata_key = self ._metadata_key ,
372+ texts = texts_batch ,
373+ metadatas = metadatas_batch ,
374+ ids = ids [i : j + 1 ],
368375 )
369376 else :
370377 batch_res = bulk_embed_and_insert_texts (
371- texts_batch , metadatas_batch
378+ embedding_model = self ._embedding ,
379+ collection = self ._collection ,
380+ text_key = self ._text_key ,
381+ embedding_key = self ._embedding_key ,
382+ metadata_key = self ._metadata_key ,
383+ texts = texts_batch ,
384+ metadatas = metadatas_batch ,
372385 )
373386 result_ids .extend (batch_res )
374387 texts_batch = []
@@ -378,10 +391,25 @@ def add_texts(
378391 if texts_batch :
379392 if ids :
380393 batch_res = bulk_embed_and_insert_texts (
381- texts_batch , metadatas_batch , ids [i : j + 1 ]
394+ embedding_model = self ._embedding ,
395+ collection = self ._collection ,
396+ text_key = self ._text_key ,
397+ embedding_key = self ._embedding_key ,
398+ metadata_key = self ._metadata_key ,
399+ texts = texts_batch ,
400+ metadatas = metadatas_batch ,
401+ ids = ids [i : j + 1 ],
382402 )
383403 else :
384- batch_res = bulk_embed_and_insert_texts (texts_batch , metadatas_batch )
404+ batch_res = bulk_embed_and_insert_texts (
405+ embedding_model = self ._embedding ,
406+ collection = self ._collection ,
407+ text_key = self ._text_key ,
408+ embedding_key = self ._embedding_key ,
409+ metadata_key = self ._metadata_key ,
410+ texts = texts_batch ,
411+ metadatas = metadatas_batch ,
412+ )
385413 result_ids .extend (batch_res )
386414 return result_ids
387415
0 commit comments