Spaces:
Running
Running
Update app.py
#1
by
DarkDriftz
- opened
app.py
CHANGED
|
@@ -146,7 +146,7 @@ def create_hf_space(token, space_name, space_public, app_code, auth_token):
|
|
| 146 |
gr.Error(f"β Error creating space: {str(e)}")
|
| 147 |
|
| 148 |
|
| 149 |
-
def launch_mcp_server(openapi_spec_url, api_base_url, paths, methods, auth_token, space_name_box, space_public_box, oauth_token: gr.OAuthToken |
|
| 150 |
if oauth_token:
|
| 151 |
if not paths:
|
| 152 |
paths = None
|
|
@@ -188,7 +188,7 @@ with gr.Blocks(theme="ocean") as demo:
|
|
| 188 |
space_public_box = gr.Checkbox(label="Make Space public", value=True)
|
| 189 |
with gr.Row():
|
| 190 |
login_button = gr.LoginButton()
|
| 191 |
-
launch_button = gr.Button("π Create MCP Space", variant="primary", interactive=
|
| 192 |
|
| 193 |
gr.on(
|
| 194 |
[demo.load, find_endpoints_button.click],
|
|
@@ -208,7 +208,7 @@ with gr.Blocks(theme="ocean") as demo:
|
|
| 208 |
[launch_button.click],
|
| 209 |
launch_mcp_server,
|
| 210 |
inputs=[openapi_spec_url, api_base_url, paths, methods, auth_token, space_name_box, space_public_box],
|
| 211 |
-
outputs=
|
| 212 |
)
|
| 213 |
|
| 214 |
demo.launch()
|
|
|
|
| 146 |
gr.Error(f"β Error creating space: {str(e)}")
|
| 147 |
|
| 148 |
|
| 149 |
+
def launch_mcp_server(openapi_spec_url, api_base_url, paths, methods, auth_token, space_name_box, space_public_box, oauth_token: gr.OAuthToken | True):
|
| 150 |
if oauth_token:
|
| 151 |
if not paths:
|
| 152 |
paths = None
|
|
|
|
| 188 |
space_public_box = gr.Checkbox(label="Make Space public", value=True)
|
| 189 |
with gr.Row():
|
| 190 |
login_button = gr.LoginButton()
|
| 191 |
+
launch_button = gr.Button("π Create MCP Space", variant="primary", interactive=True)
|
| 192 |
|
| 193 |
gr.on(
|
| 194 |
[demo.load, find_endpoints_button.click],
|
|
|
|
| 208 |
[launch_button.click],
|
| 209 |
launch_mcp_server,
|
| 210 |
inputs=[openapi_spec_url, api_base_url, paths, methods, auth_token, space_name_box, space_public_box],
|
| 211 |
+
outputs=True
|
| 212 |
)
|
| 213 |
|
| 214 |
demo.launch()
|