mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 14:49:29 +00:00
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:
parent
c4e591a57d
commit
9749f8ebae
@ -242,15 +242,13 @@ class SQLDatabaseSequentialChain(Chain):
|
|||||||
def from_llm(
|
def from_llm(
|
||||||
cls,
|
cls,
|
||||||
llm: BaseLanguageModel,
|
llm: BaseLanguageModel,
|
||||||
database: SQLDatabase,
|
db: SQLDatabase,
|
||||||
query_prompt: BasePromptTemplate = PROMPT,
|
query_prompt: BasePromptTemplate = PROMPT,
|
||||||
decider_prompt: BasePromptTemplate = DECIDER_PROMPT,
|
decider_prompt: BasePromptTemplate = DECIDER_PROMPT,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> SQLDatabaseSequentialChain:
|
) -> SQLDatabaseSequentialChain:
|
||||||
"""Load the necessary chains."""
|
"""Load the necessary chains."""
|
||||||
sql_chain = SQLDatabaseChain.from_llm(
|
sql_chain = SQLDatabaseChain.from_llm(llm, db, prompt=query_prompt, **kwargs)
|
||||||
llm, database, prompt=query_prompt, **kwargs
|
|
||||||
)
|
|
||||||
decider_chain = LLMChain(
|
decider_chain = LLMChain(
|
||||||
llm=llm, prompt=decider_prompt, output_key="table_names"
|
llm=llm, prompt=decider_prompt, output_key="table_names"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user