Skip to content

Commit 67833d3

Browse files
Update prediction.py
1 parent 618561e commit 67833d3

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

app/schemas/prediction.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
from pydantic import BaseModel, Field
2-
from typing import Literal, Optional
31
from enum import Enum
2+
from pydantic import BaseModel
43

54
class 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

1511
class 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

0 commit comments

Comments
 (0)