medbot_2 / medbot /interface.py
Thanush
Implement medical consultation app with LangChain memory management and model integration
031a3f5
raw
history blame
1.45 kB
import gradio as gr
from .handlers import respond, reset_chat
def build_interface():
with gr.Blocks(theme="soft") as demo:
gr.Markdown("# πŸ₯ Complete Medical Assistant - Me-LLaMA 13B with Memory")
gr.Markdown("Comprehensive medical consultation powered by Me-LLaMA 13B with LangChain memory management. One model handles both consultation and medicine suggestions with full context awareness.")
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"
)
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])
reset_btn.click(reset_chat, [], [chatbot, msg])
return demo