Learn how to use tool hooks to modify the behavior of a tool.
Agent
or Team
object as well. Inside the tool hook, you have to call the function call and return the result.
agent
, team
, function_name
, function_call
, and arguments
are available parameters.Agent
or Team
object in the tool hook.
pre_hook
in the @tool
decorator to run a function before the tool call.
Set the post_hook
in the @tool
decorator to run a function after the tool call.
Here’s a demo example of using a pre_hook
, post_hook
along with Agent Context.