borodache commited on
Commit
d46a499
·
verified ·
1 Parent(s): 41ce6d1

Upload 2 files

Browse files

Make sure clean chat, also clean previous messages (history), and previous summary

Files changed (1) hide show
  1. app.py +5 -1
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(lambda: None, None, chatbot_component, queue=False)
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