Home / Function/ on_tool_end() — langchain Function Reference

on_tool_end() — langchain Function Reference

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

Function python Observability Tracers calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  7bd5eb03_6d13_dcf0_56f3_cb5d1f0ce44d["on_tool_end()"]
  b3ab8001_c14c_4191_ca53_2dbabc99917f["AsyncBaseTracer"]
  7bd5eb03_6d13_dcf0_56f3_cb5d1f0ce44d -->|defined in| b3ab8001_c14c_4191_ca53_2dbabc99917f
  3c301f83_2f92_47da_cfb1_097c993f88fb["on_tool_end()"]
  3c301f83_2f92_47da_cfb1_097c993f88fb -->|calls| 7bd5eb03_6d13_dcf0_56f3_cb5d1f0ce44d
  a962822f_f5be_755c_cef6_a8eeb2b06eb5["_end_trace()"]
  7bd5eb03_6d13_dcf0_56f3_cb5d1f0ce44d -->|calls| a962822f_f5be_755c_cef6_a8eeb2b06eb5
  389d2c9d_1f7b_6f21_5827_0f636aa0e114["_on_tool_end()"]
  7bd5eb03_6d13_dcf0_56f3_cb5d1f0ce44d -->|calls| 389d2c9d_1f7b_6f21_5827_0f636aa0e114
  3c301f83_2f92_47da_cfb1_097c993f88fb["on_tool_end()"]
  7bd5eb03_6d13_dcf0_56f3_cb5d1f0ce44d -->|calls| 3c301f83_2f92_47da_cfb1_097c993f88fb
  style 7bd5eb03_6d13_dcf0_56f3_cb5d1f0ce44d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/base.py lines 771–783

    async def on_tool_end(
        self,
        output: Any,
        *,
        run_id: UUID,
        **kwargs: Any,
    ) -> None:
        tool_run = self._complete_tool_run(
            output=output,
            run_id=run_id,
        )
        tasks = [self._end_trace(tool_run), self._on_tool_end(tool_run)]
        await asyncio.gather(*tasks)

Domain

Subdomains

Called By

Frequently Asked Questions

What does on_tool_end() do?
on_tool_end() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/base.py.
Where is on_tool_end() defined?
on_tool_end() is defined in libs/core/langchain_core/tracers/base.py at line 771.
What does on_tool_end() call?
on_tool_end() calls 3 function(s): _end_trace, _on_tool_end, on_tool_end.
What calls on_tool_end()?
on_tool_end() is called by 1 function(s): on_tool_end.

Analyze Your Own Codebase

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

Try Supermodel Free