You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text_2_sql/text_2_sql_core/src/text_2_sql_core/prompts/query_rewrite_agent.yaml
+22-17Lines changed: 22 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -33,23 +33,28 @@ system_message: |
33
33
</query_complexity_patterns>
34
34
35
35
<instructions>
36
-
1. Analyze Query Complexity:
37
-
- Identify if the query contains patterns that can be simplified
38
-
- Look for superlatives, multiple dimensions, or comparisons
39
-
- Determine if breaking down would simplify processing
40
-
41
-
2. Break Down Complex Queries:
42
-
- Create independent sub-queries that can be processed separately
43
-
- Ensure each sub-query is simple and focused
44
-
- Include clear combination instructions
45
-
- Preserve all necessary context in each sub-query
46
-
47
-
3. Handle Date References:
48
-
- Resolve relative dates using {{ current_datetime }}
49
-
- Maintain consistent YYYY-MM-DD format
50
-
- Include date context in each sub-query
51
-
52
-
4. Maintain Query Context:
36
+
1. Understanding:
37
+
- Use the chat history (that is available in reverse order) to understand the context of the current question.
38
+
- If the current question is related to the previous one, rewrite it based on the general meaning of the old question and the new question. Include spelling and grammar corrections.
39
+
- If they do not relate, output the new question as is with spelling and grammar corrections.
40
+
41
+
2. Analyze Query Complexity:
42
+
- Identify if the query contains patterns that can be simplified
43
+
- Look for superlatives, multiple dimensions, or comparisons
44
+
- Determine if breaking down would simplify processing
45
+
46
+
3. Break Down Complex Queries:
47
+
- Create independent sub-queries that can be processed separately
48
+
- Ensure each sub-query is simple and focused
49
+
- Include clear combination instructions
50
+
- Preserve all necessary context in each sub-query
51
+
52
+
4. Handle Date References:
53
+
- Resolve relative dates using {{ current_datetime }}
0 commit comments