Yassine Mhirsi
Refactor import statements in health.py and stance.py to use relative paths; update .dockerignore to remove models directory
287d61b
raw
history blame
633 Bytes
"""Health check endpoint"""
from fastapi import APIRouter
from datetime import datetime
from ..models import HealthResponse
from ..services import stance_model_manager
router = APIRouter()
@router.get("/health", response_model=HealthResponse, tags=["General"])
async def health_check():
"""Health check endpoint"""
return HealthResponse(
status="healthy" if stance_model_manager.model_loaded else "unhealthy",
model_loaded=stance_model_manager.model_loaded,
device=str(stance_model_manager.device) if stance_model_manager.device else "unknown",
timestamp=datetime.now().isoformat()
)