core: docs: clarify where the kwargs in on_tool_start and on_tool_end go (#31909)

**Description:**  
I traced the kwargs starting at `.invoke()` and it was not clear where
they go. it was clarified to two layers down. so I changed it to make it
more documented for the next person.


**Issue:**  
No related issue.

**Dependencies:**  
No dependency changes.

**Twitter handle:**  
Nah. We're good.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, eyurtsev, ccurme, vbarda, hwchase17.

---------

Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Chris G 2025-07-08 16:35:31 +02:00 committed by GitHub
parent 4e513539f8
commit 65b098325b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -1066,7 +1066,7 @@ class CallbackManagerForToolRun(ParentRunManager, ToolManagerMixin):
Args:
output (Any): The output of the tool.
**kwargs (Any): Additional keyword arguments.
**kwargs (Any): The keyword arguments to pass to the event handler
"""
if not self.handlers:
return
@ -1470,7 +1470,7 @@ class CallbackManager(BaseCallbackManager):
input is needed.
If provided, the inputs are expected to be formatted as a dict.
The keys will correspond to the named-arguments in the tool.
**kwargs (Any): Additional keyword arguments.
**kwargs (Any): The keyword arguments to pass to the event handler
Returns:
CallbackManagerForToolRun: The callback manager for the tool run.

View File

@ -803,7 +803,7 @@ class ChildTool(BaseTool):
run_id: The id of the run. Defaults to None.
config: The configuration for the tool. Defaults to None.
tool_call_id: The id of the tool call. Defaults to None.
kwargs: Keyword arguments to be passed to tool callbacks
kwargs: Keyword arguments to be passed to tool callbacks (event handler)
Returns:
The output of the tool.