pub struct ConfidentStep {
pub action: Value,
pub confidence: f64,
pub alternatives: Vec<Alternative>,
pub verification: Option<Verification>,
pub description: Option<String>,
}Expand description
A step with confidence score and alternatives.
Fields§
§action: ValueThe primary action to execute.
confidence: f64Confidence score (0.0 to 1.0).
alternatives: Vec<Alternative>Alternative actions ranked by confidence.
verification: Option<Verification>Optional verification to run after the action.
description: Option<String>Brief description of the action.
Implementations§
Source§impl ConfidentStep
impl ConfidentStep
Sourcepub fn with_alternative(self, alt: Alternative) -> Self
pub fn with_alternative(self, alt: Alternative) -> Self
Add an alternative action.
Sourcepub fn with_alternatives(self, alts: Vec<Alternative>) -> Self
pub fn with_alternatives(self, alts: Vec<Alternative>) -> Self
Add multiple alternatives.
Sourcepub fn with_verification(self, verification: Verification) -> Self
pub fn with_verification(self, verification: Verification) -> Self
Add a verification step.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Add a description.
Sourcepub fn is_confident(&self, threshold: f64) -> bool
pub fn is_confident(&self, threshold: f64) -> bool
Check if confidence is above a threshold.
Sourcepub fn has_alternatives(&self) -> bool
pub fn has_alternatives(&self) -> bool
Check if alternatives are available.
Sourcepub fn best_alternative(&self) -> Option<&Alternative>
pub fn best_alternative(&self) -> Option<&Alternative>
Get the next best alternative, if any.
Sourcepub fn sorted_alternatives(&self) -> Vec<&Alternative>
pub fn sorted_alternatives(&self) -> Vec<&Alternative>
Get alternatives sorted by confidence (highest first).
Trait Implementations§
Source§impl Clone for ConfidentStep
impl Clone for ConfidentStep
Source§fn clone(&self) -> ConfidentStep
fn clone(&self) -> ConfidentStep
Returns a duplicate of the value. Read more
1.0.0 · 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 ConfidentStep
impl Debug for ConfidentStep
Source§impl<'de> Deserialize<'de> for ConfidentStep
impl<'de> Deserialize<'de> for ConfidentStep
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
Auto Trait Implementations§
impl Freeze for ConfidentStep
impl RefUnwindSafe for ConfidentStep
impl Send for ConfidentStep
impl Sync for ConfidentStep
impl Unpin for ConfidentStep
impl UnwindSafe for ConfidentStep
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