mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-05 14:43:08 +00:00
Fixed query checker for SQLDatabaseChain (#4780)
# Fixed query checker for SQLDatabaseChain When `SQLDatabaseChain`'s llm attribute was deprecated, the query checker stopped working if `SQLDatabaseChain` is initialised via `from_llm` method. With this fix, `SQLDatabaseChain`'s query checker would use the same `llm` as used in the `llm_chain` ## Who can review? @hwchase17 - project lead Co-authored-by: imeckr <chandanroutray2012@gmail.com>
This commit is contained in:
parent
08876ad066
commit
11341fcecb
@ -130,7 +130,7 @@ class SQLDatabaseChain(Chain):
|
|||||||
template=QUERY_CHECKER, input_variables=["query", "dialect"]
|
template=QUERY_CHECKER, input_variables=["query", "dialect"]
|
||||||
)
|
)
|
||||||
query_checker_chain = LLMChain(
|
query_checker_chain = LLMChain(
|
||||||
llm=self.llm, prompt=query_checker_prompt
|
llm=self.llm_chain.llm, prompt=query_checker_prompt
|
||||||
)
|
)
|
||||||
query_checker_inputs = {
|
query_checker_inputs = {
|
||||||
"query": sql_cmd,
|
"query": sql_cmd,
|
||||||
|
Loading…
Reference in New Issue
Block a user