Karthikeyan commited on
Commit
1fdd414
1 Parent(s): a6daced

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -202,7 +202,8 @@ class LangChain_Document_QA:
202
 
203
  return scores,customer_fig,agent_fig,customer_emotion_fig,agent_emotion_fig
204
 
205
-
 
206
  def gradio_interface(self):
207
  with gr.Blocks(css="style.css",theme=gr.themes.Soft()) as demo:
208
  with gr.Row():
@@ -283,7 +284,8 @@ class LangChain_Document_QA:
283
  self._agent_text, [chatbot, txt2], chatbot
284
  )
285
  end_btn.click(self._display_history, [], txt4)
286
-
 
287
  Sentiment_btn.click(self._on_sentiment_btn_click,[],[txt5,plot,plot_2,plot_3,plot_4])
288
 
289
  demo.title = "Vodafone Generative AI CRM ChatBot"
 
202
 
203
  return scores,customer_fig,agent_fig,customer_emotion_fig,agent_emotion_fig
204
 
205
+ def clear_func(self):
206
+ history_state.clear()
207
  def gradio_interface(self):
208
  with gr.Blocks(css="style.css",theme=gr.themes.Soft()) as demo:
209
  with gr.Row():
 
284
  self._agent_text, [chatbot, txt2], chatbot
285
  )
286
  end_btn.click(self._display_history, [], txt4)
287
+ clear_btn.click(self.clear_func,[],[])
288
+ clear_btn.click(lambda: None, None, chatbot, queue=False)
289
  Sentiment_btn.click(self._on_sentiment_btn_click,[],[txt5,plot,plot_2,plot_3,plot_4])
290
 
291
  demo.title = "Vodafone Generative AI CRM ChatBot"