Skip to content

Add tool call parameters for on_tool_start hook #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yanmxa
Copy link

@yanmxa yanmxa commented Mar 20, 2025

Resolve: #252

(
agent.hooks.on_tool_start(context_wrapper, agent, func_tool)
agent.hooks.on_tool_start(context_wrapper, agent, func_tool, tool_call.arguments)
if agent.hooks

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since using only arguments as a parameter is too granular, and adding tool_call.id in the future would lead to parameter inflation at the root level, plus tool_call.id is actually needed, would it be better to pass the entire tool_call object as a parameter instead?"

Copy link
Author

@yanmxa yanmxa Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mini-peanut Thanks for your review! I've updated the hook to use Action, which not only includes the Tool but also contains the instance information for a tool call, including the parameters and tool_call.id.

@louis-sanna-eki
Copy link

louis-sanna-eki commented Apr 10, 2025

@yanmxa thanks for doing this work, very useful!

@yanmxa yanmxa requested a review from mini-peanut April 17, 2025 13:57
@yanmxa yanmxa force-pushed the br_tool_hooks branch 3 times, most recently from 4724b5e to c3287fd Compare April 26, 2025 05:35
Signed-off-by: myan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance on_tool_start Hook to Include Tool Call Arguments
3 participants