stop making copies of inputs (#15926)

This commit is contained in:
Harrison Chase 2024-01-12 11:49:26 -08:00 committed by GitHub
parent 9fb09c1c30
commit 1afac77439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()