KnowingFly26's picture
Initial commit - Depression Detection API
7306a70
Raw History Blame Contribute Delete
727 Bytes
from pydantic import BaseModel, Field
class PredictionResponse(BaseModel):
"""Response model for depression prediction endpoint."""
prediction: str = Field(..., description="Prediction result: 'depression' or 'neutral'")
confidence: float = Field(..., description="Confidence score between 0 and 1", ge=0.0, le=1.0)
class HealthResponse(BaseModel):
"""Response model for health check endpoint."""
status: str = Field(..., description="Health status of the API")
model_loaded: bool = Field(..., description="Whether the ML model is loaded successfully")
class ErrorResponse(BaseModel):
"""Response model for error responses."""
detail: str = Field(..., description="Error message details")