Skip to content

Commit ac954a6

Browse files
Basic prompt structure for Starcoder2 #4
1 parent 3bd2318 commit ac954a6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

sidekick/configs/prompt_template.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,26 @@
7676
-- Using reference for TABLES '{table_name}' {context}; {question_txt}?
7777
7878
SELECT"""
79+
80+
# https://colab.research.google.com/drive/13BIKsqHnPOBcQ-ba2p77L5saiepTIwu0#scrollTo=0eI-VpCkf-fN
81+
STARCODER2_PROMPT = """
82+
### Instructions:
83+
Your task is convert a question into a SQL query, given a sqlite database schema.
84+
Adhere to these rules:
85+
- **Deliberately go through the question and database schema word by word** to appropriately answer the question
86+
- **Use Table Aliases** to prevent ambiguity. For example, `SELECT table1.col1, table2.col1 FROM table1 JOIN table2 ON table1.id = table2.id`.
87+
- When creating a ratio, always cast the numerator as float
88+
89+
### Input:
90+
Generate a SQL query that answers the question `{question}`.
91+
For SQL TABLE '{table_name}' sample question/answer pairs,\n({sample_queries})
92+
This query will run on a database whose schema is represented in this string:
93+
CREATE TABLE '{table_name}' ({column_info}
94+
);
95+
96+
-- Table '{table_name}' has sample values ({data_info_detailed})
97+
98+
### Response:
99+
Based on your instructions, here is the SQL query I have generated to answer the question `{question}`:
100+
```sql
101+
SELECT"""

0 commit comments

Comments
 (0)