Skip to content

Commit

Permalink
feat: encourage ai to explain query
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 4, 2024
1 parent 0eca7d6 commit 8592084
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion rust/wasm-binding/src/rpc_proto_prompt_functions_generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ Additional metadata for {{ reference.model_name }}:
{% endfor %}
Provide the SQL query that would retrieve the data based on the natural language request. The SQL query should be valid for the database type {{ database_type }}.
Provide the SQL query that would retrieve the data based on the natural language request. In addition to generating the SQL code,
please provide a brief explanation of the query. The SQL query should be valid for the database type {{ database_type }}.
The provided tables are available in the `q.` schema. To access tehm use the `q.` prefix, for example `q.table_name`.
A few general rules about the SQL queries you generate:
- Use the `q.` prefix to access the tables.
- The output must be a SELECT statement.
- The output must be a valid SQL query for the database type {{ database_type }}.
- Prefer CTEs over subqueries.
- In SELECT statements where you join two tables, when referring to columns, use the table alias.
- Prefer JOINs over subqueries.
- Use aliases for columns where the name is not clear or ambiguous, like on aggregate functions.
"#;

0 comments on commit 8592084

Please sign in to comment.