fix: history bug on 2nd message

This commit is contained in:
Alex
2025-01-26 15:42:47 +00:00
parent 79912a4067
commit 6d68b89ea0
3 changed files with 3 additions and 3 deletions

View File

@@ -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"]})