Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
HookRunner
Defined in the hooks module.
Rust AI Agent SDK
Hook runner for executing hooks in a workflow
Fields
| Name | Type | Description |
|---|
registry | Arc<HookRegistry> | - |
Methods
new
fn new(registry: HookRegistry) -> Self
Create a new hook runner
Parameters:
| Name | Type |
|---|
registry | HookRegistry |
fn before_tool(
&self,
session_id: &str,
tool_name: &str,
args: serde_json::Value,
) -> Result<HookResult>
Run before-tool hooks
Parameters:
| Name | Type |
|---|
session_id | &str |
tool_name | &str |
args | serde_json::Value |
fn after_tool(
&self,
session_id: &str,
tool_name: &str,
result: serde_json::Value,
) -> Result<HookResult>
Run after-tool hooks
Parameters:
| Name | Type |
|---|
session_id | &str |
tool_name | &str |
result | serde_json::Value |
before_agent
fn before_agent(
&self,
session_id: &str,
agent_name: &str,
message: &str,
) -> Result<HookResult>
Run before-agent hooks
Parameters:
| Name | Type |
|---|
session_id | &str |
agent_name | &str |
message | &str |
after_agent
fn after_agent(
&self,
session_id: &str,
agent_name: &str,
response: &str,
) -> Result<HookResult>
Run after-agent hooks
Parameters:
| Name | Type |
|---|
session_id | &str |
agent_name | &str |
response | &str |
on_error
fn on_error(&self, session_id: &str, error: &str) -> Result<HookResult>
Run on-error hooks
Parameters:
| Name | Type |
|---|
session_id | &str |
error | &str |
Source
View on GitHub
praisonai/src/hooks/mod.rs at line 461