Skip to main content

HandoffResult

Defined in the handoff module.
Rust AI Agent SDK Result of a handoff operation.

Fields

NameTypeDescription
successboolWhether the handoff succeeded
responseOption<String>Response from target agent
target_agentOption<String>Name of the target agent
source_agentOption<String>Name of the source agent
duration_secondsf64Duration of the handoff in seconds
errorOption<String>Error message if failed
handoff_depthusizeHandoff depth at completion

Methods

success

fn success(response: impl Into<String>) -> Self
Create a successful result Parameters:
NameType
responseimpl Into&lt;String&gt;

failure

fn failure(error: impl Into<String>) -> Self
Create a failed result Parameters:
NameType
errorimpl Into&lt;String&gt;

with_target

fn with_target(mut self, agent: impl Into<String>) -> Self
Set target agent Parameters:
NameType
agentimpl Into&lt;String&gt;

with_source

fn with_source(mut self, agent: impl Into<String>) -> Self
Set source agent Parameters:
NameType
agentimpl Into&lt;String&gt;

with_duration

fn with_duration(mut self, seconds: f64) -> Self
Set duration Parameters:
NameType
secondsf64

with_depth

fn with_depth(mut self, depth: usize) -> Self
Set handoff depth Parameters:
NameType
depthusize

Source

View on GitHub

praisonai/src/handoff/mod.rs at line 292