Skip to content

Commit 405991a

Browse files
Minor prompt adjustment n version update #4
1 parent fd48350 commit 405991a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
**Actively Being Maintained:** Yes (Demo release: _In active RnD_)
66

7-
**Last Updated:** September, 2023
7+
**Last Updated:** October, 2023
88

99
**Allows uploading and using new model and data:** Yes
1010

1111
**Detailed Description:**
12-
An experimental demo to evaluate text-to-SQL capabilities of large language models (LLMs) to enable QnA for tabular data
12+
An experimental demo to evaluate text-to-SQL capabilities of large language models (LLMs) to enable QnA for structured data.

sidekick/configs/prompt_template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
}
6262

6363
NSQL_QUERY_PROMPT = """
64-
For SQL TABLE '{table_name}' sample question/answer pairs,\n({sample_queries})
64+
For SQL TABLE '{table_name}' with sample question/answer pairs,\n({sample_queries})
6565
6666
CREATE TABLE '{table_name}'({column_info}
6767
)
@@ -86,8 +86,9 @@
8686
- **Deliberately go through the question and database schema word by word** to appropriately answer the question
8787
- **Use Table Aliases** to prevent ambiguity. For example, `SELECT table1.col1, table2.col1 FROM table1 JOIN table2 ON table1.id = table2.id`.
8888
- Only use supplied table names: **{table_name}** for generation
89+
- Only use column names from the CREATE TABLE statement: **{column_info}** for generation
8990
- When creating a ratio, always cast the numerator as float
90-
- Use COUNT(1) instead of COUNT(*)
91+
- Always use COUNT(1) instead of COUNT(*)
9192
- If the question is asking for a rate, use COUNT to compute percentage
9293
- Avoid overly complex SQL queries
9394
- Avoid using the WITH statement
@@ -97,7 +98,6 @@
9798
- If JSONB format found in Table schema, do pattern matching on keywords from the question and use SQL functions such as ->> or ->
9899
99100
100-
101101
### Input:
102102
For SQL TABLE '{table_name}' with sample question/answer pairs,\n({sample_queries}), create a SQL (dialect:SQLite) query to answer the following question:\n{question_txt}.
103103
This query will run on a database whose schema is represented in this string:

ui/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async def chat(q: Q):
119119
ui.form_card(
120120
box="horizontal",
121121
items=[
122-
ui.text("Ask your questions:"),
122+
ui.text("Ask Questions:"),
123123
ui.inline(items=[ui.toggle(name="demo_mode", label="Demo", trigger=True)], justify="end"),
124124
],
125125
),

0 commit comments

Comments
 (0)