Spaces:
Build error
Build error
Commit Β·
291b9e6
1
Parent(s): 8dc3e50
refactor: enhance Gradio UI for improved user experience
Browse files- Updated header to include a more descriptive title and streamlined text.
- Enhanced chat interface with clearer example prompts and added settings accordion for configuration.
- Improved footer to clarify research tool limitations and active MCP server connection.
These changes aim to provide a more intuitive and informative interface for users interacting with the drug repurposing research agent.
195 unmodified lines196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239195 unmodified lineswith gr.Blocks(title="DeepCritical - Drug Repurposing Research Agent",) as demo:# Minimal header (2 lines) to fit in single viewportgr.Markdown("# 𧬠DeepCritical\n""*AI-powered drug repurposing research β searches PubMed, ClinicalTrials.gov & bioRxiv*")# Main chat interface with config in collapsed accordiongr.ChatInterface(fn=research_agent,examples=[["What drugs could be repurposed for Alzheimer's disease?"],["Is metformin effective for treating cancer?"],["What medications show promise for Long COVID?"],],additional_inputs=[gr.Radio(choices=["simple", "magentic"],value="simple",label="Mode",info="Simple: Linear | Magentic: Multi-Agent (OpenAI only)",),gr.Textbox(label="API Key (Optional)",placeholder="sk-... or sk-ant-...",type="password",info="Bring your own key for premium models. Never stored.",),gr.Radio(choices=["openai", "anthropic"],value="openai",label="Provider",),],)# Minimal footergr.Markdown("*Research tool only β not for medical decisions. " "MCP: `/gradio_api/mcp/`*",elem_classes=["footer"],)195 unmodified lines196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261195 unmodified lineswith gr.Blocks(title="DeepCritical - Drug Repurposing Research Agent",) as demo:# 1. Minimal Header (Option A: 2 lines max)gr.Markdown("# 𧬠DeepCritical\n""*AI-Powered Drug Repurposing Agent β searches PubMed, ClinicalTrials.gov & bioRxiv*")# 2. Main Chat Interface# Config inputs will be in a collapsed accordion below the chat inputgr.ChatInterface(fn=research_agent,examples=[["What drugs could be repurposed for Alzheimer's disease?","simple","","openai",],["Is metformin effective for treating cancer?","simple","","openai",],["What medications show promise for Long COVID treatment?","simple","","openai",],],additional_inputs_accordion=gr.Accordion(label="βοΈ Settings", open=False),additional_inputs=[gr.Radio(choices=["simple", "magentic"],value="simple",label="Orchestrator Mode",info="Simple: Linear | Magentic: Multi-Agent (OpenAI)",),gr.Textbox(label="π API Key (Optional - BYOK)",placeholder="sk-... or sk-ant-...",type="password",info="Enter your own API key. Never stored.",),gr.Radio(choices=["openai", "anthropic"],value="openai",label="API Provider",info="Select the provider for your API key",),],)# 3. Minimal Footer (Option C: Remove MCP Tabs, keep info)gr.Markdown("""---*Research tool only β not for medical advice.***MCP Server Active**: Connect Claude Desktop to `/gradio_api/mcp/`""",elem_classes=["footer"],)
src/app.py+35-13