From d065cbf934f0d92cf50fa3fd9071c7c67eeca74c Mon Sep 17 00:00:00 2001 From: Sidharth Mohanty Date: Wed, 18 Oct 2023 00:04:03 +0530 Subject: [PATCH] [Bug fix] Qna pair not loading properly (#817) --- embedchain/embedchain.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index fa153589..133e3e42 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