pub struct SubagentRouter { /* private fields */ }Expand description
Routes delegated work independently while preserving the parent algorithm for other traffic.
Implementations§
Trait Implementations§
Source§impl Algorithm for SubagentRouter
impl Algorithm for SubagentRouter
Source§fn name(&self) -> &str
fn name(&self) -> &str
Stable, low-cardinality name identifying this algorithm — the
algorithm attribute on every span, metric, and log line the crate
emits for its runs.Source§fn tracks_usage(&self, request: &Request) -> bool
fn tracks_usage(&self, request: &Request) -> bool
Whether to report final solver usage for this request.
Source§fn observe_usage<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
agent_id: Option<&'life2 str>,
served_model: &'life3 ModelId,
usage: Option<&'life4 Usage>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn observe_usage<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
agent_id: Option<&'life2 str>,
served_model: &'life3 ModelId,
usage: Option<&'life4 Usage>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Records the actual serving model and its usage after a successful answer.
Source§fn route<'async_trait>(
self: Arc<Self>,
driver: Driver,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<RoutingOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
fn route<'async_trait>(
self: Arc<Self>,
driver: Driver,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<RoutingOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
Select a route, requesting external work through
Driver as needed.
run_stream runs this method and exposes its work to the host.Source§fn tracks_answers(&self) -> bool
fn tracks_answers(&self) -> bool
Whether the host should summarize served answers for
Self::observe_answer.Source§fn observe_answer<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_id: &'life1 str,
_answer: AnswerSummary,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn observe_answer<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_id: &'life1 str,
_answer: AnswerSummary,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Records the answer the host served for a request in
session_id. Read moreSource§fn run_stream(
self: Arc<Self>,
request: Request,
models: Arc<RuntimeModels>,
state: State,
) -> StepStream
fn run_stream( self: Arc<Self>, request: Request, models: Arc<RuntimeModels>, state: State, ) -> StepStream
Expose work requests and the final outcome so the host can control execution. Read more
Auto Trait Implementations§
impl !Freeze for SubagentRouter
impl !RefUnwindSafe for SubagentRouter
impl !UnwindSafe for SubagentRouter
impl Forget for SubagentRouter
impl Move for SubagentRouter
impl Send for SubagentRouter
impl Sync for SubagentRouter
impl Unpin for SubagentRouter
impl UnsafeUnpin for SubagentRouter
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