pub struct HandoffRouter { /* private fields */ }Expand description
Handoff router - manages agent network and routes conversations
Implementations§
Source§impl HandoffRouter
impl HandoffRouter
Sourcepub fn add_handoff(
self,
from: impl Into<String>,
to: impl Into<String>,
trigger: HandoffTrigger,
) -> Self
pub fn add_handoff( self, from: impl Into<String>, to: impl Into<String>, trigger: HandoffTrigger, ) -> Self
Add a handoff rule
Sourcepub fn add_handoff_priority(
self,
from: impl Into<String>,
to: impl Into<String>,
trigger: HandoffTrigger,
priority: i32,
) -> Self
pub fn add_handoff_priority( self, from: impl Into<String>, to: impl Into<String>, trigger: HandoffTrigger, priority: i32, ) -> Self
Add a prioritized handoff rule
Sourcepub fn max_handoffs(self, max: u32) -> Self
pub fn max_handoffs(self, max: u32) -> Self
Set maximum handoffs
Sourcepub fn list_agents(&self) -> Vec<&AgentNode>
pub fn list_agents(&self) -> Vec<&AgentNode>
List all agents
Sourcepub async fn run(
&self,
context: HandoffContext,
) -> Result<HandoffResult, CrewError>
pub async fn run( &self, context: HandoffContext, ) -> Result<HandoffResult, CrewError>
Run a conversation with automatic handoffs
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HandoffRouter
impl !RefUnwindSafe for HandoffRouter
impl Send for HandoffRouter
impl Sync for HandoffRouter
impl Unpin for HandoffRouter
impl UnsafeUnpin for HandoffRouter
impl !UnwindSafe for HandoffRouter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more