mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 07:09:31 +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,
|
**kwargs,
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
args, kwargs = _to_args_and_kwargs(tool_input)
|
tool_args, tool_kwargs = _to_args_and_kwargs(tool_input)
|
||||||
observation = self._run(*args, **kwargs)
|
observation = self._run(*tool_args, **tool_kwargs)
|
||||||
except (Exception, KeyboardInterrupt) as e:
|
except (Exception, KeyboardInterrupt) as e:
|
||||||
self.callback_manager.on_tool_error(e, verbose=verbose_)
|
self.callback_manager.on_tool_error(e, verbose=verbose_)
|
||||||
raise e
|
raise e
|
||||||
|
Loading…
Reference in New Issue
Block a user