This commit is contained in:
2026-04-21 16:53:56 +03:00
parent 1346924387
commit 2ccd6831eb
26 changed files with 430403 additions and 3 deletions
+10 -1
View File
@@ -16,6 +16,7 @@ from pydantic import BaseModel
from models.basketball_v25 import get_basketball_v25_predictor
from services.single_match_orchestrator import get_single_match_orchestrator
from services.v26_shadow_engine import get_v26_shadow_engine
from data.database import dispose_engine
load_dotenv()
@@ -38,6 +39,7 @@ async def lifespan(_: FastAPI):
try:
print("🚀 Initializing V25 orchestrator...", flush=True)
get_single_match_orchestrator()
get_v26_shadow_engine()
print("✅ V25 orchestrator ready", flush=True)
except Exception as error:
print(f"❌ Failed to initialize orchestrator: {error}", flush=True)
@@ -104,6 +106,7 @@ def read_root() -> dict[str, Any]:
return {
"status": "Suggest-Bet AI Engine v25",
"engine": "V25 Single Match Orchestrator",
"mode": os.getenv("AI_ENGINE_MODE", "v25"),
"routes": [
"POST /v20plus/analyze/{match_id}",
"GET /v20plus/analyze-htms/{match_id}",
@@ -118,15 +121,21 @@ def read_root() -> dict[str, Any]:
@app.get("/health")
def health_check() -> dict[str, Any]:
try:
get_single_match_orchestrator()
orchestrator = get_single_match_orchestrator()
shadow_engine = get_v26_shadow_engine()
basketball_predictor = get_basketball_v25_predictor()
basketball_readiness = basketball_predictor.readiness_summary()
ready = bool(basketball_readiness["fully_loaded"])
return {
"status": "healthy" if ready else "degraded",
"engine": "v25.main",
"mode": os.getenv("AI_ENGINE_MODE", "v25"),
"ready": ready,
"basketball_v25": basketball_readiness,
"v26_shadow": shadow_engine.readiness_summary(),
"prediction_service_ready": True,
"model_loaded": ready,
"orchestrator_mode": getattr(orchestrator, "engine_mode", "v25"),
}
except Exception as error:
return {"status": "unhealthy", "ready": False, "error": str(error)}