_prep_run_args,tool_input copy

This commit is contained in:
xzq.xu 2025-03-26 22:56:32 +08:00
parent e90abce577
commit 3382b0d8ea

View File

@ -837,8 +837,6 @@ class ChildTool(BaseTool):
self._run if self.__class__._arun is BaseTool._arun else self._arun
)
if signature(func_to_check).parameters.get("run_manager"):
import copy
tool_kwargs = copy.deepcopy(tool_kwargs)
tool_kwargs["run_manager"] = run_manager
if config_param := _get_runnable_config_param(func_to_check):
tool_kwargs[config_param] = config
@ -947,7 +945,7 @@ def _prep_run_args(
tool_input: Union[str, dict] = cast(ToolCall, input)["args"].copy()
else:
tool_call_id = None
tool_input = cast(Union[str, dict], input)
tool_input = cast(Union[str, dict], input).copy()
return (
tool_input,
dict(