File size: 727 Bytes
7306a70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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")