From 1afac774393a6a44812140e1055713e80f1c4fb0 Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Fri, 12 Jan 2024 11:49:26 -0800 Subject: [PATCH] stop making copies of inputs (#15926) --- libs/core/langchain_core/tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/core/langchain_core/tools.py b/libs/core/langchain_core/tools.py index e13e641d7cd..50cf500b93b 100644 --- a/libs/core/langchain_core/tools.py +++ b/libs/core/langchain_core/tools.py @@ -248,7 +248,11 @@ class ChildTool(BaseTool): else: if input_args is not None: result = input_args.parse_obj(tool_input) - return {k: v for k, v in result.dict().items() if k in tool_input} + return { + k: getattr(result, k) + for k, v in result.dict().items() + if k in tool_input + } return tool_input @root_validator()