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.
HookInput
Defined in the hooks module.
Rust AI Agent SDK
Input data for hooks
Fields
| Name | Type | Description |
|---|
session_id | String | Session ID |
event_name | String | Event name |
timestamp | String | Timestamp (ISO 8601) |
agent_name | Option<String> | Agent name (optional) |
tool_name | Option<String> | Tool name (for tool events) |
tool_args | Option<serde_json::Value> | Tool arguments (for tool events) |
message | Option<String> | Message content (for agent/LLM events) |
error | Option<String> | Error message (for error events) |
extra | HashMap<String | Additional data |
serde_json | :Value> | Additional data |
Methods
new
fn new(event: HookEvent, session_id: impl Into<String>) -> Self
Create a new hook input
Parameters:
| Name | Type |
|---|
event | HookEvent |
session_id | impl Into<String> |
with_agent
fn with_agent(mut self, name: impl Into<String>) -> Self
Set agent name
Parameters:
| Name | Type |
|---|
name | impl Into<String> |
fn with_tool(mut self, name: impl Into<String>, args: serde_json::Value) -> Self
Set tool info
Parameters:
| Name | Type |
|---|
name | impl Into<String> |
args | serde_json::Value |
with_message
fn with_message(mut self, message: impl Into<String>) -> Self
Set message
Parameters:
| Name | Type |
|---|
message | impl Into<String> |
with_error
fn with_error(mut self, error: impl Into<String>) -> Self
Set error
Parameters:
| Name | Type |
|---|
error | impl Into<String> |
fn with_extra(mut self, key: impl Into<String>, value: serde_json::Value) -> Self
Add extra data
Parameters:
| Name | Type |
|---|
key | impl Into<String> |
value | serde_json::Value |
Source
View on GitHub
praisonai/src/hooks/mod.rs at line 105