on_tool_start() — langchain Function Reference
Architecture documentation for the on_tool_start() function in manager.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 99e09f49_82fe_9b97_1a99_8b1db9974286["on_tool_start()"] 90ea8982_7d84_5e8f_4b5a_533f89fc7211["AsyncCallbackManager"] 99e09f49_82fe_9b97_1a99_8b1db9974286 -->|defined in| 90ea8982_7d84_5e8f_4b5a_533f89fc7211 a1fd3036_7b39_dbeb_ea97_f32d5d9822b0["on_tool_start()"] a1fd3036_7b39_dbeb_ea97_f32d5d9822b0 -->|calls| 99e09f49_82fe_9b97_1a99_8b1db9974286 a1fd3036_7b39_dbeb_ea97_f32d5d9822b0["on_tool_start()"] 99e09f49_82fe_9b97_1a99_8b1db9974286 -->|calls| a1fd3036_7b39_dbeb_ea97_f32d5d9822b0 3a243d21_72d1_dca9_f7be_acbb482b9f86["ahandle_event()"] 99e09f49_82fe_9b97_1a99_8b1db9974286 -->|calls| 3a243d21_72d1_dca9_f7be_acbb482b9f86 style 99e09f49_82fe_9b97_1a99_8b1db9974286 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/callbacks/manager.py lines 1990–2035
async def on_tool_start(
self,
serialized: dict[str, Any] | None,
input_str: str,
run_id: UUID | None = None,
parent_run_id: UUID | None = None,
**kwargs: Any,
) -> AsyncCallbackManagerForToolRun:
"""Run when the tool starts running.
Args:
serialized: The serialized tool.
input_str: The input to the tool.
run_id: The ID of the run.
parent_run_id: The ID of the parent run.
**kwargs: Additional keyword arguments.
Returns:
The async callback manager for the tool run.
"""
if run_id is None:
run_id = uuid7()
await ahandle_event(
self.handlers,
"on_tool_start",
"ignore_agent",
serialized,
input_str,
run_id=run_id,
parent_run_id=self.parent_run_id,
tags=self.tags,
metadata=self.metadata,
**kwargs,
)
return AsyncCallbackManagerForToolRun(
run_id=run_id,
handlers=self.handlers,
inheritable_handlers=self.inheritable_handlers,
parent_run_id=self.parent_run_id,
tags=self.tags,
inheritable_tags=self.inheritable_tags,
metadata=self.metadata,
inheritable_metadata=self.inheritable_metadata,
)
Domain
Subdomains
Called By
Source
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/callbacks/manager.py.
Where is on_tool_start() defined?
on_tool_start() is defined in libs/core/langchain_core/callbacks/manager.py at line 1990.
What does on_tool_start() call?
on_tool_start() calls 2 function(s): ahandle_event, 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