execute • AI Agent SDK
execute: Execute all hooks for an event.
execute
Async
Method
</div>
This is a method of the HookRunner class in the runner module.
Execute all hooks for an event.
Signature
async def execute(event: HookEvent, input_data: HookInput, target: Optional[str], _hooks: Optional[List['HookDefinition']]) -> List[HookExecutionResult]Parameters
ParamField
HookEventThe event to execute hooks for
ParamField
HookInputInput data for the hooks
ParamField
Optional[str]Optional target to filter hooks (e.g., tool name)
ParamField
OptionalInternal parameter to avoid duplicate get_hooks() calls
Returns
ResponseField
List[HookExecutionResult]List of execution results
Uses
get_hooksis_denied
Used By
CodeAgent.execute_codeCodeAgent.aexecuteMiddlewareManager.execute_model_callMiddlewareManager.execute_tool_callfire_hook
Source
View on GitHubpraisonaiagents/hooks/runner.py at line 114