Skip to main content

Decider

Struct Decider 

Source
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

Source

pub fn new(backend: Box<dyn DecideBackend>) -> Self

Source

pub fn with_pair_cap(self, cap: usize) -> Self

Set the per-sweep, per-run pair cap (default DEFAULT_PAIR_CAP).

Source

pub fn pair_cap(&self) -> usize

Source

pub fn calibrated(&self) -> bool

Source

pub fn describe(&self) -> String

Source

pub fn report(&self) -> DeciderReport

This run’s report so far.

Source

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.

Source

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).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.