Handoff Result • Rust AI Agent SDK

HandoffResult: Result of a handoff operation.

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

rust
fn success(response: impl Into<String>) -> Self

Create a successful result

Parameters:

NameType
responseimpl Into&lt;String&gt;

failure

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

Create a failed result

Parameters:

NameType
errorimpl Into&lt;String&gt;

with_target

rust
fn with_target(mut self, agent: impl Into<String>) -> Self

Set target agent

Parameters:

NameType
agentimpl Into&lt;String&gt;

with_source

rust
fn with_source(mut self, agent: impl Into<String>) -> Self

Set source agent

Parameters:

NameType
agentimpl Into&lt;String&gt;

with_duration

rust
fn with_duration(mut self, seconds: f64) -> Self

Set duration

Parameters:

NameType
secondsf64

with_depth

rust
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


Related Documentation