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/dont print the entire text when data type is text (#605)

David Talson5e06a0d00128
diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py
index dbc5d7c94..03fcdeeb1 100644
--- a/embedchain/embedchain.py
+++ b/embedchain/embedchain.py
@@ -284,7 +284,10 @@ class EmbedChain(JSONSerializable):
data_dict = {id: value for id, value in data_dict.items() if id not in existing_ids}
if not data_dict:
- print(f"All data from {src} already exists in the database.")
+ src_copy = src
+ if len(src_copy) > 50:
+ src_copy = src[:50] + "..."
+ print(f"All data from {src_copy} already exists in the database.")
# Make sure to return a matching return type
return [], [], [], 0
@@ -418,7 +421,10 @@ class EmbedChain(JSONSerializable):
data_dict = {id: value for id, value in data_dict.items() if id not in existing_ids}
if not data_dict:
- print(f"All data from {src} already exists in the database.")
+ src_copy = src
+ if len(src_copy) > 50:
+ src_copy = src[:50] + "..."
+ print(f"All data from {src_copy} already exists in the database.")
# Make sure to return a matching return type
return [], [], [], 0