Skip to content

Commit

Permalink
Update the prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadrezaPourreza committed Nov 16, 2023
1 parent 372f93d commit e374359
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dataherald/sql_generator/dataherald_finetuning_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def create_sql_agent(
**kwargs: Dict[str, Any],
) -> AgentExecutor:
tools = toolkit.get_tools()
prefix = prefix.format(dialect=toolkit.dialect)
prefix = prefix.format(dialect=toolkit.dialect, admin_instructions=toolkit.instructions)
prompt = ZeroShotAgent.create_prompt(
tools,
prefix=prefix,
Expand Down
4 changes: 4 additions & 0 deletions dataherald/utils/agent_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
Using `current_date()` or `current_datetime()` in SQL queries is banned, use system_time tool to get the exact time of the query execution.
If running the SQL query results in an error, rewrite the SQL query and try again. You can use db_schema tool to get the schema of the database.
only rewrite the query when the execution returned an error.
Only rely on generate_sql tool to generate the SQL query.
If the question does not seem related to the database, explain why you cannot answer the question.
Here are the database admin instructions, that all queries must follow:
{admin_instructions}
""" # noqa: E501

0 comments on commit e374359

Please sign in to comment.