Spaces:
Paused
Paused
Update src/prompts.py
Browse files- src/prompts.py +24 -31
src/prompts.py
CHANGED
|
@@ -243,51 +243,44 @@ STATA_PROMPT_TEMPLATE = {
|
|
| 243 |
"explain": "Explain what the following stata error code or message means. If code is provided, "
|
| 244 |
"describe the error in context of the code."}
|
| 245 |
}
|
| 246 |
-
|
| 247 |
CATEGORIZER_PROMPT_TEMPLATE = """\
|
| 248 |
You are a query-routing classifier for a {domain} research chatbot.
|
| 249 |
-
Your task is to read the user's query and classify it into exactly one category
|
| 250 |
Classification rules:
|
| 251 |
-
1.
|
| 252 |
-
- Use when the user
|
| 253 |
- If user input indicates the issue is resolved output "proceed".
|
| 254 |
Output:
|
| 255 |
{{
|
| 256 |
-
"category": "
|
| 257 |
-
"action": "contact",
|
| 258 |
"sub-action":"proceed"or"unresolved"
|
| 259 |
}}
|
| 260 |
-
|
| 261 |
-
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
"action": "upload",
|
| 266 |
"sub-action":"proceed"or"unresolved"
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
-
|
| 270 |
-
- Classify as:
|
| 271 |
-
- "do" for do-files
|
| 272 |
-
- "code" for Stata code or programming help
|
| 273 |
-
- "error" for debugging or error messages
|
| 274 |
-
- If user input contains the sub-action include all selected options.
|
| 275 |
-
- Unless explicitly stated in the user input, always return "unresolved".
|
| 276 |
-
- Always include sub-action options in a list unless it's "unresolved".
|
| 277 |
-
- If user input indicates the issue is resolved output "proceed".
|
| 278 |
Output:
|
| 279 |
{{
|
| 280 |
-
"category": "
|
| 281 |
-
"action":
|
| 282 |
-
"sub-action":"rewrite"or"explain"or"suggestfix"or"unresolved"or"proceed"
|
| 283 |
}}
|
| 284 |
-
|
| 285 |
-
-
|
| 286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
Output:
|
| 288 |
{{
|
| 289 |
-
"category": "
|
| 290 |
-
"action": "continue",
|
| 291 |
"sub-action":"proceed"or"unresolved"
|
| 292 |
}}
|
| 293 |
USER'S QUESTION: {query}
|
|
|
|
| 243 |
"explain": "Explain what the following stata error code or message means. If code is provided, "
|
| 244 |
"describe the error in context of the code."}
|
| 245 |
}
|
|
|
|
| 246 |
CATEGORIZER_PROMPT_TEMPLATE = """\
|
| 247 |
You are a query-routing classifier for a {domain} research chatbot.
|
| 248 |
+
Your task is to read the user's query and classify it into exactly one category. Return ONLY valid JSON.
|
| 249 |
Classification rules:
|
| 250 |
+
1. Pillar 1
|
| 251 |
+
- Use when the user shows interest in understanding whether the selected value chain aligns with the government's political incentives.
|
| 252 |
- If user input indicates the issue is resolved output "proceed".
|
| 253 |
Output:
|
| 254 |
{{
|
| 255 |
+
"category": "pillar_1",
|
|
|
|
| 256 |
"sub-action":"proceed"or"unresolved"
|
| 257 |
}}
|
| 258 |
+
2. Pillar 2
|
| 259 |
+
- Use when the user shows interest in understanding to what degree decisions are impacted by the lobbying of particular groups or by elite influence
|
| 260 |
+
Output:
|
| 261 |
+
{{
|
| 262 |
+
"category": "pillar_2",
|
|
|
|
| 263 |
"sub-action":"proceed"or"unresolved"
|
| 264 |
+
}}
|
| 265 |
+
3. Pillar 3
|
| 266 |
+
- Use when the user shows interest in understanding if the value chain/or investment intervention can be feasibly implemented given the broader institutional and policy environment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
Output:
|
| 268 |
{{
|
| 269 |
+
"category": "pillar_3",
|
| 270 |
+
"sub-action":"proceed"or"unresolved"
|
|
|
|
| 271 |
}}
|
| 272 |
+
4. Complete Analysis
|
| 273 |
+
- Use if the input query indicates interest in all three pillars
|
| 274 |
+
Output:
|
| 275 |
+
{{
|
| 276 |
+
"category": "complete",
|
| 277 |
+
"sub-action":"proceed"or"unresolved"
|
| 278 |
+
}}
|
| 279 |
+
4. Qualitative Discussion
|
| 280 |
+
- User shows interest in understanding if there are any political risks that could undermine the selected value chain or investment intervention
|
| 281 |
Output:
|
| 282 |
{{
|
| 283 |
+
"category": "complete",
|
|
|
|
| 284 |
"sub-action":"proceed"or"unresolved"
|
| 285 |
}}
|
| 286 |
USER'S QUESTION: {query}
|