pub struct EvalConfig {
pub execution: ExecutionConfig,
pub judging: JudgingConfig,
pub selection: SelectionConfig,
}Expand description
Everything one evaluation run needs to know.
use turnframe_eval::config::EvalConfig;
let config = EvalConfig::from_toml_str(
r#"
[execution]
samples_per_item = 10
[judging]
votes_per_sample = 3
"#,
)?;
assert_eq!(config.execution.samples_per_item, 10);
assert_eq!(config.judging.votes_per_sample, 3);
config.validate()?;Fields§
§execution: ExecutionConfigHow the agent under test is exercised.
judging: JudgingConfigHow the judge is polled, when an item asks for one.
selection: SelectionConfigWhich subset of a suite runs.
Implementations§
Source§impl EvalConfig
impl EvalConfig
Sourcepub fn single() -> Self
pub fn single() -> Self
A run of one sample and one vote: the cheapest configuration that still exercises every stage. Use it for a smoke run; a release gate wants the numbers of spec §27.6 instead.
Sourcepub const fn with_samples_per_item(self, samples: u32) -> Self
pub const fn with_samples_per_item(self, samples: u32) -> Self
Sets the number of executions of the agent under test per item.
Sourcepub const fn recording_answers(self) -> Self
pub const fn recording_answers(self) -> Self
Keeps the turn’s own words on each sample, for curating a corpus.
See ExecutionConfig::record_answers for why this is off by default.
Sourcepub const fn with_votes_per_sample(self, votes: u32) -> Self
pub const fn with_votes_per_sample(self, votes: u32) -> Self
Sets the number of judge opinions collected per sample.
Sourcepub const fn with_sample_concurrency(self, samples: u32) -> Self
pub const fn with_sample_concurrency(self, samples: u32) -> Self
Sets how many samples may be in flight at once.
Leave it at one for a reproducible in-memory run; raise it only for a
corpus against a real endpoint. See
ExecutionConfig::sample_concurrency.
Sourcepub const fn with_max_observed_events(self, events: usize) -> Self
pub const fn with_max_observed_events(self, events: usize) -> Self
Caps how many of a turn’s events one observation records, loudly.
See ExecutionConfig::max_observed_events: an observation that hits
the cap fails every assertion about events rather than passing over a
ledger it only half read.
Sourcepub fn including_tag(self, tag: impl Into<Tag>) -> Self
pub fn including_tag(self, tag: impl Into<Tag>) -> Self
Restricts the run to items carrying tag.
Sourcepub fn excluding_tag(self, tag: impl Into<Tag>) -> Self
pub fn excluding_tag(self, tag: impl Into<Tag>) -> Self
Excludes items carrying tag, whatever else selects them.
Sourcepub fn from_toml_str(source: &str) -> Result<Self, ConfigError>
pub fn from_toml_str(source: &str) -> Result<Self, ConfigError>
Parses a configuration from TOML.
§Errors
ConfigError::Parse when the document is malformed or carries a key
this crate does not understand.
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
pub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
Reads a configuration from a TOML file.
§Errors
ConfigError::Readwhen the file cannot be read;ConfigError::Parsewhen its contents are not a configuration.
Sourcepub const fn validate(&self) -> Result<(), ConfigError>
pub const fn validate(&self) -> Result<(), ConfigError>
Checks the configuration is one this crate will run.
§Errors
ConfigError::ZeroSamples— an item that never executes has no result, not an empty one;ConfigError::ZeroVotes— a judge with no votes has no verdict.
Trait Implementations§
Source§impl Clone for EvalConfig
impl Clone for EvalConfig
Source§impl Debug for EvalConfig
impl Debug for EvalConfig
Source§impl Default for EvalConfig
impl Default for EvalConfig
Source§impl<'de> Deserialize<'de> for EvalConfigwhere
EvalConfig: Default,
impl<'de> Deserialize<'de> for EvalConfigwhere
EvalConfig: Default,
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>,
impl Eq for EvalConfig
Source§impl PartialEq for EvalConfig
impl PartialEq for EvalConfig
Source§impl Serialize for EvalConfig
impl Serialize for EvalConfig
impl StructuralPartialEq for EvalConfig
Auto Trait Implementations§
impl Freeze for EvalConfig
impl RefUnwindSafe for EvalConfig
impl Send for EvalConfig
impl Sync for EvalConfig
impl Unpin for EvalConfig
impl UnsafeUnpin for EvalConfig
impl UnwindSafe for EvalConfig
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
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.