Skip to content

Commit

Permalink
stop making copies of inputs (langchain-ai#15926)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchase17 committed Jan 12, 2024
1 parent 9fb09c1 commit 1afac77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/core/langchain_core/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ def _parse_input(
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()
Expand Down

0 comments on commit 1afac77

Please sign in to comment.