Skip to main content

register_function

Method
This is a method of the HookRegistry class in the registry module.
Register a Python function as a hook.

Signature

Parameters

HookEvent
required
The event to hook
Callable
required
The function to call
Optional[str]
Optional regex pattern to match targets
Optional[str]
Optional name for the hook
Optional[str]
Optional description
bool
default:"False"
Whether to run sequentially
float
default:"60.0"
Timeout in seconds
bool
default:"False"
Whether the function is async

Returns

str
The hook ID

Uses

  • FunctionHook
  • register

Used By

Source

View on GitHub

praisonaiagents/hooks/registry.py at line 81