pub struct AgentToolResult {
pub content: Vec<ContentBlock>,
pub details: Value,
pub is_error: bool,
pub transfer_signal: Option<TransferSignal>,
}Expand description
The result of a tool execution.
Contains content blocks returned to the LLM and structured details for logging that are not sent to the model.
Fields§
§content: Vec<ContentBlock>Content blocks returned to the LLM as the tool result.
details: ValueStructured data for logging and display; not sent to the LLM.
is_error: boolWhether this result represents an error condition.
transfer_signal: Option<TransferSignal>Optional transfer signal when this tool result requests an agent handoff.
Implementations§
Source§impl AgentToolResult
impl AgentToolResult
Sourcepub fn text(text: impl Into<String>) -> Self
pub fn text(text: impl Into<String>) -> Self
Create a result containing a single text content block with null details.
Sourcepub fn error(message: impl Into<String>) -> Self
pub fn error(message: impl Into<String>) -> Self
Create an error result containing a single text content block with null details.
Semantically identical to text but communicates intent
at the call site.
Sourcepub fn transfer(signal: TransferSignal) -> Self
pub fn transfer(signal: TransferSignal) -> Self
Create a result that signals a transfer to another agent.
The result text is a brief confirmation message; the transfer signal
carries the actual handoff payload. The agent loop detects this signal
and terminates the turn with StopReason::Transfer.
Sourcepub const fn is_transfer(&self) -> bool
pub const fn is_transfer(&self) -> bool
Returns true if this result carries a transfer signal.
Trait Implementations§
Source§impl Clone for AgentToolResult
impl Clone for AgentToolResult
Source§fn clone(&self) -> AgentToolResult
fn clone(&self) -> AgentToolResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more