Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,13 +77,13 @@ with gr.Blocks() as demo:
|
|
| 77 |
</div>
|
| 78 |
""")
|
| 79 |
source_selector = gr.Radio(
|
| 80 |
-
choices=["Hackathon
|
| 81 |
label="🔀 Source",
|
| 82 |
-
value="Hackathon
|
| 83 |
)
|
| 84 |
|
| 85 |
hackathon_dropdown = gr.Dropdown(
|
| 86 |
-
label="Select a MCP server from the hackathon
|
| 87 |
choices=get_mcp_space_endpoints(),
|
| 88 |
value=DEFAULT_MCP_URL,
|
| 89 |
interactive=True,
|
|
@@ -98,12 +98,12 @@ with gr.Blocks() as demo:
|
|
| 98 |
|
| 99 |
def toggle_url_input(source):
|
| 100 |
return (
|
| 101 |
-
gr.update(visible=(source == "Hackathon
|
| 102 |
gr.update(visible=(source == "Custom MCP URL"))
|
| 103 |
)
|
| 104 |
|
| 105 |
def reload_tools_router(source, dropdown_val, custom_val):
|
| 106 |
-
selected_url = dropdown_val if source == "Hackathon
|
| 107 |
return reload_tools_from_url(selected_url)
|
| 108 |
|
| 109 |
source_selector.change(fn=toggle_url_input, inputs=source_selector, outputs=[hackathon_dropdown, custom_url_input])
|
|
|
|
| 77 |
</div>
|
| 78 |
""")
|
| 79 |
source_selector = gr.Radio(
|
| 80 |
+
choices=["🔥 Hackathon submissions 🔥", "Custom MCP URL"],
|
| 81 |
label="🔀 Source",
|
| 82 |
+
value="Hackathon submissions"
|
| 83 |
)
|
| 84 |
|
| 85 |
hackathon_dropdown = gr.Dropdown(
|
| 86 |
+
label="Select a MCP server from the Agent-MCP hackathon submissions",
|
| 87 |
choices=get_mcp_space_endpoints(),
|
| 88 |
value=DEFAULT_MCP_URL,
|
| 89 |
interactive=True,
|
|
|
|
| 98 |
|
| 99 |
def toggle_url_input(source):
|
| 100 |
return (
|
| 101 |
+
gr.update(visible=(source == "Hackathon submissions")),
|
| 102 |
gr.update(visible=(source == "Custom MCP URL"))
|
| 103 |
)
|
| 104 |
|
| 105 |
def reload_tools_router(source, dropdown_val, custom_val):
|
| 106 |
+
selected_url = dropdown_val if source == "Hackathon submissions" else custom_val
|
| 107 |
return reload_tools_from_url(selected_url)
|
| 108 |
|
| 109 |
source_selector.change(fn=toggle_url_input, inputs=source_selector, outputs=[hackathon_dropdown, custom_url_input])
|