codettefloodresponse / emotional_core.py
Raiff1982's picture
Update emotional_core.py
9e74ae8 verified
raw
history blame
566 Bytes
import gradio as gr
import ethics_audit
def respond(msg, history):
ethics_audit.log_event("EmotionalCore interaction")
history = history or []
history.append((msg, "I'm here with you. Stay strong."))
return history, history
def render(online):
with gr.Column():
gr.Markdown("### Emotional Support Chatbot")
chatbot = gr.Chatbot()
msg = gr.Textbox(label="How are you feeling?")
submit = gr.Button("Send")
state = gr.State([])
submit.click(fn=respond, inputs=[msg, state], outputs=[chatbot, state])