Skip to content

Commit

Permalink
DH-5027/reordering the instructions (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadrezaPourreza authored Nov 22, 2023
1 parent 2e451c5 commit 9e6ad59
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions dataherald/utils/agent_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
""" # noqa: E501

PLAN_WITH_FEWSHOT_EXAMPLES_AND_INSTRUCTIONS = """1) Use the fewshot_examples_retriever tool to retrieve a first set of possibly relevant tables and columns and the SQL syntax to use.
2) Use the db_tables_with_relevance_scores tool to find the a second set of possibly relevant tables.
3) Use the db_relevant_tables_schema tool to obtain the schema of the both sets of possibly relevant tables to identify the possibly relevant columns.
4) Use the db_relevant_columns_info tool to gather more information about the possibly relevant columns, filtering them to find the relevant ones.
5) [Optional based on the question] Use the system_time tool if the question has any mentions of time or dates.
6) [Optional based on the question] Always use the db_column_entity_checker tool to make sure that relevant columns have the cell-values.
7) Use the get_admin_instructions tool to retrieve the DB admin instructions before generating the SQL query.
2) Use the get_admin_instructions tool to retrieve the DB admin instructions before calling ant other tools, to make sure you follow the instructions when writing the SQL query.
3) Use the db_tables_with_relevance_scores tool to find the a second set of possibly relevant tables.
4) Use the db_relevant_tables_schema tool to obtain the schema of the both sets of possibly relevant tables to identify the possibly relevant columns.
5) Use the db_relevant_columns_info tool to gather more information about the possibly relevant columns, filtering them to find the relevant ones.
6) [Optional based on the question] Use the system_time tool if the question has any mentions of time or dates.
7) [Optional based on the question] Always use the db_column_entity_checker tool to make sure that relevant columns have the cell-values.
8) Write a {dialect} query and use sql_db_query tool the Execute the SQL query on the database to obtain the results.
#
Some tips to always keep in mind:
Expand All @@ -30,11 +30,11 @@
""" # noqa: E501

PLAN_WITH_INSTRUCTIONS = """1) Use the db_tables_with_relevance_scores tool to find the a set of possibly relevant tables.
2) Use the get_admin_instructions tool to retrieve the DB admin instructions before calling ant other tools, to make sure you follow the instructions when writing the SQL query.
2) Use the db_relevant_tables_schema tool to obtain the schema of possibly relevant tables to identify the possibly relevant columns.
3) Use the db_relevant_columns_info tool to gather more information about the possibly relevant columns, filtering them to find the relevant ones.
4) [Optional based on the question] Use the system_time tool if the question has any mentions of time or dates.
5) [Optional based on the question] Always use the db_column_entity_checker tool to make sure that relevant columns have the cell-values.
6) Use the get_admin_instructions tool to retrieve the DB admin instructions before generating the SQL query.
4) Use the db_relevant_columns_info tool to gather more information about the possibly relevant columns, filtering them to find the relevant ones.
5) [Optional based on the question] Use the system_time tool if the question has any mentions of time or dates.
6) [Optional based on the question] Always use the db_column_entity_checker tool to make sure that relevant columns have the cell-values.
7) Write a {dialect} query and use sql_db_query tool the Execute the SQL query on the database to obtain the results.
#
Some tips to always keep in mind:
Expand Down

0 comments on commit 9e6ad59

Please sign in to comment.