fix: update version tags to v28 and temporarily disable cache for predictions

This commit is contained in:
2026-04-24 00:11:00 +03:00
parent 634204acf0
commit 1f26a5bf2f
10 changed files with 86 additions and 56 deletions
+11 -11
View File
@@ -37,10 +37,10 @@ class CouponRequest(BaseModel):
@asynccontextmanager
async def lifespan(_: FastAPI):
try:
print("🚀 Initializing V25 orchestrator...", flush=True)
print("🚀 Initializing V28 orchestrator...", flush=True)
get_single_match_orchestrator()
get_v26_shadow_engine()
print("✅ V25 orchestrator ready", flush=True)
print("✅ V28 orchestrator ready", flush=True)
except Exception as error:
print(f"❌ Failed to initialize orchestrator: {error}", flush=True)
import traceback
@@ -55,8 +55,8 @@ async def lifespan(_: FastAPI):
app = FastAPI(
title="Suggest-Bet AI Engine",
version="25.0.0",
description="V25 Single Match Prediction Package API",
version="28.0.0",
description="V28 Single Match Prediction Package API",
lifespan=lifespan,
)
@@ -104,9 +104,9 @@ async def global_exception_handler(_: Request, exc: Exception):
@app.get("/")
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"),
"status": "Suggest-Bet AI Engine v28",
"engine": "V28 Single Match Orchestrator",
"mode": os.getenv("AI_ENGINE_MODE", "v28"),
"routes": [
"POST /v20plus/analyze/{match_id}",
"GET /v20plus/analyze-htms/{match_id}",
@@ -128,14 +128,14 @@ def health_check() -> dict[str, Any]:
ready = bool(basketball_readiness["fully_loaded"])
return {
"status": "healthy" if ready else "degraded",
"engine": "v25.main",
"mode": os.getenv("AI_ENGINE_MODE", "v25"),
"engine": "v28.main",
"mode": os.getenv("AI_ENGINE_MODE", "v28"),
"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"),
"orchestrator_mode": getattr(orchestrator, "engine_mode", "v28"),
}
except Exception as error:
return {"status": "unhealthy", "ready": False, "error": str(error)}
@@ -205,7 +205,7 @@ async def analyze_match_htft_v20plus(match_id: str, timeout_sec: int = 30) -> di
key=lambda item: float(item[1]),
)
return {
"engine": "v25.main",
"engine": "v28.main",
"match_info": result.get("match_info", {}),
"timing_ms": int((time.time() - started_at) * 1000),
"ht_ft_probs": htft_probs,
@@ -1886,7 +1886,7 @@ class SingleMatchOrchestrator:
][:safe_count]
preview = watch_items_all[: min(5, len(watch_items_all))]
return {
"engine": "v25.main",
"engine": "v28.main",
"generated_at": __import__("datetime").datetime.utcnow().isoformat() + "Z",
"horizon_hours": safe_horizon,
"min_score": round(safe_min_score, 2),
@@ -3162,7 +3162,7 @@ class SingleMatchOrchestrator:
is_simulation = _resp_status in {"FT", "FINISHED"} or _resp_state in {"POSTGAME", "POST_GAME"}
return {
"model_version": "v25.main",
"model_version": "v28-pro-max",
"simulation_mode": "pre_match" if is_simulation else None,
"match_info": {
"match_id": data.match_id,
@@ -3394,7 +3394,7 @@ class SingleMatchOrchestrator:
}
return {
"model_version": str(prediction.get("engine_version") or "v25.main.basketball"),
"model_version": str(prediction.get("engine_version") or "v28.main.basketball"),
"match_info": {
"match_id": data.match_id,
"match_name": f"{data.home_team_name} vs {data.away_team_name}",