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>
dynamic_agent_tools
Chandan Routray 1 year ago committed by GitHub
parent 08876ad066
commit 11341fcecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -130,7 +130,7 @@ class SQLDatabaseChain(Chain):
template=QUERY_CHECKER, input_variables=["query", "dialect"]
)
query_checker_chain = LLMChain(
llm=self.llm, prompt=query_checker_prompt
llm=self.llm_chain.llm, prompt=query_checker_prompt
)
query_checker_inputs = {
"query": sql_cmd,

Loading…
Cancel
Save