aakarshanr/apt_mia_processing
0
1from fastapi.responses import JSONResponse2 3def success_response(4 prediction: str,5 confidence: float,6 gradcam: str,7 integrated_gradients: str8):9 return JSONResponse({10 "prediction": prediction,11 "confidence": confidence,12 "gradcam": gradcam,13 "integrated_gradients": integrated_gradients14 })15 16 17def error_response(message: str, details: str = ""):18 return JSONResponse(19 status_code=500,20 content={21 "error": message,22 "details": details23 }24 )25 