pub struct RequestRouter { /* private fields */ }Expand description
The request-intent router: Layer 0 markers + optional Layer-1 fast
classifier + Layer-2 safe default + an optional user-pinned mode that
overrides everything (the user always wins; the model never does).
Implementations§
Source§impl RequestRouter
impl RequestRouter
Sourcepub fn new(fast: Option<Arc<BoxedProvider>>) -> Self
pub fn new(fast: Option<Arc<BoxedProvider>>) -> Self
fast: the cheap classifier provider (Layer 1). None = degraded
path — Layer 0 + safe default hold the line alone (design O1).
Sourcepub fn with_pin(self, pin: Arc<AtomicU8>) -> Self
pub fn with_pin(self, pin: Arc<AtomicU8>) -> Self
Share a user-pinned-mode cell (e.g. the TUI /mode study command):
a non-zero pin short-circuits routing entirely.
Sourcepub fn pinned_mode(&self) -> Option<RequestMode>
pub fn pinned_mode(&self) -> Option<RequestMode>
The currently pinned mode, if the user pinned one (None = auto).
The runner consults this before the bare-affirmation promotion: a
PINNED Study/Clarify mode must never be silently promoted to Execute.
Sourcepub async fn route(&self, text: &str) -> RoutedMode
pub async fn route(&self, text: &str) -> RoutedMode
Route a fresh request. Always returns a mode (never blocks the run): L0 when confident, else L1 when available and confident, else the SAFER default (CLARIFY for design-ish texts, STUDY otherwise).