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.

[Bug fix] Qna pair not loading properly (#817)

Sidharth Mohantyd065cbf934f0
diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py
index fa1535899..133e3e423 100644
--- a/embedchain/embedchain.py
+++ b/embedchain/embedchain.py
@@ -350,6 +350,10 @@ class EmbedChain(JSONSerializable):
# get existing ids, and discard doc if any common id exist.
where = {"url": src}
+ # if data type is qna_pair, we check for question
+ if chunker.data_type == DataType.QNA_PAIR:
+ where = {"question": src[0]}
+
if self.config.id is not None:
where["app_id"] = self.config.id