File size: 4,290 Bytes
1413b3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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: {
    "temporal": {"level": "", "selection": ""},
    "geographical": {"level": "", "selection": ""},
    "style": {"level": "", "selection": ""},
    "subject": {"level": "", "selection": ""}
}

###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."""