HookDefinition
Defined in the hooks module.Rust AI Agent SDK Hook definition
Fields
| Name | Type | Description |
|---|---|---|
id | String | Unique ID |
event | HookEvent | Event to hook |
matcher | Option<String> | Optional matcher pattern (regex for tool names, etc.) |
func | HookFn | Hook function |
enabled | bool | Whether hook is enabled |
name | Option<String> | Hook name (for debugging) |
Methods
new
| Name | Type |
|---|---|
event | HookEvent |
func | impl Fn(&HookInput |
with_matcher
| Name | Type |
|---|---|
pattern | impl Into<String> |
with_name
| Name | Type |
|---|---|
name | impl Into<String> |
matches
| Name | Type |
|---|---|
target | &str |
execute
| Name | Type |
|---|---|
input | &HookInput |
Source
View on GitHub
praisonai/src/hooks/mod.rs at line 285
