(request: PredictRequest)
| 255 | |
| 256 | @app.post("/predict", response_model=PredictResponse) |
| 257 | async def predict(request: PredictRequest) -> PredictResponse: |
| 258 | try: |
| 259 | return await runtime.predict(request) |
| 260 | except FileNotFoundError as exc: |
| 261 | raise HTTPException(status_code=404, detail=str(exc)) from exc |
| 262 | except Exception as exc: # pragma: no cover - defensive log path |
| 263 | raise HTTPException(status_code=500, detail=str(exc)) from exc |
| 264 | |
| 265 | return app |
| 266 |