Categorize Hooks • AI Agent SDK
categorize_hooks: Categorize hooks by their type.
categorize_hooks
Function
</div>
This function is defined in the middleware module.
Categorize hooks by their type.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph TD
event["Event Trigger"] --> hook["Hook: categorize_hooks"]
hook --> decision{"Decision"}
decision -- "Allow" --> proc["Process"]
decision -- "Deny" --> block["Block"]
style hook fill:#189AB4,color:#fff
style event fill:#8B0000,color:#fff
style proc fill:#8B0000,color:#fff
style block fill:#8B0000,color:#fffSignature
def categorize_hooks(hooks: List[Callable]) -> Dict[str, List[Callable]]Parameters
ParamField
List[Callable]No description available.
Returns
ResponseField
Dict[str, List[Callable]]before_model, after_model, wrap_model_call, before_tool, after_tool, wrap_tool_call
Uses
get_hook_type
Source
View on GitHubpraisonaiagents/hooks/middleware.py at line 388