Raiff1982 commited on
Commit
9e74ae8
·
verified ·
1 Parent(s): 39856b3

Update emotional_core.py

Browse files
Files changed (1) hide show
  1. emotional_core.py +13 -2
emotional_core.py CHANGED
@@ -1,6 +1,17 @@
1
  import gradio as gr
 
 
 
 
 
 
 
2
 
3
  def render(online):
4
  with gr.Column():
5
- gr.Markdown("### EmotionalCore Chat")
6
- gr.Textbox(label="(Placeholder) Chatbot ready in {} mode.".format("Online" if online else "Offline"))
 
 
 
 
 
1
  import gradio as gr
2
+ import ethics_audit
3
+
4
+ def respond(msg, history):
5
+ ethics_audit.log_event("EmotionalCore interaction")
6
+ history = history or []
7
+ history.append((msg, "I'm here with you. Stay strong."))
8
+ return history, history
9
 
10
  def render(online):
11
  with gr.Column():
12
+ gr.Markdown("### Emotional Support Chatbot")
13
+ chatbot = gr.Chatbot()
14
+ msg = gr.Textbox(label="How are you feeling?")
15
+ submit = gr.Button("Send")
16
+ state = gr.State([])
17
+ submit.click(fn=respond, inputs=[msg, state], outputs=[chatbot, state])