HookRegistry
Defined in the registry module.AI Agent Registry for managing hooks. Provides methods to register, unregister, and lookup hooks for different events.
Constructor
bool
default:"True"
No description available.
Methods
enabled()
Check if hooks are enabled.
enabled()
Enable or disable hooks.
register()
Register a hook definition.
register_function()
Register a Python function as a hook.
register_command()
Register a shell command as a hook.
on()
Decorator to register a function as a hook.
unregister()
Unregister a hook by ID.
get_hooks()
Get all hooks for an event, optionally filtered by target.
has_hooks()
Check if there are any hooks registered for an event.
clear()
Clear all hooks or hooks for a specific event.
list_hooks()
List all registered hooks.
enable_hook()
Enable a specific hook.
disable_hook()
Disable a specific hook.
set_global_timeout()
Set the global timeout for all hooks.
Usage
Source
View on GitHub
praisonaiagents/hooks/registry.py at line 19
