Spaces:
Sleeping
Sleeping
CONTEXTUAL_ZOOM_PROMPT = """ | |
You are an expert art historian specializing in interactive exploration. Analyze the query and generate contextually aware zoom configurations with explanations. | |
###Input### | |
User Query: {user_query} | |
Current Zoom States: {current_zoom_states} | |
###Output Format### | |
{ | |
"analysis": { | |
"query_focus": "main subject", | |
"historical_context": "brief explanation" | |
}, | |
"axis_configurations": { | |
"temporal": { | |
"component": "st.slider", | |
"current_zoom": { | |
"level": "century/decade/year", | |
"range": [start, end], | |
"explanation": "Why this time range is relevant" | |
}, | |
"available_zooms": { | |
"in": { | |
"range": [narrower_start, narrower_end], | |
"explanation": "What focusing here reveals" | |
}, | |
"out": { | |
"range": [broader_start, broader_end], | |
"explanation": "Broader historical context" | |
} | |
}, | |
"impacted_by": { | |
"geographical": "how location affects timeframe", | |
"style": "how style affects timeframe" | |
} | |
}, | |
"geographical": { | |
"component": "st.map", | |
"current_zoom": { | |
"level": "continent/country/city", | |
"locations": [ | |
{ | |
"name": "", | |
"lat": 0, | |
"lon": 0, | |
"relevance": "why this location matters" | |
} | |
] | |
}, | |
"available_zooms": { | |
"in": { | |
"locations": ["more specific locations"], | |
"explanation": "What focusing here reveals" | |
}, | |
"out": { | |
"locations": ["broader regions"], | |
"explanation": "Broader geographical context" | |
} | |
}, | |
"impacted_by": { | |
"temporal": "how time period affects locations", | |
"style": "how style affects locations" | |
} | |
}, | |
"style": { | |
"component": "st.multiselect" if current_zoom == "broad" else "st.selectbox", | |
"current_zoom": { | |
"level": "movement/sub_movement/specific", | |
"options": ["list of styles"], | |
"explanation": "Style context for this period/location" | |
} | |
} | |
}, | |
"streamlit_adaptations": { | |
"recommended_components": { | |
"component_name": "reason for recommendation based on zoom level", | |
"configuration": {} | |
} | |
} | |
} | |
###Example for "paint during napoleon war"### | |
{ | |
"temporal": { | |
"component": "st.slider", | |
"current_zoom": { | |
"level": "period", | |
"range": [1799, 1815], | |
"explanation": "Napoleon's reign as First Consul and Emperor" | |
}, | |
"available_zooms": { | |
"in": { | |
"range": [1812, 1815], | |
"explanation": "Focus on final campaigns and artistic responses" | |
} | |
} | |
}, | |
"geographical": { | |
"component": "st.map", | |
"current_zoom": { | |
"level": "continent", | |
"locations": [ | |
{ | |
"name": "France", | |
"relevance": "Center of Napoleonic art production" | |
}, | |
{ | |
"name": "Spain", | |
"relevance": "Goya's war paintings perspective" | |
} | |
] | |
} | |
} | |
} | |
###Requirements### | |
1. Explain zoom level changes and their historical significance | |
2. Adapt Streamlit components based on zoom level | |
3. Show relationships between different axes | |
4. Provide historical context for available selections | |
5. Consider how selections affect other axes | |
6. Include relevant historical explanations for each zoom level | |
Generate only the JSON response, maintaining strict JSON format.""" | |
CONTEXTUAL_ZOOM_default_response = { | |
"analysis": { | |
"query_focus": "Default focus", | |
"historical_context": "Default historical context" | |
}, | |
"axis_configurations": { | |
"temporal": { | |
"component": "st.slider", | |
"current_zoom": { | |
"level": "century", | |
"range": [1700, 2000], | |
"explanation": "Default time range" | |
}, | |
"available_zooms": { | |
"in": { | |
"range": [1800, 1900], | |
"explanation": "Zoom in to see more detail" | |
}, | |
"out": { | |
"range": [1500, 2024], | |
"explanation": "Broader historical context" | |
} | |
} | |
}, | |
"geographical": { | |
"current_zoom": { | |
"level": "continent", | |
"locations": [ | |
{ | |
"name": "Paris", | |
"lat": 48.8566, | |
"lon": 2.3522, | |
"relevance": "Default location" | |
} | |
] | |
} | |
}, | |
"style": { | |
"current_zoom": { | |
"level": "movement", | |
"options": ["Classical", "Modern"], | |
"explanation": "Default art movements" | |
} | |
} | |
} | |
} |