Skip to content

Commit

Permalink
core: make sure tool input keys won't be modified during following pr…
Browse files Browse the repository at this point in the history
…ocess, to prevent problems when there's no args schema.
  • Loading branch information
JetDrag committed Nov 2, 2024
1 parent 3b0b7cf commit 0c436b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/core/langchain_core/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ def _parse_input(self, tool_input: Union[str, dict]) -> Union[str, dict[str, Any
for k, v in result_dict.items()
if k in tool_input
}
# make sure tool input keys won't be modified during following process
tool_input.copy()
return tool_input

@model_validator(mode="before")
Expand Down

0 comments on commit 0c436b2

Please sign in to comment.