Home / Function/ on_tool_error() — langchain Function Reference

on_tool_error() — langchain Function Reference

Architecture documentation for the on_tool_error() function in manager.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f7fd0a02_66f3_0957_eff7_137f2d4e607d["on_tool_error()"]
  4bbdce53_aee3_a4dd_64c9_5813ff30b559["AsyncCallbackManagerForToolRun"]
  f7fd0a02_66f3_0957_eff7_137f2d4e607d -->|defined in| 4bbdce53_aee3_a4dd_64c9_5813ff30b559
  02639266_0981_41cb_ea80_7d68e6d0a8a5["on_tool_error()"]
  02639266_0981_41cb_ea80_7d68e6d0a8a5 -->|calls| f7fd0a02_66f3_0957_eff7_137f2d4e607d
  02639266_0981_41cb_ea80_7d68e6d0a8a5["on_tool_error()"]
  f7fd0a02_66f3_0957_eff7_137f2d4e607d -->|calls| 02639266_0981_41cb_ea80_7d68e6d0a8a5
  3a243d21_72d1_dca9_f7be_acbb482b9f86["ahandle_event()"]
  f7fd0a02_66f3_0957_eff7_137f2d4e607d -->|calls| 3a243d21_72d1_dca9_f7be_acbb482b9f86
  style f7fd0a02_66f3_0957_eff7_137f2d4e607d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/manager.py lines 1149–1172

    async def on_tool_error(
        self,
        error: BaseException,
        **kwargs: Any,
    ) -> None:
        """Run when tool errors.

        Args:
            error: The error.
            **kwargs: Additional keyword arguments.

        """
        if not self.handlers:
            return
        await ahandle_event(
            self.handlers,
            "on_tool_error",
            "ignore_agent",
            error,
            run_id=self.run_id,
            parent_run_id=self.parent_run_id,
            tags=self.tags,
            **kwargs,
        )

Domain

Subdomains

Called By

Frequently Asked Questions

What does on_tool_error() do?
on_tool_error() is a function in the langchain codebase, defined in libs/core/langchain_core/callbacks/manager.py.
Where is on_tool_error() defined?
on_tool_error() is defined in libs/core/langchain_core/callbacks/manager.py at line 1149.
What does on_tool_error() call?
on_tool_error() calls 2 function(s): ahandle_event, on_tool_error.
What calls on_tool_error()?
on_tool_error() is called by 1 function(s): on_tool_error.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free