Update app.py
Browse files
app.py
CHANGED
|
@@ -214,11 +214,17 @@ async def root():
|
|
| 214 |
|
| 215 |
@app.get("/health")
|
| 216 |
async def health():
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
|
| 223 |
|
| 224 |
@app.get("/v1/models", dependencies=[Depends(verify_api_key)])
|
|
|
|
| 214 |
|
| 215 |
@app.get("/health")
|
| 216 |
async def health():
|
| 217 |
+
embed_ok = models["embed_status"] == "ready"
|
| 218 |
+
rerank_ok = models["rerank_status"] == "ready"
|
| 219 |
+
all_ok = embed_ok and rerank_ok
|
| 220 |
+
return JSONResponse(
|
| 221 |
+
status_code=200 if all_ok else 503,
|
| 222 |
+
content={
|
| 223 |
+
"status": "ok" if all_ok else "degraded",
|
| 224 |
+
"embed_status": models["embed_status"],
|
| 225 |
+
"rerank_status": models["rerank_status"],
|
| 226 |
+
}
|
| 227 |
+
)
|
| 228 |
|
| 229 |
|
| 230 |
@app.get("/v1/models", dependencies=[Depends(verify_api_key)])
|