File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change 1- from pydantic import BaseModel , Field
2- from typing import Literal , Optional
31from enum import Enum
2+ from pydantic import BaseModel
43
54class DiseaseType (str , Enum ):
6- PNEUMONIA = "Pneumonia"
7- MELANOMA = "Melanoma"
8- BRAIN = "Brain"
9- HEART = "Heart"
10-
11- class PredictionRequest (BaseModel ):
12- disease_type : DiseaseType = Field (..., description = "Type of disease to predict" )
13- image_base64 : str = Field (..., description = "Base64 encoded image data" )
5+ SKIN_CANCER = "skin_cancer"
6+ PNEUMONIA = "pneumonia"
7+ BRAIN_TUMOR = "brain_tumor"
8+ EYE_DISEASE = "eye_disease"
9+ HEART_DISEASE = "heart_disease"
1410
1511class PredictionResponse (BaseModel ):
1612 disease_type : DiseaseType
1713 prediction : str
18- confidence : float = Field (..., ge = 0.0 , le = 1.0 )
14+ confidence : float
1915 analysis : str
20- status : Literal [ "success" , "error" ] = "success"
21- error_message : Optional [ str ] = None
16+ status : str = "success"
17+ error_message : str | None = None
You can’t perform that action at this time.
0 commit comments