File size: 748 Bytes
782e635
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Pydantic schemas for API."""
from pydantic import BaseModel, Field
from typing import List, Dict, Optional


class PredictionResponse(BaseModel):
    predicted_class: str
    confidence: float
    confidence_level: str
    tier: str
    severity: str
    emoji: str
    tagline: str
    action: str
    urgency_message: str
    description: str
    care_advice: List[str]
    risk_factors: List[str]
    hospital_search_query: str
    hospital_type: str
    differential_diagnosis: List[Dict]
    cancer_alert: bool
    cancer_warning: Optional[str] = None
    all_probabilities: Dict[str, float]
    disclaimer: str
    maps_url: str


class HealthResponse(BaseModel):
    status: str
    model_loaded: bool
    model_name: str
    version: str