diff --git a/libs/core/langchain_core/tools/base.py b/libs/core/langchain_core/tools/base.py index 7026a2e8fb1..e28cd2290c6 100644 --- a/libs/core/langchain_core/tools/base.py +++ b/libs/core/langchain_core/tools/base.py @@ -552,6 +552,7 @@ class ChildTool(BaseTool): model_config = ConfigDict( arbitrary_types_allowed=True, + ignored_types=(functools.cached_property,), ) @property @@ -564,7 +565,7 @@ class ChildTool(BaseTool): keys = {k for k in self.args if k != "kwargs"} return len(keys) == 1 - @property + @functools.cached_property def args(self) -> dict: """Get the tool's input arguments schema. @@ -583,7 +584,7 @@ class ChildTool(BaseTool): json_schema = input_schema.model_json_schema() return cast("dict", json_schema["properties"]) - @property + @functools.cached_property def tool_call_schema(self) -> ArgsSchema: """Get the schema for tool calls, excluding injected arguments.