pub struct HandoffTool { /* private fields */ }Expand description
Tool that allows an agent to hand off conversation control to a peer agent.
When called, returns a sentinel ToolOutput that the HandoffRunner
detects to trigger the conversation transfer. The agent loop treats this
as a normal tool result, but HandoffRunner inspects the final output.
Implementations§
Source§impl HandoffTool
impl HandoffTool
Sourcepub fn new(targets: Vec<HandoffTarget>) -> Self
pub fn new(targets: Vec<HandoffTarget>) -> Self
Create a new handoff tool with the given target agents.
Sourcepub fn target_names(&self) -> Vec<&str>
pub fn target_names(&self) -> Vec<&str>
Returns the list of valid target agent names.
Trait Implementations§
Source§impl Tool for HandoffTool
impl Tool for HandoffTool
fn definition(&self) -> ToolDefinition
fn execute( &self, _ctx: &ExecutionContext, input: Value, ) -> Pin<Box<dyn Future<Output = Result<ToolOutput, Error>> + Send + '_>>
Auto Trait Implementations§
impl Freeze for HandoffTool
impl RefUnwindSafe for HandoffTool
impl Send for HandoffTool
impl Sync for HandoffTool
impl Unpin for HandoffTool
impl UnsafeUnpin for HandoffTool
impl UnwindSafe for HandoffTool
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