pub struct ConfidenceRetryStrategy {
pub confidence_threshold: f64,
pub use_alternatives: bool,
pub max_alternatives: usize,
pub adaptive_threshold: bool,
pub threshold_decay: f64,
}Expand description
Strategy for retrying based on confidence.
Fields§
§confidence_threshold: f64Minimum confidence to accept without retry.
use_alternatives: boolWhether to try alternatives on failure.
max_alternatives: usizeMaximum alternatives to try.
adaptive_threshold: boolWhether to lower threshold after each retry.
threshold_decay: f64How much to lower threshold per retry.
Implementations§
Source§impl ConfidenceRetryStrategy
impl ConfidenceRetryStrategy
Sourcepub fn with_alternatives(self, use_alts: bool) -> Self
pub fn with_alternatives(self, use_alts: bool) -> Self
Set whether to use alternatives.
Sourcepub fn with_max_alternatives(self, max: usize) -> Self
pub fn with_max_alternatives(self, max: usize) -> Self
Set maximum alternatives.
Sourcepub fn with_adaptive(self, adaptive: bool) -> Self
pub fn with_adaptive(self, adaptive: bool) -> Self
Set adaptive threshold.
Sourcepub fn threshold_for_attempt(&self, attempt: usize) -> f64
pub fn threshold_for_attempt(&self, attempt: usize) -> f64
Get threshold for a given retry attempt.
Sourcepub fn should_accept(&self, step: &ConfidentStep, attempt: usize) -> bool
pub fn should_accept(&self, step: &ConfidentStep, attempt: usize) -> bool
Check if a step passes confidence threshold for a given attempt.
Sourcepub fn should_try_alternatives(
&self,
step: &ConfidentStep,
attempt: usize,
) -> bool
pub fn should_try_alternatives( &self, step: &ConfidentStep, attempt: usize, ) -> bool
Check if alternatives should be tried.
Trait Implementations§
Source§impl Clone for ConfidenceRetryStrategy
impl Clone for ConfidenceRetryStrategy
Source§fn clone(&self) -> ConfidenceRetryStrategy
fn clone(&self) -> ConfidenceRetryStrategy
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 ConfidenceRetryStrategy
impl Debug for ConfidenceRetryStrategy
Source§impl Default for ConfidenceRetryStrategy
impl Default for ConfidenceRetryStrategy
Source§impl<'de> Deserialize<'de> for ConfidenceRetryStrategy
impl<'de> Deserialize<'de> for ConfidenceRetryStrategy
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 ConfidenceRetryStrategy
impl PartialEq for ConfidenceRetryStrategy
Source§impl Serialize for ConfidenceRetryStrategy
impl Serialize for ConfidenceRetryStrategy
impl StructuralPartialEq for ConfidenceRetryStrategy
Auto Trait Implementations§
impl Freeze for ConfidenceRetryStrategy
impl RefUnwindSafe for ConfidenceRetryStrategy
impl Send for ConfidenceRetryStrategy
impl Sync for ConfidenceRetryStrategy
impl Unpin for ConfidenceRetryStrategy
impl UnwindSafe for ConfidenceRetryStrategy
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