Spaces:
Runtime error
Runtime error
Commit ·
35cb8de
1
Parent(s): f1037ed
bug fix
Browse files- queryHelperManager.py +1 -1
queryHelperManager.py
CHANGED
|
@@ -88,7 +88,7 @@ ORDER BY chandelier_count DESC"""
|
|
| 88 |
question = "top 5 customers who bought most chandeliers in nov 2023"
|
| 89 |
promptForQuery = f"""You are a powerful text to sql model. Answer user input with sql query. And the query needs to run on {platform}. and schemaName is {schemaName}. There is example user input and desired generated sql query. Follow similar patterns as example. eg case insensitive, explicit variable declaration etc. user input : {question}, query : {exampleQuery}. and table's data is \n"""
|
| 90 |
for idx, tableName in enumerate(prospectTablesAndCols.keys(), start=1):
|
| 91 |
-
promptForQuery += f"table name is {tableName}, table data is {self.sampleData[tableName][prospectTablesAndCols[tableName]].head(gptSampleRows)}"
|
| 92 |
promptForQuery += f"and table Relations are {TABLE_RELATIONS}"
|
| 93 |
return promptForQuery.replace("\\"," ").replace(" "," ").replace("XXXX", " ")
|
| 94 |
|
|
|
|
| 88 |
question = "top 5 customers who bought most chandeliers in nov 2023"
|
| 89 |
promptForQuery = f"""You are a powerful text to sql model. Answer user input with sql query. And the query needs to run on {platform}. and schemaName is {schemaName}. There is example user input and desired generated sql query. Follow similar patterns as example. eg case insensitive, explicit variable declaration etc. user input : {question}, query : {exampleQuery}. and table's data is \n"""
|
| 90 |
for idx, tableName in enumerate(prospectTablesAndCols.keys(), start=1):
|
| 91 |
+
promptForQuery += f"table name is {tableName}, table data is {self.sampleData[tableName][prospectTablesAndCols[tableName]].head(self.gptSampleRows)}"
|
| 92 |
promptForQuery += f"and table Relations are {TABLE_RELATIONS}"
|
| 93 |
return promptForQuery.replace("\\"," ").replace(" "," ").replace("XXXX", " ")
|
| 94 |
|