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

python
async def execute(event: HookEvent, input_data: HookInput, target: Optional[str], _hooks: Optional[List['HookDefinition']]) -> List[HookExecutionResult]

Parameters

ParamField HookEvent

The event to execute hooks for

ParamField HookInput

Input data for the hooks

ParamField Optional[str]

Optional target to filter hooks (e.g., tool name)

ParamField Optional

Internal parameter to avoid duplicate get_hooks() calls

Returns

ResponseField List[HookExecutionResult]

List of execution results

Uses

  • get_hooks
  • is_denied

Used By

Source

View on GitHub

praisonaiagents/hooks/runner.py at line 114