Skip to content

Commit 65b0983

Browse files
nonchrismdrxy
andauthored
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 <[email protected]>
1 parent 4e51353 commit 65b0983

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libs/core/langchain_core/callbacks/manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ def on_tool_end(
10661066
10671067
Args:
10681068
output (Any): The output of the tool.
1069-
**kwargs (Any): Additional keyword arguments.
1069+
**kwargs (Any): The keyword arguments to pass to the event handler
10701070
"""
10711071
if not self.handlers:
10721072
return
@@ -1470,7 +1470,7 @@ def on_tool_start(
14701470
input is needed.
14711471
If provided, the inputs are expected to be formatted as a dict.
14721472
The keys will correspond to the named-arguments in the tool.
1473-
**kwargs (Any): Additional keyword arguments.
1473+
**kwargs (Any): The keyword arguments to pass to the event handler
14741474
14751475
Returns:
14761476
CallbackManagerForToolRun: The callback manager for the tool run.

libs/core/langchain_core/tools/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ def run(
803803
run_id: The id of the run. Defaults to None.
804804
config: The configuration for the tool. Defaults to None.
805805
tool_call_id: The id of the tool call. Defaults to None.
806-
kwargs: Keyword arguments to be passed to tool callbacks
806+
kwargs: Keyword arguments to be passed to tool callbacks (event handler)
807807
808808
Returns:
809809
The output of the tool.

0 commit comments

Comments
 (0)