Home / Function/ on_tool_start() — langchain Function Reference

on_tool_start() — langchain Function Reference

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

Function python Observability Tracers calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  af854144_a34e_e08b_b43a_58573b084ed6["on_tool_start()"]
  b3ab8001_c14c_4191_ca53_2dbabc99917f["AsyncBaseTracer"]
  af854144_a34e_e08b_b43a_58573b084ed6 -->|defined in| b3ab8001_c14c_4191_ca53_2dbabc99917f
  6960ac87_9904_f051_9a03_c1f72b80f78d["on_tool_start()"]
  6960ac87_9904_f051_9a03_c1f72b80f78d -->|calls| af854144_a34e_e08b_b43a_58573b084ed6
  6f36dacc_adf3_1223_4aff_3ae256a05ed8["_start_trace()"]
  af854144_a34e_e08b_b43a_58573b084ed6 -->|calls| 6f36dacc_adf3_1223_4aff_3ae256a05ed8
  06193a20_5e97_3a0b_9bc5_248b90e7cb0d["_on_tool_start()"]
  af854144_a34e_e08b_b43a_58573b084ed6 -->|calls| 06193a20_5e97_3a0b_9bc5_248b90e7cb0d
  6960ac87_9904_f051_9a03_c1f72b80f78d["on_tool_start()"]
  af854144_a34e_e08b_b43a_58573b084ed6 -->|calls| 6960ac87_9904_f051_9a03_c1f72b80f78d
  style af854144_a34e_e08b_b43a_58573b084ed6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/base.py lines 744–768

    async def on_tool_start(
        self,
        serialized: dict[str, Any],
        input_str: str,
        *,
        run_id: UUID,
        tags: list[str] | None = None,
        parent_run_id: UUID | None = None,
        metadata: dict[str, Any] | None = None,
        name: str | None = None,
        inputs: dict[str, Any] | None = None,
        **kwargs: Any,
    ) -> None:
        tool_run = self._create_tool_run(
            serialized=serialized,
            input_str=input_str,
            run_id=run_id,
            tags=tags,
            parent_run_id=parent_run_id,
            metadata=metadata,
            inputs=inputs,
            **kwargs,
        )
        tasks = [self._start_trace(tool_run), self._on_tool_start(tool_run)]
        await asyncio.gather(*tasks)

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free