Hook Input • Rust AI Agent SDK
HookInput: Input data for hooks
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>) -> SelfCreate 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>) -> SelfSet agent name
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
with_tool
fn with_tool(mut self, name: impl Into<String>, args: serde_json::Value) -> SelfSet tool info
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
args | serde_json::Value |
with_message
fn with_message(mut self, message: impl Into<String>) -> SelfSet message
Parameters:
| Name | Type |
|---|---|
message | impl Into<String> |
with_error
fn with_error(mut self, error: impl Into<String>) -> SelfSet error
Parameters:
| Name | Type |
|---|---|
error | impl Into<String> |
with_extra
fn with_extra(mut self, key: impl Into<String>, value: serde_json::Value) -> SelfAdd extra data
Parameters:
| Name | Type |
|---|---|
key | impl Into<String> |
value | serde_json::Value |
Source
View on GitHubpraisonai/src/hooks/mod.rs at line 105