Spaces:
Sleeping
Sleeping
Update variables.py
Browse files- variables.py +53 -80
variables.py
CHANGED
@@ -1,87 +1,27 @@
|
|
1 |
CONTEXTUAL_ZOOM_PROMPT = """
|
2 |
-
You are an expert art historian specializing in interactive exploration. Analyze the query and generate
|
3 |
|
4 |
-
###Input###
|
5 |
User Query: {user_query}
|
6 |
Current Zoom States: {current_zoom_states}
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
"current_zoom": {{
|
18 |
-
"level": "century/decade/year",
|
19 |
-
"range": [start, end],
|
20 |
-
"explanation": "Why this time range is relevant"
|
21 |
-
}},
|
22 |
-
"available_zooms": {{
|
23 |
-
"in": {{
|
24 |
-
"range": [narrower_start, narrower_end],
|
25 |
-
"explanation": "What focusing here reveals"
|
26 |
-
}},
|
27 |
-
"out": {{
|
28 |
-
"range": [broader_start, broader_end],
|
29 |
-
"explanation": "Broader historical context"
|
30 |
-
}}
|
31 |
-
}},
|
32 |
-
"impacted_by": {{
|
33 |
-
"geographical": "how location affects timeframe",
|
34 |
-
"style": "how style affects timeframe"
|
35 |
-
}}
|
36 |
-
}},
|
37 |
-
"geographical": {{
|
38 |
-
"component": "st.map",
|
39 |
-
"current_zoom": {{
|
40 |
-
"level": "continent/country/city",
|
41 |
-
"locations": [
|
42 |
-
{{
|
43 |
-
"name": "",
|
44 |
-
"lat": 0,
|
45 |
-
"lon": 0,
|
46 |
-
"relevance": "why this location matters"
|
47 |
-
}}
|
48 |
-
]
|
49 |
-
}},
|
50 |
-
"available_zooms": {{
|
51 |
-
"in": {{
|
52 |
-
"locations": ["more specific locations"],
|
53 |
-
"explanation": "What focusing here reveals"
|
54 |
-
}},
|
55 |
-
"out": {{
|
56 |
-
"locations": ["broader regions"],
|
57 |
-
"explanation": "Broader geographical context"
|
58 |
-
}}
|
59 |
-
}},
|
60 |
-
"impacted_by": {{
|
61 |
-
"temporal": "how time period affects locations",
|
62 |
-
"style": "how style affects locations"
|
63 |
-
}}
|
64 |
-
}},
|
65 |
-
"style": {{
|
66 |
-
"component": "st.multiselect",
|
67 |
-
"current_zoom": {{
|
68 |
-
"level": "movement/sub_movement/specific",
|
69 |
-
"options": ["list of styles"],
|
70 |
-
"explanation": "Style context for this period/location"
|
71 |
-
}}
|
72 |
-
}}
|
73 |
-
}}
|
74 |
-
}}
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
5. Consider how selections affect other axes
|
82 |
-
6. Include relevant historical explanations for each zoom level
|
83 |
|
84 |
-
Generate
|
|
|
85 |
|
86 |
CONTEXTUAL_ZOOM_default_response = {
|
87 |
"analysis": {
|
@@ -92,7 +32,6 @@ CONTEXTUAL_ZOOM_default_response = {
|
|
92 |
"temporal": {
|
93 |
"component": "st.slider",
|
94 |
"current_zoom": {
|
95 |
-
"level": "century",
|
96 |
"range": [1700, 2000],
|
97 |
"explanation": "Default time range"
|
98 |
},
|
@@ -105,11 +44,15 @@ CONTEXTUAL_ZOOM_default_response = {
|
|
105 |
"range": [1500, 2024],
|
106 |
"explanation": "Broader historical context"
|
107 |
}
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
},
|
110 |
"geographical": {
|
|
|
111 |
"current_zoom": {
|
112 |
-
"level": "continent",
|
113 |
"locations": [
|
114 |
{
|
115 |
"name": "Paris",
|
@@ -117,10 +60,40 @@ CONTEXTUAL_ZOOM_default_response = {
|
|
117 |
"lon": 2.3522,
|
118 |
"relevance": "Default location"
|
119 |
}
|
120 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
}
|
122 |
},
|
123 |
"style": {
|
|
|
124 |
"current_zoom": {
|
125 |
"level": "movement",
|
126 |
"options": ["Classical", "Modern"],
|
|
|
1 |
CONTEXTUAL_ZOOM_PROMPT = """
|
2 |
+
You are an expert art historian specializing in interactive exploration. Analyze the query and generate a response following this exact structure:
|
3 |
|
|
|
4 |
User Query: {user_query}
|
5 |
Current Zoom States: {current_zoom_states}
|
6 |
|
7 |
+
Your response should be a JSON object with:
|
8 |
+
1. An "analysis" section containing:
|
9 |
+
- query_focus: Main subject
|
10 |
+
- historical_context: Brief explanation
|
11 |
+
|
12 |
+
2. An "axis_configurations" section with:
|
13 |
+
- temporal configuration (time periods)
|
14 |
+
- geographical configuration (locations)
|
15 |
+
- style configuration (art movements)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
+
Each axis should include:
|
18 |
+
- Current zoom level details
|
19 |
+
- Available zoom options (in/out)
|
20 |
+
- Impact relationships with other axes
|
21 |
+
- Clear explanations for historical significance
|
|
|
|
|
22 |
|
23 |
+
Generate a complete, valid JSON response matching the ArtHistoryResponse model structure.
|
24 |
+
"""
|
25 |
|
26 |
CONTEXTUAL_ZOOM_default_response = {
|
27 |
"analysis": {
|
|
|
32 |
"temporal": {
|
33 |
"component": "st.slider",
|
34 |
"current_zoom": {
|
|
|
35 |
"range": [1700, 2000],
|
36 |
"explanation": "Default time range"
|
37 |
},
|
|
|
44 |
"range": [1500, 2024],
|
45 |
"explanation": "Broader historical context"
|
46 |
}
|
47 |
+
},
|
48 |
+
"impacted_by": {
|
49 |
+
"geographical": "Default geographical impact",
|
50 |
+
"style": "Default style impact"
|
51 |
}
|
52 |
},
|
53 |
"geographical": {
|
54 |
+
"component": "st.map",
|
55 |
"current_zoom": {
|
|
|
56 |
"locations": [
|
57 |
{
|
58 |
"name": "Paris",
|
|
|
60 |
"lon": 2.3522,
|
61 |
"relevance": "Default location"
|
62 |
}
|
63 |
+
],
|
64 |
+
"explanation": "Default location explanation"
|
65 |
+
},
|
66 |
+
"available_zooms": {
|
67 |
+
"in": {
|
68 |
+
"locations": [
|
69 |
+
{
|
70 |
+
"name": "Louvre",
|
71 |
+
"lat": 48.8606,
|
72 |
+
"lon": 2.3376,
|
73 |
+
"relevance": "Default specific location"
|
74 |
+
}
|
75 |
+
],
|
76 |
+
"explanation": "Default zoom in explanation"
|
77 |
+
},
|
78 |
+
"out": {
|
79 |
+
"locations": [
|
80 |
+
{
|
81 |
+
"name": "France",
|
82 |
+
"lat": 46.2276,
|
83 |
+
"lon": 2.2137,
|
84 |
+
"relevance": "Default broader location"
|
85 |
+
}
|
86 |
+
],
|
87 |
+
"explanation": "Default zoom out explanation"
|
88 |
+
}
|
89 |
+
},
|
90 |
+
"impacted_by": {
|
91 |
+
"temporal": "Default temporal impact",
|
92 |
+
"style": "Default style impact"
|
93 |
}
|
94 |
},
|
95 |
"style": {
|
96 |
+
"component": "st.multiselect",
|
97 |
"current_zoom": {
|
98 |
"level": "movement",
|
99 |
"options": ["Classical", "Modern"],
|