VibecoderMcSwaggins commited on
Commit
9b8af35
Β·
1 Parent(s): ad823e0

fix(ui): resolve Gradio 6 breaking change and align text

Browse files
Files changed (1) hide show
  1. src/app.py +25 -21
src/app.py CHANGED
@@ -25,6 +25,21 @@ from src.utils.models import OrchestratorConfig
25
  OrchestratorMode = Literal["simple", "magentic", "advanced", "hierarchical"]
26
 
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  def configure_orchestrator(
29
  use_mock: bool = False,
30
  mode: OrchestratorMode = "simple",
@@ -248,34 +263,22 @@ def create_demo() -> tuple[gr.ChatInterface, gr.Accordion]:
248
 
249
  # 1. Unwrapped ChatInterface (Fixes Accordion Bug)
250
  description = (
251
- "*AI-Powered Research Agent β€” searches PubMed, "
252
- "ClinicalTrials.gov, Europe PMC & OpenAlex*\n\n"
 
253
  "Deep research for sexual wellness, ED treatments, hormone therapy, "
254
- "libido, and reproductive health - for all genders.\n\n"
255
- "---\n"
256
- "*Research tool only β€” not for medical advice.* \n"
257
- "**MCP Server Active**: Connect Claude Desktop to `/gradio_api/mcp/`"
 
 
258
  )
259
 
260
- # CSS to force dark mode on API key input
261
- custom_css = """
262
- .api-key-input input {
263
- background-color: #1f2937 !important;
264
- color: white !important;
265
- border-color: #374151 !important;
266
- }
267
- .api-key-input input:focus {
268
- background-color: #1f2937 !important;
269
- color: white !important;
270
- border-color: #e879f9 !important;
271
- }
272
- """
273
-
274
  demo = gr.ChatInterface(
275
  fn=research_agent,
276
  title="πŸ† DeepBoner",
277
  description=description,
278
- css=custom_css,
279
  examples=[
280
  [
281
  "What drugs improve female libido post-menopause?",
@@ -337,6 +340,7 @@ def main() -> None:
337
  share=False,
338
  mcp_server=True,
339
  ssr_mode=False, # Fix for intermittent loading/hydration issues in HF Spaces
 
340
  )
341
 
342
 
 
25
  OrchestratorMode = Literal["simple", "magentic", "advanced", "hierarchical"]
26
 
27
 
28
+ # CSS to force dark mode on API key input
29
+ CUSTOM_CSS = """
30
+ .api-key-input input {
31
+ background-color: #1f2937 !important;
32
+ color: white !important;
33
+ border-color: #374151 !important;
34
+ }
35
+ .api-key-input input:focus {
36
+ background-color: #1f2937 !important;
37
+ color: white !important;
38
+ border-color: #e879f9 !important;
39
+ }
40
+ """
41
+
42
+
43
  def configure_orchestrator(
44
  use_mock: bool = False,
45
  mode: OrchestratorMode = "simple",
 
263
 
264
  # 1. Unwrapped ChatInterface (Fixes Accordion Bug)
265
  description = (
266
+ "<div style='text-align: center'>"
267
+ "<em>AI-Powered Research Agent β€” searches PubMed, "
268
+ "ClinicalTrials.gov, Europe PMC & OpenAlex</em><br><br>"
269
  "Deep research for sexual wellness, ED treatments, hormone therapy, "
270
+ "libido, and reproductive health - for all genders.<br><br>"
271
+ "---<br>"
272
+ "<em>Research tool only β€” not for medical advice.</em><br>"
273
+ "<strong>MCP Server Active</strong>: Connect Claude Desktop to "
274
+ "<code>/gradio_api/mcp/</code>"
275
+ "</div>"
276
  )
277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  demo = gr.ChatInterface(
279
  fn=research_agent,
280
  title="πŸ† DeepBoner",
281
  description=description,
 
282
  examples=[
283
  [
284
  "What drugs improve female libido post-menopause?",
 
340
  share=False,
341
  mcp_server=True,
342
  ssr_mode=False, # Fix for intermittent loading/hydration issues in HF Spaces
343
+ css=CUSTOM_CSS, # Moved here for Gradio 6.0 support
344
  )
345
 
346