Spaces:
Running
Running
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.
- src/app.py +35 -13
src/app.py
CHANGED
|
@@ -196,44 +196,66 @@ def create_demo() -> Any:
|
|
| 196 |
with gr.Blocks(
|
| 197 |
title="DeepCritical - Drug Repurposing Research Agent",
|
| 198 |
) as demo:
|
| 199 |
-
# Minimal
|
| 200 |
gr.Markdown(
|
| 201 |
"# 𧬠DeepCritical\n"
|
| 202 |
-
"*AI-
|
| 203 |
)
|
| 204 |
|
| 205 |
-
# Main
|
|
|
|
| 206 |
gr.ChatInterface(
|
| 207 |
fn=research_agent,
|
| 208 |
examples=[
|
| 209 |
-
[
|
| 210 |
-
|
| 211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
],
|
|
|
|
| 213 |
additional_inputs=[
|
| 214 |
gr.Radio(
|
| 215 |
choices=["simple", "magentic"],
|
| 216 |
value="simple",
|
| 217 |
-
label="Mode",
|
| 218 |
-
info="Simple: Linear | Magentic: Multi-Agent (OpenAI
|
| 219 |
),
|
| 220 |
gr.Textbox(
|
| 221 |
-
label="API Key (Optional)",
|
| 222 |
placeholder="sk-... or sk-ant-...",
|
| 223 |
type="password",
|
| 224 |
-
info="
|
| 225 |
),
|
| 226 |
gr.Radio(
|
| 227 |
choices=["openai", "anthropic"],
|
| 228 |
value="openai",
|
| 229 |
-
label="Provider",
|
|
|
|
| 230 |
),
|
| 231 |
],
|
| 232 |
)
|
| 233 |
|
| 234 |
-
# Minimal
|
| 235 |
gr.Markdown(
|
| 236 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
elem_classes=["footer"],
|
| 238 |
)
|
| 239 |
|
|
|
|
| 196 |
with gr.Blocks(
|
| 197 |
title="DeepCritical - Drug Repurposing Research Agent",
|
| 198 |
) as demo:
|
| 199 |
+
# 1. Minimal Header (Option A: 2 lines max)
|
| 200 |
gr.Markdown(
|
| 201 |
"# 𧬠DeepCritical\n"
|
| 202 |
+
"*AI-Powered Drug Repurposing Agent β searches PubMed, ClinicalTrials.gov & bioRxiv*"
|
| 203 |
)
|
| 204 |
|
| 205 |
+
# 2. Main Chat Interface
|
| 206 |
+
# Config inputs will be in a collapsed accordion below the chat input
|
| 207 |
gr.ChatInterface(
|
| 208 |
fn=research_agent,
|
| 209 |
examples=[
|
| 210 |
+
[
|
| 211 |
+
"What drugs could be repurposed for Alzheimer's disease?",
|
| 212 |
+
"simple",
|
| 213 |
+
"",
|
| 214 |
+
"openai",
|
| 215 |
+
],
|
| 216 |
+
[
|
| 217 |
+
"Is metformin effective for treating cancer?",
|
| 218 |
+
"simple",
|
| 219 |
+
"",
|
| 220 |
+
"openai",
|
| 221 |
+
],
|
| 222 |
+
[
|
| 223 |
+
"What medications show promise for Long COVID treatment?",
|
| 224 |
+
"simple",
|
| 225 |
+
"",
|
| 226 |
+
"openai",
|
| 227 |
+
],
|
| 228 |
],
|
| 229 |
+
additional_inputs_accordion=gr.Accordion(label="βοΈ Settings", open=False),
|
| 230 |
additional_inputs=[
|
| 231 |
gr.Radio(
|
| 232 |
choices=["simple", "magentic"],
|
| 233 |
value="simple",
|
| 234 |
+
label="Orchestrator Mode",
|
| 235 |
+
info="Simple: Linear | Magentic: Multi-Agent (OpenAI)",
|
| 236 |
),
|
| 237 |
gr.Textbox(
|
| 238 |
+
label="π API Key (Optional - BYOK)",
|
| 239 |
placeholder="sk-... or sk-ant-...",
|
| 240 |
type="password",
|
| 241 |
+
info="Enter your own API key. Never stored.",
|
| 242 |
),
|
| 243 |
gr.Radio(
|
| 244 |
choices=["openai", "anthropic"],
|
| 245 |
value="openai",
|
| 246 |
+
label="API Provider",
|
| 247 |
+
info="Select the provider for your API key",
|
| 248 |
),
|
| 249 |
],
|
| 250 |
)
|
| 251 |
|
| 252 |
+
# 3. Minimal Footer (Option C: Remove MCP Tabs, keep info)
|
| 253 |
gr.Markdown(
|
| 254 |
+
"""
|
| 255 |
+
---
|
| 256 |
+
*Research tool only β not for medical advice.*
|
| 257 |
+
**MCP Server Active**: Connect Claude Desktop to `/gradio_api/mcp/`
|
| 258 |
+
""",
|
| 259 |
elem_classes=["footer"],
|
| 260 |
)
|
| 261 |
|