Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

fix: init metadata as empty (#348)

Taranjeet Singh9687ec2c1a2a
diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py
index 6de981a50..71c9575b5 100644
--- a/embedchain/embedchain.py
+++ b/embedchain/embedchain.py
@@ -118,6 +118,9 @@ class EmbedChain:
if self.config.id is not None:
metadatas = [{**m, "app_id": self.config.id} for m in metadatas]
+ # FIXME: Fix the error handling logic when metadatas or metadata is None
+ metadatas = metadatas if metadatas else []
+ metadata = metadata if metadata else {}
chunks_before_addition = self.count()
# Add metadata to each document