|
from pydantic import BaseModel, Field |
|
from typing import Literal, List, Union, Optional |
|
|
|
|
|
CommonAnomalies = Literal[ |
|
'blackened/burnt skin', |
|
'blood', |
|
'foreign body', |
|
'fracture', |
|
'injury', |
|
'parasite', |
|
'swelling', |
|
'warty or tumor-like growth, crusts' |
|
] |
|
|
|
|
|
class BeakAnomaly(BaseModel): |
|
type: Literal['beak'] |
|
anomaly_type: List[Literal[ |
|
'adhesion', |
|
'deformation', |
|
CommonAnomalies |
|
]] |
|
|
|
|
|
class BodyAnomaly(BaseModel): |
|
type: Literal['body'] |
|
anomaly_type: List[Literal[ |
|
'emaciation', |
|
'fluffed up', |
|
'stained feathers', |
|
CommonAnomalies |
|
]] |
|
|
|
|
|
class LegAnomaly(BaseModel): |
|
type: Literal['legs'] |
|
anomaly_type: List[Literal[ |
|
'missing limb', |
|
'deformation', |
|
CommonAnomalies |
|
]] |
|
|
|
|
|
class FeathersWingsTailAnomaly(BaseModel): |
|
type: Literal['feathers/wings/tail'] |
|
anomaly_type: List[Literal[ |
|
'fluffed up', |
|
'feather abnormalities', |
|
'stained feathers', |
|
'abnormal wing posture', |
|
'missing limb', |
|
CommonAnomalies |
|
]] |
|
|
|
|
|
class HeadAnomaly(BaseModel): |
|
type: Literal['head incl. eyes'] |
|
anomaly_type: List[Literal[ |
|
'ear changes', |
|
'eye changes', |
|
'tilted head', |
|
CommonAnomalies |
|
]] |
|
|
|
|
|
|
|
AnomalyType = Union[ |
|
BeakAnomaly, |
|
BodyAnomaly, |
|
LegAnomaly, |
|
FeathersWingsTailAnomaly, |
|
HeadAnomaly |
|
] |
|
|
|
|
|
class PhysicalAnomalies(BaseModel): |
|
physical_radio: str |
|
physical_anomalies_type: Optional[List[AnomalyType]] = None |
|
|