pub struct EvalScore {
pub evaluator: String,
pub value: f64,
pub label: ScoreLabel,
pub layer: EvalLayer,
pub timing: EvalTiming,
pub explanation: Option<String>,
pub session_id: String,
pub run_id: Option<String>,
}Expand description
A single evaluation score.
Designed to map directly to an OpenTelemetry gen_ai.evaluation.result span event.
Fields§
§evaluator: StringName of the evaluator that produced this score (e.g. token_efficiency).
value: f64Normalized score value in [0.0, 1.0]. Higher is better.
label: ScoreLabelCategorical label (e.g. “good”, “warning”, “critical”).
layer: EvalLayerWhich layer of agent behavior this evaluates.
timing: EvalTimingWhether this was computed inline or async.
explanation: Option<String>Optional human-readable explanation.
session_id: StringSession ID this score belongs to.
run_id: Option<String>Run ID within the session (if applicable).
Implementations§
Source§impl EvalScore
impl EvalScore
Sourcepub fn new(
evaluator: impl Into<String>,
value: f64,
layer: EvalLayer,
timing: EvalTiming,
session_id: impl Into<String>,
) -> NousResult<Self>
pub fn new( evaluator: impl Into<String>, value: f64, layer: EvalLayer, timing: EvalTiming, session_id: impl Into<String>, ) -> NousResult<Self>
Create a new score, validating the value is in [0.0, 1.0].
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_run_id(self, run_id: impl Into<String>) -> Self
pub fn with_run_id(self, run_id: impl Into<String>) -> Self
Set the run ID.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EvalScore
impl<'de> Deserialize<'de> for EvalScore
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 From<&EvalScore> for ScoreSummary
impl From<&EvalScore> for ScoreSummary
Auto Trait Implementations§
impl Freeze for EvalScore
impl RefUnwindSafe for EvalScore
impl Send for EvalScore
impl Sync for EvalScore
impl Unpin for EvalScore
impl UnsafeUnpin for EvalScore
impl UnwindSafe for EvalScore
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