Skip to content

Commit 4c79100

Browse files
Correct prompt typo + update example for SQLDatabaseChain (#868)
See #821
1 parent 777aaff commit 4c79100

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/modules/chains/examples/sqlite.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@
5656
"llm = OpenAI(temperature=0)"
5757
]
5858
},
59+
{
60+
"attachments": {},
61+
"cell_type": "markdown",
62+
"id": "3d1e692e",
63+
"metadata": {},
64+
"source": [
65+
"**NOTE:** For data-sensitive projects, you can specify `return_direct=True` in the `SQLDatabaseChain` initialization to directly return the output of the SQL query without any additional formatting. This prevents the LLM from seeing any contents within the database. Note, however, the LLM still has access to the database scheme (i.e. dialect, table and key names) by default."
66+
]
67+
},
5968
{
6069
"cell_type": "code",
6170
"execution_count": 3,

langchain/chains/sql_database/prompt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
template=_DEFAULT_TEMPLATE,
2727
)
2828

29-
_DECIDER_TEMPLATE = """Given the below input question and list of potential tables, output a comma separated list of the table names that may be neccessary to answer this question.
29+
_DECIDER_TEMPLATE = """Given the below input question and list of potential tables, output a comma separated list of the table names that may be necessary to answer this question.
3030
3131
Question: {query}
3232

0 commit comments

Comments
 (0)