feat(ml,backend): implemente le service de scoring et GET /predictions (#37)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.api.deps import LecteurDep, PredictionServiceDep
|
||||
from app.schemas.prediction import PredictionSummaryResponse
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get(
|
||||
"",
|
||||
response_model=PredictionSummaryResponse,
|
||||
summary="Dernière prédiction de consommation par site",
|
||||
)
|
||||
async def get_predictions(
|
||||
_: LecteurDep, service: PredictionServiceDep
|
||||
) -> PredictionSummaryResponse:
|
||||
resume = await service.summary()
|
||||
return PredictionSummaryResponse.model_validate(resume)
|
||||
Reference in New Issue
Block a user