pub struct StageClassifier { /* private fields */ }Expand description
Signal-only stage-router classifier: scores each turn onto the capable/efficient tiers from tool-result signals, via the configured picker mode and the confidence the scorer must reach before it acts on the signal alone.
With with_handoff_notes it also splices a note
into the request explaining why the signals sent the turn where they did.
Implementations§
Source§impl StageClassifier
impl StageClassifier
Sourcepub fn new(mode: PickerMode, confidence_threshold: f64) -> Self
pub fn new(mode: PickerMode, confidence_threshold: f64) -> Self
Scores onto the runtime capable and efficient models, with the given
default tier (mode) and confidence_threshold.
Sourcepub fn with_capable_first_threshold(self, threshold: f64) -> Self
pub fn with_capable_first_threshold(self, threshold: f64) -> Self
Threshold used when an outer classifier selects capable-first.
Sourcepub fn with_capable_hold_turns(self, turns: i64) -> Self
pub fn with_capable_hold_turns(self, turns: i64) -> Self
Keep capable for this many requests after an escalation. Zero disables
it; -1 pins after a switch. Validated by the enclosing stage router.
Sourcepub fn with_efficient_hold_turns(self, turns: i64) -> Self
pub fn with_efficient_hold_turns(self, turns: i64) -> Self
Hold the efficient tier after a switch. Zero disables it; -1 pins.
Validated by the enclosing stage router.
Sourcepub fn with_handoff_notes(self, config: HandoffNoteConfig) -> Self
pub fn with_handoff_notes(self, config: HandoffNoteConfig) -> Self
Hand the routed model a note on a signal-driven escalation, and on a hand-back to the efficient tier when a de-escalation note is configured.
Trait Implementations§
Source§impl Classifier for StageClassifier
impl Classifier for StageClassifier
Source§fn score<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 mut State,
request: &'life2 mut Request,
driver: &'life3 Driver,
) -> Pin<Box<dyn Future<Output = Result<(Classification, Option<Response>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn score<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 mut State,
request: &'life2 mut Request,
driver: &'life3 Driver,
) -> Pin<Box<dyn Future<Output = Result<(Classification, Option<Response>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§impl Processor for StageClassifier
Observe the final cascade choice, including judge and fall-open decisions.
impl Processor for StageClassifier
Observe the final cascade choice, including judge and fall-open decisions.
Source§fn process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 mut State,
event: Event<'life2>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 mut State,
event: Event<'life2>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
state. Request-bearing events
(Event::Request, Event::Decision) may also be rewritten in place.