pub struct HierarchicalRouter { /* private fields */ }Expand description
Runs a stage router with a tier the judge picks.
Implementations§
Source§impl HierarchicalRouter
impl HierarchicalRouter
Sourcepub fn new(
capable: ModelId,
efficient: ModelId,
config: HierarchicalRouterConfig,
) -> Result<Self>
pub fn new( capable: ModelId, efficient: ModelId, config: HierarchicalRouterConfig, ) -> Result<Self>
Stacks the judge over a stage router across the same tier pair.
Errors on a configuration either algorithm rejects and on every_request.
A stage router carrying its own judge is allowed, but that judge sits ahead of the fall-open tier and so answers most of the turns this one set a tier for.
Trait Implementations§
Source§impl Algorithm for HierarchicalRouter
impl Algorithm for HierarchicalRouter
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 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,
Run one request to completion: make routing-time model calls with
Driver::call_model and return the terminal RoutingOutcome.
The method an algorithm implements; run_stream drives it.Source§fn run_stream(self: Arc<Self>, request: Request) -> StepStream
fn run_stream(self: Arc<Self>, request: Request) -> StepStream
Auto Trait Implementations§
impl !Freeze for HierarchicalRouter
impl !RefUnwindSafe for HierarchicalRouter
impl Send for HierarchicalRouter
impl Sync for HierarchicalRouter
impl Unpin for HierarchicalRouter
impl UnsafeUnpin for HierarchicalRouter
impl !UnwindSafe for HierarchicalRouter
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