Spaces:
Sleeping
Sleeping
Update models.py
Browse files
models.py
CHANGED
|
@@ -1,46 +1,37 @@
|
|
| 1 |
-
from typing import List, Optional
|
| 2 |
-
from pydantic import BaseModel
|
| 3 |
|
| 4 |
class Location(BaseModel):
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
class TemporalZoom(BaseModel):
|
| 11 |
-
level: str = Field(description="Level of temporal detail (century/decade/year)")
|
| 12 |
-
range: List[int] = Field(description="Start and end years for the time period")
|
| 13 |
-
explanation: str = Field(description="Historical significance of this time period")
|
| 14 |
-
|
| 15 |
-
class GeographicalZoom(BaseModel):
|
| 16 |
-
level: str = Field(description="Level of geographical detail (continent/country/city)")
|
| 17 |
-
locations: List[Location]
|
| 18 |
-
explanation: str = Field(description="Significance of these locations")
|
| 19 |
-
|
| 20 |
-
class StyleZoom(BaseModel):
|
| 21 |
-
level: str = Field(description="Level of style detail (movement/sub_movement/specific)")
|
| 22 |
-
options: List[str] = Field(description="Available artistic styles for selection")
|
| 23 |
-
explanation: str = Field(description="Historical context for the artistic styles")
|
| 24 |
|
| 25 |
-
class
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
temporal: Optional[str] = Field(default=None, description="How time period affects this axis")
|
| 31 |
-
geographical: Optional[str] = Field(default=None, description="How location affects this axis")
|
| 32 |
-
style: Optional[str] = Field(default=None, description="How artistic style affects this axis")
|
| 33 |
-
|
| 34 |
-
class AxisConfiguration(BaseModel):
|
| 35 |
-
component: str
|
| 36 |
-
current_zoom: Union[TemporalZoom, GeographicalZoom, StyleZoom]
|
| 37 |
-
available_zooms: Optional[ZoomConfiguration] = None
|
| 38 |
-
impacted_by: Optional[AxisImpact] = None
|
| 39 |
|
| 40 |
-
class
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
class ArtHistoryResponse(BaseModel):
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import List, Optional
|
| 2 |
+
from pydantic import BaseModel
|
| 3 |
|
| 4 |
class Location(BaseModel):
|
| 5 |
+
latitude: float
|
| 6 |
+
longitude: float
|
| 7 |
+
place_name: str
|
| 8 |
+
historical_significance: str
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
class ArtPeriod(BaseModel):
|
| 11 |
+
name: str
|
| 12 |
+
start_year: int
|
| 13 |
+
end_year: int
|
| 14 |
+
key_characteristics: List[str]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
class Artist(BaseModel):
|
| 17 |
+
name: str
|
| 18 |
+
birth_year: Optional[int]
|
| 19 |
+
death_year: Optional[int]
|
| 20 |
+
nationality: str
|
| 21 |
+
primary_medium: List[str]
|
| 22 |
+
|
| 23 |
+
class Artwork(BaseModel):
|
| 24 |
+
title: str
|
| 25 |
+
year: Optional[int]
|
| 26 |
+
medium: str
|
| 27 |
+
current_location: Optional[Location]
|
| 28 |
+
significance: str
|
| 29 |
|
| 30 |
class ArtHistoryResponse(BaseModel):
|
| 31 |
+
time_period: ArtPeriod
|
| 32 |
+
locations: List[Location]
|
| 33 |
+
key_artists: List[Artist]
|
| 34 |
+
notable_works: List[Artwork]
|
| 35 |
+
cultural_context: str
|
| 36 |
+
historical_events: List[str]
|
| 37 |
+
influence_on_later_periods: str
|