-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemas.py
More file actions
18 lines (16 loc) · 1.01 KB
/
Copy pathschemas.py
File metadata and controls
18 lines (16 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# schemas.py
from pydantic import BaseModel, Field
from typing import Optional
class WeatherResponse(BaseModel):
city: str = Field(..., description="Name of the resolved city")
country: Optional[str] = Field(None, description="Country of the city")
latitude: float = Field(..., description="Latitude coordinate")
longitude: float = Field(..., description="Longitude coordinate")
temperature_c: Optional[float] = Field(None, description="Current temperature in Celsius")
humidity_percent: Optional[int] = Field(None, description="Relative humidity percentage")
wind_speed_kmh: Optional[float] = Field(None, description="Wind speed in km/h")
weather_code: Optional[int] = Field(None, description="Raw WMO weather code")
description: str = Field(..., description="Human-readable weather condition")
time: Optional[str] = Field(None, description="Time of the weather reading")
class HealthResponse(BaseModel):
status: str = Field(..., description="Application health status")