File size: 1,413 Bytes
031a3f5
 
 
 
 
f2907c6
6daaaf3
031a3f5
 
 
 
 
 
 
f2907c6
031a3f5
 
 
 
 
 
 
 
 
 
 
 
f2907c6
031a3f5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
from .handlers import respond, reset_chat

def build_interface():
    with gr.Blocks(theme="soft") as demo:
        gr.Markdown("# πŸ₯ Dr Bavana's Medical Assistant ")
        gr.Markdown("By Blue Planet Infosolutions Pvt Ltd")
        with gr.Row():
            with gr.Column(scale=4):
                chatbot = gr.Chatbot(height=500)
                msg = gr.Textbox(
                    placeholder="Tell me about your symptoms or health concerns...",
                    label="Your Message"
                )
                send_btn = gr.Button("Send", elem_id="send-btn")
            with gr.Column(scale=1):
                reset_btn = gr.Button("πŸ”„ Start New Consultation", variant="secondary")
                gr.Markdown("**Memory Features:**\n- Tracks symptoms & timeline\n- Remembers medications & allergies\n- Maintains conversation context\n- Provides comprehensive summaries")
        gr.Examples(
            examples=[
                "I have a persistent cough and sore throat for 3 days",
                "I've been having severe headaches and feel dizzy",
                "My stomach hurts and I feel nauseous after eating"
            ],
            inputs=msg
        )
        msg.submit(respond, [msg, chatbot], [msg, chatbot])
        send_btn.click(respond, [msg, chatbot], [msg, chatbot])
        reset_btn.click(reset_chat, [], [chatbot, msg])
    return demo