File size: 566 Bytes
9f88cc8
9e74ae8
 
 
 
 
 
 
9f88cc8
 
 
9e74ae8
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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])