From 107d555f93d4adee2cddbc3e7f604815be92e473 Mon Sep 17 00:00:00 2001 From: chinesewebman Date: Fri, 19 May 2023 21:24:06 +0800 Subject: [PATCH] chat history fixed cool! --- src/modules/chatbot.py | 4 ++-- src/modules/sidebar.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/chatbot.py b/src/modules/chatbot.py index d8946a9..0b67886 100644 --- a/src/modules/chatbot.py +++ b/src/modules/chatbot.py @@ -48,7 +48,7 @@ def __init__(self, model_name, temperature, vectors): #Follow-up entry: {question} #Standalone question:""" - cq_template_with_keywords = """"===Given the following chat history and follow-up questions, if the follow-up question is a complete sentence, + cq_template_with_keywords = """"===Given the following chat history and follow-up question, if the follow-up question is a complete sentence, copy the follow-up question as a standalone question, and if the follow-up question is not a complete sentence or a complete question, complete it as a standalone question about the given keywords with reference to the chat history in Chinese or user-specified language. === @@ -58,7 +58,7 @@ def __init__(self, model_name, temperature, vectors): keywords:{keywords} standalone question:""" - cq_template = """"===Given the following chat history and follow-up questions, if the follow-up question is a complete sentence, + cq_template = """"===Given the following chat history and follow-up question, if the follow-up question is a complete sentence, copy the follow-up question as a standalone question as-is, and if the follow-up question is not a complete sentence or a complete question, complete it as a standalone question with reference to the chat history in Chinese or user-specified language. === diff --git a/src/modules/sidebar.py b/src/modules/sidebar.py index 32aeb66..92ab535 100644 --- a/src/modules/sidebar.py +++ b/src/modules/sidebar.py @@ -82,6 +82,7 @@ def show_file_selecotr(self, data_directory, history): def reset_history(): history.reset(st.session_state["selected_file"]) history.initialize_assistant_history(st.session_state["selected_file"]) + st.success("聊天已重置!") filelist=[] for root, dirs, files in os.walk(data_directory): for file in files: