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
| Name | Type | Description |
|---|---|---|
success | bool | Whether the handoff succeeded |
response | Option<String> | Response from target agent |
target_agent | Option<String> | Name of the target agent |
source_agent | Option<String> | Name of the source agent |
duration_seconds | f64 | Duration of the handoff in seconds |
error | Option<String> | Error message if failed |
handoff_depth | usize | Handoff depth at completion |
Methods
success
fn success(response: impl Into<String>) -> SelfCreate a successful result
Parameters:
| Name | Type |
|---|---|
response | impl Into<String> |
failure
fn failure(error: impl Into<String>) -> SelfCreate a failed result
Parameters:
| Name | Type |
|---|---|
error | impl Into<String> |
with_target
fn with_target(mut self, agent: impl Into<String>) -> SelfSet target agent
Parameters:
| Name | Type |
|---|---|
agent | impl Into<String> |
with_source
fn with_source(mut self, agent: impl Into<String>) -> SelfSet source agent
Parameters:
| Name | Type |
|---|---|
agent | impl Into<String> |
with_duration
fn with_duration(mut self, seconds: f64) -> SelfSet duration
Parameters:
| Name | Type |
|---|---|
seconds | f64 |
with_depth
fn with_depth(mut self, depth: usize) -> SelfSet handoff depth
Parameters:
| Name | Type |
|---|---|
depth | usize |
Source
View on GitHubpraisonai/src/handoff/mod.rs at line 292