pub struct NudgeClassifierConfig {
pub version: u32,
pub min_score: f32,
pub min_margin: f32,
pub classes: BTreeMap<String, NudgeClassConfig>,
}Expand description
Config file shape for ~/.newt/classifiers/nudge.toml.
Fields§
§version: u32Schema version. Currently informational; future versions can migrate.
min_score: f32Minimum similarity score required before a class is trusted.
min_margin: f32Minimum gap between the winning class and runner-up.
classes: BTreeMap<String, NudgeClassConfig>Class definitions keyed by canonical class names:
pending_action, plan_update, final_answer.
Implementations§
Source§impl NudgeClassifierConfig
impl NudgeClassifierConfig
Sourcepub fn load_file(path: &Path) -> Result<Self>
pub fn load_file(path: &Path) -> Result<Self>
Load only this config file. Missing files are treated as defaults; malformed files return an error so callers that explicitly asked to load can surface it.
Sourcepub fn load_from_dir(dir: &Path) -> Result<Self>
pub fn load_from_dir(dir: &Path) -> Result<Self>
Load from a classifier directory, e.g. ~/.newt/classifiers.
Trait Implementations§
Source§impl Clone for NudgeClassifierConfig
impl Clone for NudgeClassifierConfig
Source§fn clone(&self) -> NudgeClassifierConfig
fn clone(&self) -> NudgeClassifierConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NudgeClassifierConfig
impl Debug for NudgeClassifierConfig
Source§impl Default for NudgeClassifierConfig
impl Default for NudgeClassifierConfig
Source§impl<'de> Deserialize<'de> for NudgeClassifierConfig
impl<'de> Deserialize<'de> for NudgeClassifierConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for NudgeClassifierConfig
impl PartialEq for NudgeClassifierConfig
Source§fn eq(&self, other: &NudgeClassifierConfig) -> bool
fn eq(&self, other: &NudgeClassifierConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for NudgeClassifierConfig
impl Serialize for NudgeClassifierConfig
impl StructuralPartialEq for NudgeClassifierConfig
Auto Trait Implementations§
impl Freeze for NudgeClassifierConfig
impl RefUnwindSafe for NudgeClassifierConfig
impl Send for NudgeClassifierConfig
impl Sync for NudgeClassifierConfig
impl Unpin for NudgeClassifierConfig
impl UnsafeUnpin for NudgeClassifierConfig
impl UnwindSafe for NudgeClassifierConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more