baconnier commited on
Commit
b8e705b
·
verified ·
1 Parent(s): b96df3f

Update models.py

Browse files
Files changed (1) hide show
  1. models.py +31 -40
models.py CHANGED
@@ -1,46 +1,37 @@
1
- from typing import List, Optional, Union, Dict
2
- from pydantic import BaseModel, Field
3
 
4
  class Location(BaseModel):
5
- name: str
6
- lat: float
7
- lon: float
8
- relevance: str = Field(description="Why this location matters in the historical context")
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 ZoomConfiguration(BaseModel):
26
- in_zoom: Optional[Union[TemporalZoom, GeographicalZoom, StyleZoom]]
27
- out_zoom: Optional[Union[TemporalZoom, GeographicalZoom, StyleZoom]]
28
-
29
- class AxisImpact(BaseModel):
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 Analysis(BaseModel):
41
- query_focus: str = Field(description="Main subject of the query")
42
- historical_context: str = Field(description="Brief historical context")
 
 
 
 
 
 
 
 
 
 
43
 
44
  class ArtHistoryResponse(BaseModel):
45
- analysis: Analysis
46
- axis_configurations: Dict[str, AxisConfiguration]
 
 
 
 
 
 
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