Skip to content

Commit

Permalink
Minor prompt adjustment n version update #4
Browse files Browse the repository at this point in the history
  • Loading branch information
pramitchoudhary committed Oct 21, 2023
1 parent fd48350 commit 405991a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions about.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

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

**Last Updated:** September, 2023
**Last Updated:** October, 2023

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

**Detailed Description:**
An experimental demo to evaluate text-to-SQL capabilities of large language models (LLMs) to enable QnA for tabular data
An experimental demo to evaluate text-to-SQL capabilities of large language models (LLMs) to enable QnA for structured data.
6 changes: 3 additions & 3 deletions sidekick/configs/prompt_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}

NSQL_QUERY_PROMPT = """
For SQL TABLE '{table_name}' sample question/answer pairs,\n({sample_queries})
For SQL TABLE '{table_name}' with sample question/answer pairs,\n({sample_queries})
CREATE TABLE '{table_name}'({column_info}
)
Expand All @@ -86,8 +86,9 @@
- **Deliberately go through the question and database schema word by word** to appropriately answer the question
- **Use Table Aliases** to prevent ambiguity. For example, `SELECT table1.col1, table2.col1 FROM table1 JOIN table2 ON table1.id = table2.id`.
- Only use supplied table names: **{table_name}** for generation
- Only use column names from the CREATE TABLE statement: **{column_info}** for generation
- When creating a ratio, always cast the numerator as float
- Use COUNT(1) instead of COUNT(*)
- Always use COUNT(1) instead of COUNT(*)
- If the question is asking for a rate, use COUNT to compute percentage
- Avoid overly complex SQL queries
- Avoid using the WITH statement
Expand All @@ -97,7 +98,6 @@
- If JSONB format found in Table schema, do pattern matching on keywords from the question and use SQL functions such as ->> or ->
### Input:
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}.
This query will run on a database whose schema is represented in this string:
Expand Down
2 changes: 1 addition & 1 deletion ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def chat(q: Q):
ui.form_card(
box="horizontal",
items=[
ui.text("Ask your questions:"),
ui.text("Ask Questions:"),
ui.inline(items=[ui.toggle(name="demo_mode", label="Demo", trigger=True)], justify="end"),
],
),
Expand Down

0 comments on commit 405991a

Please sign in to comment.