Tool Result • Rust AI Agent SDK
ToolResult: Result of a tool execution
ToolResult
Defined in the tools module.
Rust AI Agent SDK
Result of a tool execution
Fields
| Name | Type | Description |
|---|---|---|
name | String | The tool name |
value | Value | The result value (JSON) |
success | bool | Whether the execution was successful |
error | Option<String> | Error message if failed |
Methods
success
fn success(name: impl Into<String>, value: Value) -> SelfCreate a successful result
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
value | Value |
failure
fn failure(name: impl Into<String>, error: impl Into<String>) -> SelfCreate a failed result
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
error | impl Into<String> |
Source
View on GitHubpraisonai/src/tools/mod.rs at line 27