medbot_2 / medbot /interface.py
Thanush
Enhance logging in handlers and update consultation prompt for clarity and empathy
6daaaf3
raw
history blame
1.41 kB
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