Spaces:
Sleeping
Sleeping
File size: 1,733 Bytes
f1718f3 9d508e3 f1718f3 9d508e3 1a584f9 eeeaee6 9d508e3 f1718f3 55cdb7e f1718f3 07d23c4 f1718f3 55cdb7e 07d23c4 a32e584 1a584f9 eeeaee6 | 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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | """Pydantic models for input validation."""
from pydantic import BaseModel, ConfigDict, Field
class SalaryInput(BaseModel):
"""Input model for salary prediction."""
model_config = ConfigDict(
json_schema_extra={
"examples": [
{
"country": "United States",
"years_code": 5.0,
"work_exp": 3.0,
"education_level": "Bachelor's degree",
"dev_type": "Developer, back-end",
"industry": "Software Development",
"age": "25-34 years old",
"ic_or_pm": "Individual contributor",
"org_size": "20 to 99 employees",
"employment": "Employed",
}
]
}
)
country: str = Field(..., description="Developer's country")
years_code: float = Field(
...,
ge=0,
description="Including any education, how many years have you been coding in total?",
)
work_exp: float = Field(
...,
ge=0,
description="How many years of professional work experience do you have?",
)
education_level: str = Field(..., description="Education level")
dev_type: str = Field(..., description="Developer type")
industry: str = Field(..., description="Industry the developer works in")
age: str = Field(..., description="Developer's age range")
ic_or_pm: str = Field(..., description="Individual contributor or people manager")
org_size: str = Field(
..., description="Size of the organisation the developer works for"
)
employment: str = Field(..., description="Current employment status")
|