Spaces:
Running
Running
Upload 2 files
Browse filesMake sure clean chat, also clean previous messages (history), and previous summary
app.py
CHANGED
@@ -99,11 +99,15 @@ def create_chat_interface(rag_agent=rag_agent):
|
|
99 |
history[-1][1] = bot_response
|
100 |
return history
|
101 |
|
|
|
|
|
|
|
|
|
102 |
submit_btn.click(user_message, [txt, chatbot_component], [txt, chatbot_component], queue=False).then(
|
103 |
bot_message, chatbot_component, chatbot_component
|
104 |
)
|
105 |
|
106 |
-
clear_btn.click(
|
107 |
|
108 |
return interface
|
109 |
|
|
|
99 |
history[-1][1] = bot_response
|
100 |
return history
|
101 |
|
102 |
+
def clear_summary():
|
103 |
+
rag_agent.conversation_summary = ""
|
104 |
+
rag_agent.messages = []
|
105 |
+
|
106 |
submit_btn.click(user_message, [txt, chatbot_component], [txt, chatbot_component], queue=False).then(
|
107 |
bot_message, chatbot_component, chatbot_component
|
108 |
)
|
109 |
|
110 |
+
clear_btn.click(clear_summary, None, chatbot_component, queue=False)
|
111 |
|
112 |
return interface
|
113 |
|