mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Prevent kwargs
from being overwritten (#3158)
Fixes #3157. Prevents `kwargs` from being overwritten by `_to_args_and_kwargs()` and sending the wrong `kwargs` in line 109.
This commit is contained in:
parent
126d7f11dd
commit
0b542661b4
@ -100,8 +100,8 @@ class BaseTool(ABC, BaseModel):
|
||||
**kwargs,
|
||||
)
|
||||
try:
|
||||
args, kwargs = _to_args_and_kwargs(tool_input)
|
||||
observation = self._run(*args, **kwargs)
|
||||
tool_args, tool_kwargs = _to_args_and_kwargs(tool_input)
|
||||
observation = self._run(*tool_args, **tool_kwargs)
|
||||
except (Exception, KeyboardInterrupt) as e:
|
||||
self.callback_manager.on_tool_error(e, verbose=verbose_)
|
||||
raise e
|
||||
|
Loading…
Reference in New Issue
Block a user