Spaces:
Sleeping
Sleeping
add anthropic_configured flag to /healthz
Browse files- server/app/main.py +11 -2
server/app/main.py
CHANGED
|
@@ -7,6 +7,7 @@ Routes:
|
|
| 7 |
"""
|
| 8 |
|
| 9 |
import logging
|
|
|
|
| 10 |
from pathlib import Path
|
| 11 |
|
| 12 |
from fastapi import FastAPI
|
|
@@ -27,8 +28,16 @@ WEB_DIR = Path(__file__).parent / "web"
|
|
| 27 |
|
| 28 |
|
| 29 |
@app.get("/healthz")
|
| 30 |
-
def healthz() -> dict[str,
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
@app.get("/")
|
|
|
|
| 7 |
"""
|
| 8 |
|
| 9 |
import logging
|
| 10 |
+
import os
|
| 11 |
from pathlib import Path
|
| 12 |
|
| 13 |
from fastapi import FastAPI
|
|
|
|
| 28 |
|
| 29 |
|
| 30 |
@app.get("/healthz")
|
| 31 |
+
def healthz() -> dict[str, object]:
|
| 32 |
+
"""Liveness + config probe.
|
| 33 |
+
|
| 34 |
+
`anthropic_configured` reports whether the ANTHROPIC_API_KEY secret is set
|
| 35 |
+
(the coaching layer needs it) — without ever exposing the key's value.
|
| 36 |
+
"""
|
| 37 |
+
return {
|
| 38 |
+
"status": "ok",
|
| 39 |
+
"anthropic_configured": bool(os.environ.get("ANTHROPIC_API_KEY")),
|
| 40 |
+
}
|
| 41 |
|
| 42 |
|
| 43 |
@app.get("/")
|