diff --git a/application/retriever/brave_search.py b/application/retriever/brave_search.py index efcae8ab..08b16bc0 100644 --- a/application/retriever/brave_search.py +++ b/application/retriever/brave_search.py @@ -71,7 +71,7 @@ class BraveRetSearch(BaseRetriever): for doc in docs: yield {"source": doc} - if len(self.chat_history) > 1: + if len(self.chat_history) > 0: for i in self.chat_history: if "prompt" in i and "response" in i: messages_combine.append({"role": "user", "content": i["prompt"]}) diff --git a/application/retriever/classic_rag.py b/application/retriever/classic_rag.py index b3735a96..d4c7d755 100644 --- a/application/retriever/classic_rag.py +++ b/application/retriever/classic_rag.py @@ -71,7 +71,7 @@ class ClassicRAG(BaseRetriever): for doc in docs: yield {"source": doc} - if len(self.chat_history) > 1: + if len(self.chat_history) > 0: for i in self.chat_history: if "prompt" in i and "response" in i: messages_combine.append({"role": "user", "content": i["prompt"]}) diff --git a/application/retriever/duckduck_search.py b/application/retriever/duckduck_search.py index 321c6fd9..c6386410 100644 --- a/application/retriever/duckduck_search.py +++ b/application/retriever/duckduck_search.py @@ -88,7 +88,7 @@ class DuckDuckSearch(BaseRetriever): for doc in docs: yield {"source": doc} - if len(self.chat_history) > 1: + if len(self.chat_history) > 0: for i in self.chat_history: if "prompt" in i and "response" in i: messages_combine.append({"role": "user", "content": i["prompt"]})