VibecoderMcSwaggins commited on
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.

Files changed (1) hide show
  1. 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 header (2 lines) to fit in single viewport
200
  gr.Markdown(
201
  "# 🧬 DeepCritical\n"
202
- "*AI-powered drug repurposing research β€” searches PubMed, ClinicalTrials.gov & bioRxiv*"
203
  )
204
 
205
- # Main chat interface with config in collapsed accordion
 
206
  gr.ChatInterface(
207
  fn=research_agent,
208
  examples=[
209
- ["What drugs could be repurposed for Alzheimer's disease?"],
210
- ["Is metformin effective for treating cancer?"],
211
- ["What medications show promise for Long COVID?"],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 only)",
219
  ),
220
  gr.Textbox(
221
- label="API Key (Optional)",
222
  placeholder="sk-... or sk-ant-...",
223
  type="password",
224
- info="Bring your own key for premium models. Never stored.",
225
  ),
226
  gr.Radio(
227
  choices=["openai", "anthropic"],
228
  value="openai",
229
- label="Provider",
 
230
  ),
231
  ],
232
  )
233
 
234
- # Minimal footer
235
  gr.Markdown(
236
- "*Research tool only β€” not for medical decisions. " "MCP: `/gradio_api/mcp/`*",
 
 
 
 
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