Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ def index(request: Request):
|
|
| 22 |
</head>
|
| 23 |
<body>
|
| 24 |
<h2>FastAPI URLS</h2>
|
| 25 |
-
<p><a href="{host_url}" target="_blank">Host URL:</a
|
| 26 |
<p><a href="{host_url}/docs" target="_blank">DOCS</a></p>
|
| 27 |
<p><a href="{host_url}/redoc" target="_blank">REDOC</a></p>
|
| 28 |
<p><a href="{host_url}/openapi.json" target="_blank">openapi.json</a></p>
|
|
@@ -36,7 +36,7 @@ def index(request: Request):
|
|
| 36 |
|
| 37 |
# @app.get("/")
|
| 38 |
# async def get_host_url(request: Request):
|
| 39 |
-
# host_url = request.url.scheme + "://" + request.url.netloc
|
| 40 |
# return {"host_url": host_url, 'endpoints': ['/paraphrase', '/translate', f'{host_url}/docs', f'{host_url}/redoc', f'{host_url}/openapi.json'], 'mtmodels': MTMODELS}
|
| 41 |
|
| 42 |
@app.get("/paraphrase", operation_id="get_paraphrase", description="Paraphrase text", tags=["paraphrase"], summary="Paraphrase text")
|
|
@@ -55,7 +55,7 @@ def translate(text: str, model: Optional[str] = MTMODELS['enro']):
|
|
| 55 |
# Create an MCP server based on this app
|
| 56 |
mcp = FastApiMCP(
|
| 57 |
app,
|
| 58 |
-
name="
|
| 59 |
description="MCP server to translate and paraphrase text",
|
| 60 |
describe_all_responses=True,
|
| 61 |
describe_full_response_schema=True,
|
|
|
|
| 22 |
</head>
|
| 23 |
<body>
|
| 24 |
<h2>FastAPI URLS</h2>
|
| 25 |
+
<p><a href="{host_url}" target="_blank">Host URL:</a> {host_url}</p>
|
| 26 |
<p><a href="{host_url}/docs" target="_blank">DOCS</a></p>
|
| 27 |
<p><a href="{host_url}/redoc" target="_blank">REDOC</a></p>
|
| 28 |
<p><a href="{host_url}/openapi.json" target="_blank">openapi.json</a></p>
|
|
|
|
| 36 |
|
| 37 |
# @app.get("/")
|
| 38 |
# async def get_host_url(request: Request):
|
| 39 |
+
# host_url = request.url.scheme + "s://" + request.url.netloc
|
| 40 |
# return {"host_url": host_url, 'endpoints': ['/paraphrase', '/translate', f'{host_url}/docs', f'{host_url}/redoc', f'{host_url}/openapi.json'], 'mtmodels': MTMODELS}
|
| 41 |
|
| 42 |
@app.get("/paraphrase", operation_id="get_paraphrase", description="Paraphrase text", tags=["paraphrase"], summary="Paraphrase text")
|
|
|
|
| 55 |
# Create an MCP server based on this app
|
| 56 |
mcp = FastApiMCP(
|
| 57 |
app,
|
| 58 |
+
name="Translate and paraphrase FASTAPI MCP",
|
| 59 |
description="MCP server to translate and paraphrase text",
|
| 60 |
describe_all_responses=True,
|
| 61 |
describe_full_response_schema=True,
|