zx
Browse files
app.py
CHANGED
@@ -1,7 +1,18 @@
|
|
1 |
from fastapi import FastAPI
|
|
|
2 |
|
|
|
3 |
app = FastAPI()
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from fastapi import FastAPI
|
2 |
+
from fastmcp import create_server # β import the FastMCP factory
|
3 |
|
4 |
+
# ββ Parent FastAPI app βββββββββββββββββββββββββββββββββββββββββββ
|
5 |
app = FastAPI()
|
6 |
|
7 |
+
# ββ Mount the existing FastMCP server under /sse/ ββββββββββββββββ
|
8 |
+
#
|
9 |
+
# FastMCP already returns a FastAPI/Starlette app, so you can plug it
|
10 |
+
# straight into your main application.
|
11 |
+
#
|
12 |
+
vector_app = create_server(transport="sse") # keep any flags you need
|
13 |
+
app.mount("/sse", vector_app) # /sse/ now serves the API
|
14 |
+
|
15 |
+
# ββ Minimal health-check route for Hugging Face and Docker βββββββ
|
16 |
+
@app.get("/", tags=["health"])
|
17 |
+
async def root():
|
18 |
+
return {"status": "ok"}
|