#[non_exhaustive]pub struct Score {
pub evaluator: String,
pub value: f64,
pub passed: bool,
pub label: Option<String>,
pub explanation: Option<String>,
pub not_applicable: bool,
pub usage: Option<Usage>,
}Expand description
One evaluator’s verdict on one run.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.evaluator: StringThe evaluator’s name. An experiment sets it to
Evaluator::name.
value: f64From 0 (worst) to 1 (best).
passed: boolWhether the run passes this evaluator.
label: Option<String>A category, such as a judge’s grade; "error" when the evaluator
itself failed.
explanation: Option<String>Why, in words.
not_applicable: boolWhether the evaluator could not apply to this run, such as a
reference the case lacks. Such a score is shown as N/A and left out
of pass rates and means; passed is false.
usage: Option<Usage>The model tokens the evaluator spent, when it called a model (an
LlmJudge’s). The report adds them to its totals.
Implementations§
Source§impl Score
impl Score
Sourcepub fn new(evaluator: impl Into<String>, value: f64, passed: bool) -> Self
pub fn new(evaluator: impl Into<String>, value: f64, passed: bool) -> Self
A score of value, clamped to 0..=1 (NaN is 0).
Sourcepub fn not_applicable(
evaluator: impl Into<String>,
explanation: impl Into<String>,
) -> Self
pub fn not_applicable( evaluator: impl Into<String>, explanation: impl Into<String>, ) -> Self
Not applicable to the run, with why: shown as N/A and left out of pass rates and means.
Sourcepub fn fail(
evaluator: impl Into<String>,
explanation: impl Into<String>,
) -> Self
pub fn fail( evaluator: impl Into<String>, explanation: impl Into<String>, ) -> Self
A failure: 0, with why.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Set the label.
Sourcepub fn with_explanation(self, explanation: impl Into<String>) -> Self
pub fn with_explanation(self, explanation: impl Into<String>) -> Self
Set the explanation.
Sourcepub fn with_usage(self, usage: Usage) -> Self
pub fn with_usage(self, usage: Usage) -> Self
Record the model tokens the evaluation spent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Score
impl<'de> Deserialize<'de> for Score
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 StructuralPartialEq for Score
Auto Trait Implementations§
impl Forget for Score
impl Freeze for Score
impl Move for Score
impl RefUnwindSafe for Score
impl Send for Score
impl Sync for Score
impl Unpin for Score
impl UnsafeUnpin for Score
impl UnwindSafe for Score
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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