Skip to content

Commit

Permalink
core[patch]: fix duplicated kwargs in _load_sql_databse_chain (lang…
Browse files Browse the repository at this point in the history
…chain-ai#19908)

`kwargs` is specified twice in [this
line](https://github.com/langchain-ai/langchain/blame/3218463f6a3d841905648971735949a14a16e191/libs/langchain/langchain/chains/loading.py#L386),
causing runtime error when passing any keyword arguments.
  • Loading branch information
B-Step62 authored and junkeon committed Apr 16, 2024
1 parent 34fa514 commit 3ccf4ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/langchain/langchain/chains/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def _load_sql_database_chain(config: dict, **kwargs: Any) -> Any:
raise ValueError("`database` must be present.")
if "llm_chain" in config:
llm_chain_config = config.pop("llm_chain")
chain = load_chain_from_config(llm_chain_config, **kwargs, **kwargs)
chain = load_chain_from_config(llm_chain_config, **kwargs)
return SQLDatabaseChain(llm_chain=chain, database=database, **config)
if "llm" in config:
llm_config = config.pop("llm")
Expand Down

0 comments on commit 3ccf4ff

Please sign in to comment.