Home / Function/ on_tool_start() — langchain Function Reference

on_tool_start() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d42476ff_6b17_148a_8f54_3942b7d71a6e["on_tool_start()"]
  32dafc1f_47b3_ccf8_3012_9602da6cebe3["CallbackHandlerWithInputCapture"]
  d42476ff_6b17_148a_8f54_3942b7d71a6e -->|defined in| 32dafc1f_47b3_ccf8_3012_9602da6cebe3
  6e8e2bcc_e323_48a9_ae97_c42e87df1432["on_tool_start()"]
  6e8e2bcc_e323_48a9_ae97_c42e87df1432 -->|calls| d42476ff_6b17_148a_8f54_3942b7d71a6e
  6e8e2bcc_e323_48a9_ae97_c42e87df1432["on_tool_start()"]
  d42476ff_6b17_148a_8f54_3942b7d71a6e -->|calls| 6e8e2bcc_e323_48a9_ae97_c42e87df1432
  style d42476ff_6b17_148a_8f54_3942b7d71a6e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_tools.py lines 2968–2991

    def on_tool_start(
        self,
        serialized: dict[str, Any],
        input_str: str,
        *,
        run_id: Any,
        parent_run_id: Any | None = None,
        tags: list[str] | None = None,
        metadata: dict[str, Any] | None = None,
        inputs: dict[str, Any] | None = None,
        **kwargs: Any,
    ) -> Any:
        """Capture the inputs passed to on_tool_start."""
        self.captured_inputs.append(inputs)
        return super().on_tool_start(
            serialized,
            input_str,
            run_id=run_id,
            parent_run_id=parent_run_id,
            tags=tags,
            metadata=metadata,
            inputs=inputs,
            **kwargs,
        )

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/tests/unit_tests/test_tools.py.
Where is on_tool_start() defined?
on_tool_start() is defined in libs/core/tests/unit_tests/test_tools.py at line 2968.
What does on_tool_start() call?
on_tool_start() calls 1 function(s): 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