Add a pre rag prompt
Browse files- src/prompts/pre_rag_prompt.py +127 -0
src/prompts/pre_rag_prompt.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
input_text = """You are an assistant that given natural language queries tells me which tables
|
| 2 |
+
are relevant to the query. Here is the schema of the tables of the database.
|
| 3 |
+
|
| 4 |
+
Table "team"
|
| 5 |
+
Stores information about NBA teams.
|
| 6 |
+
Table "team"
|
| 7 |
+
identifier for the team,
|
| 8 |
+
full official name of the team ("Los Angeles Lakers"),
|
| 9 |
+
shortened team name ("LAL"),
|
| 10 |
+
nickname for the team ("Lakers"),
|
| 11 |
+
city where the team is based,
|
| 12 |
+
state where the team is located,
|
| 13 |
+
year the team was established
|
| 14 |
+
);
|
| 15 |
+
|
| 16 |
+
Table "game"
|
| 17 |
+
season identifier, formatted as "2YYYY" ("21970" for the 1970 season)
|
| 18 |
+
identifier of the home team,
|
| 19 |
+
abbreviation of the home team,
|
| 20 |
+
full name of the home team,
|
| 21 |
+
unique identifier for the game,
|
| 22 |
+
date the game was played (YYYY-MM-DD),
|
| 23 |
+
"W" if the home team won, "L" if they lost,
|
| 24 |
+
total minutes played in the game,
|
| 25 |
+
field goals made by the home team,
|
| 26 |
+
field goals attempted by the home team,
|
| 27 |
+
field goal percentage of the home team,
|
| 28 |
+
three-point field goals made by the home team,
|
| 29 |
+
three-point attempts by the home team,
|
| 30 |
+
three-point field goal percentage of the home team,
|
| 31 |
+
free throws made by the home team,
|
| 32 |
+
free throws attempted by the home team,
|
| 33 |
+
free throw percentage of the home team,
|
| 34 |
+
offensive rebounds by the home team,
|
| 35 |
+
defensive rebounds by the home team,
|
| 36 |
+
total rebounds by the home team,
|
| 37 |
+
assists by the home team,
|
| 38 |
+
steals by the home team,
|
| 39 |
+
blocks by the home team,
|
| 40 |
+
turnovers by the home team,
|
| 41 |
+
personal fouls by the home team,,
|
| 42 |
+
total points scored by the home team,
|
| 43 |
+
plus/minus rating for the home team,
|
| 44 |
+
iD of the away team,
|
| 45 |
+
abbreviation of the away team,
|
| 46 |
+
full name of the away team,
|
| 47 |
+
matchup details from the away team’s perspective,
|
| 48 |
+
"W" if the away team won, "L" if they lost,
|
| 49 |
+
field goals made by the away team,
|
| 50 |
+
field goals attempted by the away team,
|
| 51 |
+
field goal percentage of the away team,
|
| 52 |
+
three-point field goals made by the away team,
|
| 53 |
+
three-point attempts by the away team,
|
| 54 |
+
three-point field goal percentage of the away team,
|
| 55 |
+
free throws made by the away team,
|
| 56 |
+
free throws attempted by the away team,
|
| 57 |
+
free throw percentage of the away team,
|
| 58 |
+
offensive rebounds by the away team,
|
| 59 |
+
defensive rebounds by the away team,
|
| 60 |
+
total rebounds by the away team,
|
| 61 |
+
assists by the away team,
|
| 62 |
+
steals by the away team,
|
| 63 |
+
blocks by the away team,
|
| 64 |
+
turnovers by the away team,
|
| 65 |
+
personal fouls by the away team,
|
| 66 |
+
total points scored by the away team,
|
| 67 |
+
plus/minus rating for the away team,
|
| 68 |
+
indicates whether video is available (1 = Yes, 0 = No),
|
| 69 |
+
regular season or playoffs,
|
| 70 |
+
);
|
| 71 |
+
|
| 72 |
+
Table "other_stats"
|
| 73 |
+
Stores additional statistics, linked to the game table via game_id.
|
| 74 |
+
CREATE TABLE IF NOT EXISTS "other_stats" (
|
| 75 |
+
unique game identifier, matches id column from game table
|
| 76 |
+
league identifier
|
| 77 |
+
home team identifier
|
| 78 |
+
home team abbreviation
|
| 79 |
+
home team city
|
| 80 |
+
points in the paint by the home team
|
| 81 |
+
second chance points by the home team
|
| 82 |
+
fast break points by the home team
|
| 83 |
+
largest lead by the home team
|
| 84 |
+
number of lead changes
|
| 85 |
+
number of times the score was tied
|
| 86 |
+
home team turnovers
|
| 87 |
+
total turnovers by the home team
|
| 88 |
+
home team rebounds
|
| 89 |
+
points off turnovers by the home team
|
| 90 |
+
away team identifier
|
| 91 |
+
away team abbreviation
|
| 92 |
+
points in the paint by the away team
|
| 93 |
+
second chance points by the away team
|
| 94 |
+
fast break points by the away team
|
| 95 |
+
largest lead by the away team
|
| 96 |
+
away team turnovers
|
| 97 |
+
total turnovers by the away team
|
| 98 |
+
away team rebounds
|
| 99 |
+
points off turnovers by the away team
|
| 100 |
+
);
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
Generate only the names of the table that are necessary to answer the natural language query, separated by commas, do not output an explanation.
|
| 104 |
+
|
| 105 |
+
for example,
|
| 106 |
+
Response:
|
| 107 |
+
"What is the most points the Los Angeles Lakers have ever scored at home?"
|
| 108 |
+
Response:
|
| 109 |
+
game
|
| 110 |
+
|
| 111 |
+
Response:
|
| 112 |
+
"Which teams are located in the state of California?"
|
| 113 |
+
SQLite:
|
| 114 |
+
team
|
| 115 |
+
|
| 116 |
+
Request:
|
| 117 |
+
"Which team had the highest number of team turnovers in an away game?"
|
| 118 |
+
Response:
|
| 119 |
+
other_stats
|
| 120 |
+
|
| 121 |
+
Request:
|
| 122 |
+
"What was the average number of fastbreak points scored by the Los Angeles Lakers in home wins during the 2020 season?"
|
| 123 |
+
Response:
|
| 124 |
+
game, other_stats
|
| 125 |
+
|
| 126 |
+
Here is the request:
|
| 127 |
+
"""
|