Nymbo commited on
Commit
f732b24
·
verified ·
1 Parent(s): db1adf2

adding information accordion to make the authentication and privacy stuff more clear

Browse files
Files changed (1) hide show
  1. app.py +32 -11
app.py CHANGED
@@ -1048,14 +1048,15 @@ code_interface = gr.Interface(
1048
  )
1049
 
1050
  CSS_STYLES = """
1051
- .gradio-container h1 {
 
1052
  text-align: center;
1053
  /* Ensure main title appears first, then our two subtitle lines */
1054
  display: grid;
1055
  justify-items: center;
1056
  }
1057
  /* Place bold tools list on line 2, normal auth note on line 3 (below title) */
1058
- .gradio-container h1::before {
1059
  grid-row: 2;
1060
  content: "Fetch Webpage | Search DuckDuckGo | Python Interpreter | Memory Manager | Kokoro TTS | Image Generation | Video Generation";
1061
  display: block;
@@ -1065,7 +1066,7 @@ CSS_STYLES = """
1065
  margin-top: 6px;
1066
  white-space: pre-wrap;
1067
  }
1068
- .gradio-container h1::after {
1069
  grid-row: 3;
1070
  content: "General purpose tools useful for any agent.";
1071
  display: block;
@@ -1076,7 +1077,7 @@ CSS_STYLES = """
1076
  white-space: pre-wrap;
1077
  }
1078
 
1079
- /* Remove inside tab panels so it doesn't duplicate under each tool title */
1080
  .gradio-container [role=\"tabpanel\"] h1::before,
1081
  .gradio-container [role=\"tabpanel\"] h1::after {
1082
  content: none !important;
@@ -1562,13 +1563,33 @@ _tab_names = [
1562
  "Video Generation",
1563
  ]
1564
 
1565
- demo = gr.TabbedInterface(
1566
- interface_list=_interfaces,
1567
- tab_names=_tab_names,
1568
- title="Tools MCP",
1569
- theme="Nymbo/Nymbo_Theme",
1570
- css=CSS_STYLES,
1571
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1572
 
1573
  # Launch the UI and expose all functions as MCP tools in one server
1574
  if __name__ == "__main__":
 
1048
  )
1049
 
1050
  CSS_STYLES = """
1051
+ /* Style only the top-level app title to avoid affecting headings elsewhere */
1052
+ .app-title {
1053
  text-align: center;
1054
  /* Ensure main title appears first, then our two subtitle lines */
1055
  display: grid;
1056
  justify-items: center;
1057
  }
1058
  /* Place bold tools list on line 2, normal auth note on line 3 (below title) */
1059
+ .app-title::before {
1060
  grid-row: 2;
1061
  content: "Fetch Webpage | Search DuckDuckGo | Python Interpreter | Memory Manager | Kokoro TTS | Image Generation | Video Generation";
1062
  display: block;
 
1066
  margin-top: 6px;
1067
  white-space: pre-wrap;
1068
  }
1069
+ .app-title::after {
1070
  grid-row: 3;
1071
  content: "General purpose tools useful for any agent.";
1072
  display: block;
 
1077
  white-space: pre-wrap;
1078
  }
1079
 
1080
+ /* Historical safeguard: if any h1 appears inside tabs, don't attach pseudo content */
1081
  .gradio-container [role=\"tabpanel\"] h1::before,
1082
  .gradio-container [role=\"tabpanel\"] h1::after {
1083
  content: none !important;
 
1563
  "Video Generation",
1564
  ]
1565
 
1566
+ with gr.Blocks(title="Nymbo/Tools MCP", theme="Nymbo/Nymbo_Theme", css=CSS_STYLES) as demo:
1567
+ # Page title (scoped styling via .app-title to avoid affecting other headings)
1568
+ gr.HTML("<h1 class='app-title'>Nymbo/Tools MCP</h1>")
1569
+
1570
+ # Collapsed Information accordion (appears below subtitle and above tabs)
1571
+ with gr.Accordion("Information", open=False):
1572
+ gr.Markdown(
1573
+ """
1574
+
1575
+ ## Enable Image & Video Generation
1576
+
1577
+ The `Generate_Image` and `Generate_Video` tools require a `HF_READ_TOKEN` present in environment variables (secrets). Please duplicate this space and provide an API key to enable them, or clone and run locally.
1578
+
1579
+ Both tools are hidden as MCP tools without authentication to avoid cluttering context, but they remain visible in the Gradio UI.
1580
+
1581
+ ---
1582
+
1583
+ ## Persistent Memories
1584
+
1585
+ Memories in this public HF space are written to the space's running container, and they are deleted when the space restarts. The contents are also visible to everyone. Do not store personal information in this public demo.
1586
+
1587
+ When running locally, memories are stored to a `memories.json` file in the root of the repo. Please clone and run locally to keep your information private.
1588
+ """
1589
+ )
1590
+
1591
+ # Existing tool tabs
1592
+ gr.TabbedInterface(interface_list=_interfaces, tab_names=_tab_names)
1593
 
1594
  # Launch the UI and expose all functions as MCP tools in one server
1595
  if __name__ == "__main__":