Spaces:
Runtime error
Runtime error
Commit ·
66eef17
1
Parent(s): 4099f5c
experimenting report priori knowledge
Browse files- queryHelperManagerCoT.py +47 -0
queryHelperManagerCoT.py
CHANGED
|
@@ -175,6 +175,48 @@ FROM subquery1
|
|
| 175 |
WHERE category_rank <= 5
|
| 176 |
ORDER BY state, category_rank"
|
| 177 |
}"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
promptTableInfo = self.getSystemPromptForTableCols()
|
| 179 |
selectedTablesAndCols = self.metadataLayout.getSelectedTablesAndCols()
|
| 180 |
promptColumnsInfo = self.getSystemPromptForQuery(selectedTablesAndCols)
|
|
@@ -184,6 +226,11 @@ ORDER BY state, category_rank"
|
|
| 184 |
###example userInput is {egUserInput}. output is {cotSubtaskOutput}. Output should be in json format as provided. Only output should be in response, nothing else.\n\n
|
| 185 |
tables information are {promptTableInfo}.
|
| 186 |
columns data are {promptColumnsInfo}.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
"""
|
| 188 |
|
| 189 |
prompt += f"and table Relations are {TABLE_RELATIONS} "
|
|
|
|
| 175 |
WHERE category_rank <= 5
|
| 176 |
ORDER BY state, category_rank"
|
| 177 |
}"""
|
| 178 |
+
|
| 179 |
+
salesInfoPrompt = """
|
| 180 |
+
Following is tbl_d_lineaction_code table. and tbl_d_lineaction_code and tbl_f_sales
|
| 181 |
+
join on tbl_d_lineaction_code.line_action_code, tbl_f_sales.line_action .
|
| 182 |
+
Each transaction New order, canceled, returned gets entry in tbl_f_sales. Please consider them while calculating revenue etc.
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
line_action_code line_action_code_desc load_date catgory sales_type
|
| 186 |
+
---------------- ------------------------------ --------------------- ------- ----------
|
| 187 |
+
201 NEW 2015-08-03 00:37:53.0 <null> WEB
|
| 188 |
+
202 UNSHIPPED 2015-08-03 00:37:53.0 <null> WEB
|
| 189 |
+
203 SHIPPED 2015-08-03 00:37:54.0 <null> WEB
|
| 190 |
+
204 CANCELED 2015-08-03 00:37:55.0 <null> WEB
|
| 191 |
+
205 RETURN 2015-08-03 00:37:55.0 <null> WEB
|
| 192 |
+
1 SOLD 2014-09-17 02:24:28.0 <null> POS
|
| 193 |
+
2 RETURNED 2014-09-17 02:24:30.0 <null> POS
|
| 194 |
+
7 ORDERED 2014-09-17 02:24:31.0 <null> POS
|
| 195 |
+
8 ORDER CANCELLED 2014-09-17 02:24:31.0 <null> POS
|
| 196 |
+
90 ORDER DELIVERED 2014-09-17 02:24:32.0 <null> POS
|
| 197 |
+
"""
|
| 198 |
+
masterIdPrompt = """
|
| 199 |
+
Following is two columns (customer_id and master_customer_id) of tbl_d_customer.
|
| 200 |
+
This shows that a customer can have multiple identity assigned via customer_id but they are connect to single customer via
|
| 201 |
+
master_customer_id. So when accounting for sales or transaction by particular customer, use their all the related customer_id of their
|
| 202 |
+
master_customer_id.
|
| 203 |
+
customer_id master_customer_id
|
| 204 |
+
---------- ------------------
|
| 205 |
+
89998738 1562
|
| 206 |
+
96656077 1562
|
| 207 |
+
1562 1562
|
| 208 |
+
74357421 1562
|
| 209 |
+
290007176 1562
|
| 210 |
+
"""
|
| 211 |
+
|
| 212 |
+
demandPrompt = """
|
| 213 |
+
For report creation demands means number of quantity sold."""
|
| 214 |
+
subLocationPrompt = """Following are information about
|
| 215 |
+
OPEN_BOX TBL_D_STORE: SUBLOCATIONCODE: 9009, 90093, 90094
|
| 216 |
+
PRO/PRO OPENBOX TBL_D_STORE: SUBLOCATIONCODE: 9004, 90094
|
| 217 |
+
CONSUMER/CONSUMER OPENBOX 9003, 90093
|
| 218 |
+
"""
|
| 219 |
+
|
| 220 |
promptTableInfo = self.getSystemPromptForTableCols()
|
| 221 |
selectedTablesAndCols = self.metadataLayout.getSelectedTablesAndCols()
|
| 222 |
promptColumnsInfo = self.getSystemPromptForQuery(selectedTablesAndCols)
|
|
|
|
| 226 |
###example userInput is {egUserInput}. output is {cotSubtaskOutput}. Output should be in json format as provided. Only output should be in response, nothing else.\n\n
|
| 227 |
tables information are {promptTableInfo}.
|
| 228 |
columns data are {promptColumnsInfo}.
|
| 229 |
+
Following are extra information which user might assume you know.
|
| 230 |
+
{salesInfoPrompt}
|
| 231 |
+
{masterIdPrompt}
|
| 232 |
+
{demandPrompt}
|
| 233 |
+
{subLocationPrompt}.
|
| 234 |
"""
|
| 235 |
|
| 236 |
prompt += f"and table Relations are {TABLE_RELATIONS} "
|