pub struct Experiment { /* private fields */ }Expand description
An evaluation: a target run on every case of a dataset, a number of times, each run scored by every evaluator; the report goes to the sinks.
Each run is an eval.trial span (fields eval.experiment, eval.case,
eval.repetition) inside an eval.experiment span, and the target’s own
spans (an agent’s invoke_agent) nest in it. After scoring, each score is
a gen_ai.evaluation.result event on the trial span, with the
OpenTelemetry GenAI fields gen_ai.evaluation.name,
gen_ai.evaluation.score.value, gen_ai.evaluation.score.label (the
score’s label, else pass or fail) and gen_ai.evaluation.explanation.
Implementations§
Source§impl Experiment
impl Experiment
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
An experiment named name: one repetition, four runs at a time.
Sourcepub fn evaluator(self, evaluator: impl Evaluator + 'static) -> Self
pub fn evaluator(self, evaluator: impl Evaluator + 'static) -> Self
Add an evaluator. Each one scores every run.
Sourcepub fn repetitions(self, repetitions: usize) -> Self
pub fn repetitions(self, repetitions: usize) -> Self
Run each case repetitions times, to measure how often a
nondeterministic target passes.
Sourcepub fn concurrency(self, concurrency: usize) -> Self
pub fn concurrency(self, concurrency: usize) -> Self
Run at most concurrency trials at a time (0 counts as 1).
Auto Trait Implementations§
impl !RefUnwindSafe for Experiment
impl !UnwindSafe for Experiment
impl Forget for Experiment
impl Freeze for Experiment
impl Move for Experiment
impl Send for Experiment
impl Sync for Experiment
impl Unpin for Experiment
impl UnsafeUnpin for Experiment
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
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> 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> ⓘ
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> ⓘ
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