pub struct HandoffRunner<P: LlmProvider> { /* private fields */ }Expand description
Runs agents with handoff support. When an agent calls handoff, the runner
transfers conversation control to the target agent with context forwarding.
Unlike the orchestrator (centralized control), handoff is peer-to-peer: each agent can transfer directly to any configured target without going through a coordinator.
Implementations§
Source§impl<P: LlmProvider> HandoffRunner<P>
impl<P: LlmProvider> HandoffRunner<P>
Sourcepub fn builder() -> HandoffRunnerBuilder<P>
pub fn builder() -> HandoffRunnerBuilder<P>
Create a new HandoffRunnerBuilder for configuring a handoff runner.
Sourcepub async fn execute(&self, task: &str) -> Result<AgentOutput, Error>
pub async fn execute(&self, task: &str) -> Result<AgentOutput, Error>
Execute the handoff loop starting from the initial agent.
The initial agent receives the task. If it hands off, the target agent
receives the conversation context and continues. The loop ends when an
agent completes without handing off, or when max_handoffs is exceeded.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for HandoffRunner<P>
impl<P> !RefUnwindSafe for HandoffRunner<P>
impl<P> Send for HandoffRunner<P>
impl<P> Sync for HandoffRunner<P>
impl<P> Unpin for HandoffRunner<P>
impl<P> UnsafeUnpin for HandoffRunner<P>
impl<P> !UnwindSafe for HandoffRunner<P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more