database -> db in from_llm (#10667)

**Description:** Renamed argument `database` in
`SQLDatabaseSequentialChain.from_llm()` to `db`,

I realize it's tiny and a bit of a nitpick but for consistency with
SQLDatabaseChain (and all the others actually) I thought it should be
renamed. Also got me while working and using it today.

✔️ Please make sure your PR is passing linting and
testing before submitting. Run `make format`, `make lint` and `make
test` to check this locally.
This commit is contained in:
Hedeer El Showk 2023-09-16 17:26:58 -04:00 committed by GitHub
parent c4e591a57d
commit 9749f8ebae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,15 +242,13 @@ class SQLDatabaseSequentialChain(Chain):
def from_llm(
cls,
llm: BaseLanguageModel,
database: SQLDatabase,
db: SQLDatabase,
query_prompt: BasePromptTemplate = PROMPT,
decider_prompt: BasePromptTemplate = DECIDER_PROMPT,
**kwargs: Any,
) -> SQLDatabaseSequentialChain:
"""Load the necessary chains."""
sql_chain = SQLDatabaseChain.from_llm(
llm, database, prompt=query_prompt, **kwargs
)
sql_chain = SQLDatabaseChain.from_llm(llm, db, prompt=query_prompt, **kwargs)
decider_chain = LLMChain(
llm=llm, prompt=decider_prompt, output_key="table_names"
)