From 21db7197965f1cacd6595ae94d9017fc54d761c3 Mon Sep 17 00:00:00 2001 From: Mamadou DICKO <63923024+mamadoudicko@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:35:30 +0200 Subject: [PATCH] fix(chat): update data keys (#923) --- backend/core/llm/qa_base.py | 4 ++-- backend/core/repository/chat/get_chat_history.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/core/llm/qa_base.py b/backend/core/llm/qa_base.py index fc3a3db37..6c0147ef4 100644 --- a/backend/core/llm/qa_base.py +++ b/backend/core/llm/qa_base.py @@ -140,7 +140,7 @@ class QABaseBrainPicking(BaseBrainPicking): model_response = qa( { - "question": question, + "question": question.question, "chat_history": transformed_history, "custom_personality": self.get_prompt(), } @@ -227,7 +227,7 @@ class QABaseBrainPicking(BaseBrainPicking): wrap_done( qa.acall( { - "question": question, + "question": question.question, "chat_history": transformed_history, "custom_personality": self.get_prompt(), } diff --git a/backend/core/repository/chat/get_chat_history.py b/backend/core/repository/chat/get_chat_history.py index 6a11fe488..d561be09b 100644 --- a/backend/core/repository/chat/get_chat_history.py +++ b/backend/core/repository/chat/get_chat_history.py @@ -20,7 +20,7 @@ class GetChatHistoryOutput(BaseModel): def dict(self, *args, **kwargs): chat_history = super().dict(*args, **kwargs) - chat_history["chat_id"] = str(chat_history.get("prompt_id")) + chat_history["chat_id"] = str(chat_history.get("chat_id")) chat_history["message_id"] = str(chat_history.get("message_id")) return chat_history