Преглед на файлове

fix: add metadata in add and add_local (#343)

juaneloDev преди 2 години
родител
ревизия
aed894246f
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      embedchain/embedchain.py

+ 1 - 1
embedchain/embedchain.py

@@ -121,7 +121,7 @@ class EmbedChain:
         chunks_before_addition = self.count()
 
         # Add metadata to each document
-        metadatas_with_metadata = [meta or metadata for meta in metadatas]
+        metadatas_with_metadata = [{**meta, **metadata} for meta in metadatas]
 
         self.collection.add(documents=documents, metadatas=list(metadatas_with_metadata), ids=ids)
         print((f"Successfully saved {src}. New chunks count: " f"{self.count() - chunks_before_addition}"))