initial commit

This commit is contained in:
TakuyaYagam1 committed 2026-10-05 14:23:31 +03:00
commit 88c14b627e
224 files changed
+17204

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
from fastapi import APIRouter, Response, status
from lincodex_ml.api.models import MLHealthResponse, MLReadinessResponse
router = APIRouter(tags=["health"])
@router.get(
"/healthz",
operation_id="GetMLHealthz",
response_model=MLHealthResponse,
status_code=status.HTTP_200_OK,
summary="Check whether the ML process is responding.",
)
async def get_healthz() -> MLHealthResponse:
return MLHealthResponse(status="ok")
@router.get(
"/readyz",
operation_id="GetMLReadyz",
response_model=MLReadinessResponse,
responses={
status.HTTP_503_SERVICE_UNAVAILABLE: {
"model": MLReadinessResponse,
"description": "No inference runtime is available.",
}
},
summary="Check whether an inference runtime is available.",
)
async def get_readyz(response: Response) -> MLReadinessResponse:
response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
return MLReadinessResponse(status="not_ready")