pub struct Decider { /* private fields */ }Expand description
The engine’s handle on an installed backend: the typed helpers every
stage uses, the per-run counters behind DeciderReport, and the per-run
tool-cause cache.
Implementations§
Source§impl Decider
impl Decider
pub fn new(backend: Box<dyn DecideBackend>) -> Self
Sourcepub fn with_pair_cap(self, cap: usize) -> Self
pub fn with_pair_cap(self, cap: usize) -> Self
Set the per-sweep, per-run pair cap (default DEFAULT_PAIR_CAP).
pub fn pair_cap(&self) -> usize
pub fn calibrated(&self) -> bool
pub fn describe(&self) -> String
Sourcepub fn report(&self) -> DeciderReport
pub fn report(&self) -> DeciderReport
This run’s report so far.
Sourcepub fn ask(&self, state: Value, questions: &[Ask]) -> Result<Answered>
pub fn ask(&self, state: Value, questions: &[Ask]) -> Result<Answered>
Ask questions about state in ONE request and validate the answer
against what was asked. Every failure is LOP-E051 and is counted on
the run’s report; callers drop their stage’s contribution on Err.
Sourcepub fn classify_causes(
&self,
texts: &[String],
) -> BTreeMap<String, CauseVerdict>
pub fn classify_causes( &self, texts: &[String], ) -> BTreeMap<String, CauseVerdict>
The tool-cause classifier (E3): for each distinct free-text cause,
the closed-vocabulary cause and its probability when a CALIBRATED
backend’s argmax reaches CAUSE_MIN_P; None otherwise (the caller
keeps unknown). Cached by string for the run, so one string is asked
at most once; at most pair_cap distinct strings are asked per run.
A failed request leaves its strings unknown for the run (cached as
None, so a later caller does not retry into the same failure).