Home / Function/ on_tool_error() — langchain Function Reference

on_tool_error() — langchain Function Reference

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

Function python Observability Tracers calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  f8eb0e19_0f22_c54c_2715_ebbd3aa1cb00["on_tool_error()"]
  b3ab8001_c14c_4191_ca53_2dbabc99917f["AsyncBaseTracer"]
  f8eb0e19_0f22_c54c_2715_ebbd3aa1cb00 -->|defined in| b3ab8001_c14c_4191_ca53_2dbabc99917f
  7b1515cd_3108_e749_226d_30eb77f926e0["on_tool_error()"]
  7b1515cd_3108_e749_226d_30eb77f926e0 -->|calls| f8eb0e19_0f22_c54c_2715_ebbd3aa1cb00
  a962822f_f5be_755c_cef6_a8eeb2b06eb5["_end_trace()"]
  f8eb0e19_0f22_c54c_2715_ebbd3aa1cb00 -->|calls| a962822f_f5be_755c_cef6_a8eeb2b06eb5
  9a70c96e_33ef_9783_8499_a59cc28d833f["_on_tool_error()"]
  f8eb0e19_0f22_c54c_2715_ebbd3aa1cb00 -->|calls| 9a70c96e_33ef_9783_8499_a59cc28d833f
  7b1515cd_3108_e749_226d_30eb77f926e0["on_tool_error()"]
  f8eb0e19_0f22_c54c_2715_ebbd3aa1cb00 -->|calls| 7b1515cd_3108_e749_226d_30eb77f926e0
  style f8eb0e19_0f22_c54c_2715_ebbd3aa1cb00 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/base.py lines 786–800

    async def on_tool_error(
        self,
        error: BaseException,
        *,
        run_id: UUID,
        parent_run_id: UUID | None = None,
        tags: list[str] | None = None,
        **kwargs: Any,
    ) -> None:
        tool_run = self._errored_tool_run(
            error=error,
            run_id=run_id,
        )
        tasks = [self._end_trace(tool_run), self._on_tool_error(tool_run)]
        await asyncio.gather(*tasks)

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/tracers/base.py.
Where is on_tool_error() defined?
on_tool_error() is defined in libs/core/langchain_core/tracers/base.py at line 786.
What does on_tool_error() call?
on_tool_error() calls 3 function(s): _end_trace, _on_tool_error, 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