pub struct HandoffRouter { /* private fields */ }Expand description
Router for handling agent handoffs
Implementations§
Source§impl HandoffRouter
impl HandoffRouter
Sourcepub fn new(registry: AgentRegistry) -> Self
pub fn new(registry: AgentRegistry) -> Self
Create a new handoff router
Sourcepub fn with_min_confidence(self, threshold: f32) -> Self
pub fn with_min_confidence(self, threshold: f32) -> Self
Set minimum confidence threshold
Sourcepub fn route_excluding(
&self,
task: &str,
exclude: &str,
) -> Option<(String, f32)>
pub fn route_excluding( &self, task: &str, exclude: &str, ) -> Option<(String, f32)>
Route a task, excluding a specific agent
Sourcepub fn evaluate(&self, agent: &str, task: &str) -> HandoffDecision
pub fn evaluate(&self, agent: &str, task: &str) -> HandoffDecision
Evaluate if an agent should handle a task or hand off
Sourcepub fn record_handoff(&mut self, from: &str, to: &str, task: &str, score: f32)
pub fn record_handoff(&mut self, from: &str, to: &str, task: &str, score: f32)
Record a handoff for analysis
Sourcepub fn stats(&self) -> HandoffStats
pub fn stats(&self) -> HandoffStats
Get handoff statistics
Sourcepub fn registry(&self) -> &AgentRegistry
pub fn registry(&self) -> &AgentRegistry
Get registry reference
Sourcepub fn registry_mut(&mut self) -> &mut AgentRegistry
pub fn registry_mut(&mut self) -> &mut AgentRegistry
Get mutable registry reference
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