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: wren-ai-service/src/pipelines/generation/intent_classification.py
+42-18
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@
25
25
### TASK ###
26
26
You are a great detective, who is great at intent classification.
27
27
First, rephrase the user's question to make it more specific, clear and relevant to the database schema before making the intent classification.
28
-
Second, you need to use rephrased user's question to classify user's intent based on given database schema to one of three conditions: MISLEADING_QUERY, TEXT_TO_SQL, GENERAL.
28
+
Second, you need to use rephrased user's question to classify user's intent based on given database schema to one of four conditions: MISLEADING_QUERY, TEXT_TO_SQL, GENERAL, USER_GUIDE.
29
29
Also you should provide reasoning for the classification clearly and concisely within 20 words.
30
30
31
31
### INSTRUCTIONS ###
@@ -56,6 +56,31 @@
56
56
- "What is the total sales for last quarter?"
57
57
- "Show me all customers who purchased product X."
58
58
- "List the top 10 products by revenue."
59
+
- GENERAL
60
+
- When to Use:
61
+
- Use this category if the user is seeking general information about the database schema.
62
+
- If the rephrasedd user's question is related to the previous question, but considering them together cannot be answered by generating an SQL query using that schema.
63
+
- Characteristics:
64
+
- The question is about understanding the dataset or its capabilities.
65
+
- The user may need guidance on how to proceed or what questions to ask.
66
+
- Instructions:
67
+
- MUST explicitly add phrases from the rephrasedd user's question that are not explicitly related to the database schema in the reasoning output. Choose the most relevant phrases that cause the rephrasedd user's question to be GENERAL.
68
+
- Examples:
69
+
- "What is the dataset about?"
70
+
- "Tell me more about the database."
71
+
- "How can I analyze customer behavior with this data?"
72
+
- USER_GUIDE
73
+
- When to Use:
74
+
- If the user's question is about Wren AI's features, capabilities, or how to use Wren AI.
75
+
- If the user's question is related to the content in the user guide.
76
+
- Characteristics:
77
+
- The question is about Wren AI's features, capabilities, or how to use Wren AI.
78
+
- Examples:
79
+
- "What can Wren AI do?"
80
+
- "How can I reset project?"
81
+
- "How can I delete project?"
82
+
- "How can I connect to other databases?"
83
+
- "How to draw a chart?"
59
84
- MISLEADING_QUERY
60
85
- When to Use:
61
86
- If the rephrasedd user's question is irrelevant to the given database schema and cannot be answered using SQL with that schema.
@@ -71,28 +96,14 @@
71
96
- "How are you?"
72
97
- "What's the weather like today?"
73
98
- "Tell me a joke."
74
-
- GENERAL
75
-
- When to Use:
76
-
- Use this category if the user is seeking general information about the database schema.
77
-
- If the rephrasedd user's question is related to the previous question, but considering them together cannot be answered by generating an SQL query using that schema.
78
-
- Characteristics:
79
-
- The question is about understanding the dataset or its capabilities.
80
-
- The user may need guidance on how to proceed or what questions to ask.
81
-
- Instructions:
82
-
- MUST explicitly add phrases from the rephrasedd user's question that are not explicitly related to the database schema in the reasoning output. Choose the most relevant phrases that cause the rephrasedd user's question to be GENERAL.
83
-
- Examples:
84
-
- "What is the dataset about?"
85
-
- "Tell me more about the database."
86
-
- "What can Wren AI do?"
87
-
- "How can I analyze customer behavior with this data?"
88
-
99
+
89
100
### OUTPUT FORMAT ###
90
101
Please provide your response as a JSON object, structured as follows:
0 commit comments