Skip to content

Commit

Permalink
Enhance the prompt to make the LLM generate right date for real today (
Browse files Browse the repository at this point in the history
…langchain-ai#4505)

# Enhance the prompt to make the LLM generate right date for real today

Fixes # (issue)

Currently, if the user's question contains `today`, the clickhouse
always points to an old date. This may be related to the fact that the
GPT training data is relatively old.
  • Loading branch information
yanghua committed May 12, 2023
1 parent e942db3 commit 25cd6e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions langchain/chains/sql_database/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
Unless the user specifies in the question a specific number of examples to obtain, query for at most {top_k} results using the LIMIT clause as per ClickHouse. You can order the results to return the most informative data in the database.
Never query for all columns from a table. You must query only the columns that are needed to answer the question. Wrap each column name in double quotes (") to denote them as delimited identifiers.
Pay attention to use only the column names you can see in the tables below. Be careful to not query for columns that do not exist. Also, pay attention to which column is in which table.
Pay attention to use today() function to get the current date, if the question involves "today".
Use the following format:
Expand Down

0 comments on commit 25cd6e0

Please sign in to comment.