Procházet zdrojové kódy

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

juaneloDev před 2 roky
rodič
revize
aed894246f
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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}"))