-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unreverse prompts and introduce relevance option (not hardcoded) (#28)
Motivation and Context (Why the change? What's the scenario?) Prompts got shuffled up in all the code moves. Customers changing relevancy setting as they experiment with sandbox High level description (Approach, Design) Unreverse prompts Make relevancy a configurable option (not hardcoded): MinSchemaRelevance
- Loading branch information
Showing
8 changed files
with
73 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 53 additions & 5 deletions
58
examples/200-dotnet-nl2sql/nl2sql.config/nl2sql/generatequery/skprompt.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,59 @@ | ||
If the requested OBJECTIVE can be answered by querying a database with tables described in SCHEMA, ANSWER: YES. | ||
Otherwise ANSWER: NO. | ||
Generate a SQL SELECT query that is compatible with {{$data_platform}} and achieves the OBJECTIVE exclusively using only the tables and views described in "SCHEMA:". | ||
|
||
Do not answer with any other word than YES or NO. | ||
Only generate SQL if the OBJECTIVE can be answered by querying a database with tables described in SCHEMA. | ||
|
||
Do not include any explanations, only provide valid SQL. | ||
|
||
[BEGIN EXAMPLE] | ||
|
||
SCHEMA: | ||
description: historical record of concerts, stadiums and singers | ||
tables: | ||
- stadium: | ||
columns: | ||
*: all columns | ||
Stadium_ID: | ||
Location: | ||
Name: | ||
Capacity: | ||
Highest: | ||
Lowest: | ||
Average: | ||
- singer: | ||
columns: | ||
*: all columns | ||
Singer_ID: | ||
Name: | ||
Country: | ||
Song_Name: | ||
Song_release_year: | ||
Age: | ||
Is_male: | ||
- concert: | ||
columns: | ||
*: all columns | ||
concert_ID: | ||
concert_Name: | ||
Theme: | ||
Stadium_ID: | ||
Year: | ||
- singer_in_concert: | ||
columns: | ||
*: all columns | ||
concert_ID: | ||
Singer_ID: | ||
references: | ||
concert.Stadium_ID: stadium.Stadium_ID | ||
singer_in_concert.concert_ID: concert.concert_ID | ||
singer_in_concert.Singer_ID: singer.Singer_ID | ||
|
||
OBJECTIVE: "How many heads of the departments are older than 56 ?" | ||
SQL: select count(*) department_head_count from head where age > 56 | ||
|
||
[END EXAMPLE] | ||
|
||
SCHEMA: | ||
{{$data_schema}} | ||
|
||
OBJECTIVE: {{$data_objective}} | ||
|
||
ANSWER: Let's think step by step. | ||
SQL: Let's think step by step. |
58 changes: 5 additions & 53 deletions
58
examples/200-dotnet-nl2sql/nl2sql.config/nl2sql/isquery/skprompt.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,11 @@ | ||
Generate a SQL SELECT query that is compatible with {{$data_platform}} and achieves the OBJECTIVE exclusively using only the tables and views described in "SCHEMA:". | ||
If the requested OBJECTIVE can be answered by querying a database with tables described in SCHEMA, ANSWER: YES. | ||
Otherwise ANSWER: NO. | ||
|
||
Only generate SQL if the OBJECTIVE can be answered by querying a database with tables described in SCHEMA. | ||
|
||
Do not include any explanations, only provide valid SQL. | ||
|
||
[BEGIN EXAMPLE] | ||
|
||
SCHEMA: | ||
description: historical record of concerts, stadiums and singers | ||
tables: | ||
- stadium: | ||
columns: | ||
*: all columns | ||
Stadium_ID: | ||
Location: | ||
Name: | ||
Capacity: | ||
Highest: | ||
Lowest: | ||
Average: | ||
- singer: | ||
columns: | ||
*: all columns | ||
Singer_ID: | ||
Name: | ||
Country: | ||
Song_Name: | ||
Song_release_year: | ||
Age: | ||
Is_male: | ||
- concert: | ||
columns: | ||
*: all columns | ||
concert_ID: | ||
concert_Name: | ||
Theme: | ||
Stadium_ID: | ||
Year: | ||
- singer_in_concert: | ||
columns: | ||
*: all columns | ||
concert_ID: | ||
Singer_ID: | ||
references: | ||
concert.Stadium_ID: stadium.Stadium_ID | ||
singer_in_concert.concert_ID: concert.concert_ID | ||
singer_in_concert.Singer_ID: singer.Singer_ID | ||
|
||
OBJECTIVE: "How many heads of the departments are older than 56 ?" | ||
SQL: select count(*) department_head_count from head where age > 56 | ||
|
||
[END EXAMPLE] | ||
Do not answer with any other word than YES or NO. | ||
|
||
SCHEMA: | ||
{{$data_schema}} | ||
|
||
OBJECTIVE: {{$data_objective}} | ||
SQL: Let's think step by step. | ||
|
||
ANSWER: Let's think step by step. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters