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

Diagram

uses

returns

Agent

Tool: ToolResult

Result

Fields

NameTypeDescription
nameStringThe tool name
valueValueThe result value (JSON)
successboolWhether the execution was successful
errorOption<String>Error message if failed

Methods

success

rust
fn success(name: impl Into<String>, value: Value) -> Self

Create a successful result

Parameters:

NameType
nameimpl Into&lt;String&gt;
valueValue

failure

rust
fn failure(name: impl Into<String>, error: impl Into<String>) -> Self

Create a failed result

Parameters:

NameType
nameimpl Into&lt;String&gt;
errorimpl Into&lt;String&gt;

Source

View on GitHub

praisonai/src/tools/mod.rs at line 27


Related Documentation