mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-14 17:07:25 +00:00
langchain[patch]: allow to use partial variables in create_sql_query_chain (#22688)
- **Description:** allow to use partial variables to pass `top_k` and `table_info` - **Issue:** no - **Dependencies:** no - **Twitter handle:** @gymnstcs --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
parent
2b5631a6be
commit
3237909221
@ -116,7 +116,9 @@ def create_sql_query_chain(
|
||||
prompt_to_use = SQL_PROMPTS[db.dialect]
|
||||
else:
|
||||
prompt_to_use = PROMPT
|
||||
if {"input", "top_k", "table_info"}.difference(prompt_to_use.input_variables):
|
||||
if {"input", "top_k", "table_info"}.difference(
|
||||
prompt_to_use.input_variables + list(prompt_to_use.partial_variables)
|
||||
):
|
||||
raise ValueError(
|
||||
f"Prompt must have input variables: 'input', 'top_k', "
|
||||
f"'table_info'. Received prompt with input variables: "
|
||||
|
Loading…
Reference in New Issue
Block a user