#[non_exhaustive]pub struct MultiRunConfig {
pub num_runs: usize,
pub min_pass_rate: f64,
}Expand description
How many times to run an eval set, and how often a case must pass.
§Example
use adk_eval::MultiRunConfig;
let config = MultiRunConfig::new(3)?.with_min_pass_rate(2.0 / 3.0)?;
assert_eq!(config.num_runs, 3);
assert!(MultiRunConfig::new(0).is_err());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.num_runs: usizeRuns of the whole eval set, at least 1.
min_pass_rate: f64Fraction of runs, from 0.0 to 1.0, a case must pass to pass overall. The default, 1.0, requires every run to pass.
Implementations§
Source§impl MultiRunConfig
impl MultiRunConfig
Sourcepub fn new(num_runs: usize) -> Result<Self>
pub fn new(num_runs: usize) -> Result<Self>
Runs the eval set num_runs times, requiring every run of a case to pass.
§Errors
Returns EvalError::ConfigError when num_runs is 0.
Sourcepub fn with_min_pass_rate(self, min_pass_rate: f64) -> Result<Self>
pub fn with_min_pass_rate(self, min_pass_rate: f64) -> Result<Self>
Sets the fraction of runs a case must pass.
§Errors
Returns EvalError::ConfigError when min_pass_rate is not between 0.0 and 1.0.
Trait Implementations§
Source§impl Clone for MultiRunConfig
impl Clone for MultiRunConfig
Source§impl Debug for MultiRunConfig
impl Debug for MultiRunConfig
Source§impl<'de> Deserialize<'de> for MultiRunConfig
impl<'de> Deserialize<'de> for MultiRunConfig
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 MultiRunConfig
impl PartialEq for MultiRunConfig
Source§impl Serialize for MultiRunConfig
impl Serialize for MultiRunConfig
impl StructuralPartialEq for MultiRunConfig
Auto Trait Implementations§
impl Forget for MultiRunConfig
impl Freeze for MultiRunConfig
impl Move for MultiRunConfig
impl RefUnwindSafe for MultiRunConfig
impl Send for MultiRunConfig
impl Sync for MultiRunConfig
impl Unpin for MultiRunConfig
impl UnsafeUnpin for MultiRunConfig
impl UnwindSafe for MultiRunConfig
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