Spaces:
Sleeping
Sleeping
Update prompts.py
Browse files- prompts.py +76 -61
prompts.py
CHANGED
@@ -20,87 +20,94 @@ Input is a JSON object containing:
|
|
20 |
{
|
21 |
"user_query": "Primary exploration intent or research question",
|
22 |
"selected_path": [
|
23 |
-
|
24 |
],
|
25 |
"exploration_parameters": {
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
}
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
### Input Components Explained:
|
33 |
1. `user_query`: The fundamental question or exploration intent
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
|
38 |
2. `selected_path`: Current exploration context
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
|
43 |
3. `exploration_parameters`:
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
## OUTPUT BLUEPRINT
|
49 |
{
|
50 |
"exploration_summary": {
|
51 |
-
|
52 |
-
|
53 |
},
|
54 |
"knowledge_axes": {
|
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 |
"navigation_strategies": {
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
},
|
100 |
"meta_insights": {
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
}
|
105 |
}
|
106 |
|
@@ -163,4 +170,12 @@ DEFAULT_RESPONSE = {
|
|
163 |
"knowledge_gap_indicators": ["initial state"],
|
164 |
"recommended_next_steps": ["begin exploration"]
|
165 |
}
|
166 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
{
|
21 |
"user_query": "Primary exploration intent or research question",
|
22 |
"selected_path": [
|
23 |
+
{"axis": "string", "value": "string"} // Current exploration context
|
24 |
],
|
25 |
"exploration_parameters": {
|
26 |
+
"depth": 0-10, // Exploration granularity
|
27 |
+
"domain": "optional domain-specific context",
|
28 |
+
"previous_explorations": [] // Historical exploration context
|
29 |
}
|
30 |
}
|
31 |
|
32 |
+
## CURRENT INPUT:
|
33 |
+
{
|
34 |
+
"user_query": "{{user_query}}",
|
35 |
+
"selected_path": {{selected_path}},
|
36 |
+
"exploration_parameters": {{exploration_parameters}}
|
37 |
+
}
|
38 |
+
|
39 |
### Input Components Explained:
|
40 |
1. `user_query`: The fundamental question or exploration intent
|
41 |
+
- Can be broad or specific
|
42 |
+
- Represents the initial knowledge seeking goal
|
43 |
+
- Provides context for axis and value generation
|
44 |
|
45 |
2. `selected_path`: Current exploration context
|
46 |
+
- Represents user's existing exploration trajectory
|
47 |
+
- Each tuple defines an axis-value pair
|
48 |
+
- Guides contextual relevance of future suggestions
|
49 |
|
50 |
3. `exploration_parameters`:
|
51 |
+
- `depth`: Controls exploration granularity
|
52 |
+
- `domain`: Provides additional contextual constraints
|
53 |
+
- `previous_explorations`: Tracks exploration history
|
54 |
|
55 |
## OUTPUT BLUEPRINT
|
56 |
{
|
57 |
"exploration_summary": {
|
58 |
+
"current_context": "Narrative summary of exploration state",
|
59 |
+
"complexity_level": 0-10
|
60 |
},
|
61 |
"knowledge_axes": {
|
62 |
+
"standard_axes": [
|
63 |
+
{
|
64 |
+
"name": "string",
|
65 |
+
"current_values": [""],
|
66 |
+
"potential_values": [
|
67 |
+
{
|
68 |
+
"value": "string",
|
69 |
+
"relevance_score": 0-100,
|
70 |
+
"contextual_rationale": "Why this value matters"
|
71 |
+
}
|
72 |
+
],
|
73 |
+
"axis_constraints": ["Logical limitations"]
|
74 |
+
}
|
75 |
+
],
|
76 |
+
"emergent_axes": [
|
77 |
+
{
|
78 |
+
"name": "string",
|
79 |
+
"parent_axis": "string",
|
80 |
+
"innovative_values": [
|
81 |
+
{
|
82 |
+
"value": "string",
|
83 |
+
"innovation_score": 0-100,
|
84 |
+
"discovery_potential": "Unique exploration opportunity"
|
85 |
+
}
|
86 |
+
]
|
87 |
+
}
|
88 |
+
]
|
89 |
},
|
90 |
"navigation_strategies": {
|
91 |
+
"zoom_trajectories": [
|
92 |
+
{
|
93 |
+
"target_axis": "string",
|
94 |
+
"zoom_value": "string",
|
95 |
+
"unlocked_dimensions": [""],
|
96 |
+
"depth_increment": 1-3
|
97 |
+
}
|
98 |
+
],
|
99 |
+
"dezoom_pathways": [
|
100 |
+
{
|
101 |
+
"removal_tuple": {"axis": "string", "value": "string"},
|
102 |
+
"contextual_expansion": "Broader exploration narrative",
|
103 |
+
"new_possibility_vectors": [""]
|
104 |
+
}
|
105 |
+
]
|
106 |
},
|
107 |
"meta_insights": {
|
108 |
+
"exploration_efficiency": 0-100,
|
109 |
+
"knowledge_gap_indicators": [""],
|
110 |
+
"recommended_next_steps": [""]
|
111 |
}
|
112 |
}
|
113 |
|
|
|
170 |
"knowledge_gap_indicators": ["initial state"],
|
171 |
"recommended_next_steps": ["begin exploration"]
|
172 |
}
|
173 |
+
}
|
174 |
+
|
175 |
+
def format_exploration_prompt(user_query: str, selected_path: list, exploration_parameters: dict) -> str:
|
176 |
+
"""Helper function to format the prompt with proper JSON structure"""
|
177 |
+
return CONTEXTUAL_ZOOM_PROMPT.format(
|
178 |
+
user_query=json.dumps(user_query),
|
179 |
+
selected_path=json.dumps(selected_path),
|
180 |
+
exploration_parameters=json.dumps(exploration_parameters)
|
181 |
+
)
|