pub struct EvalReport {
pub outcomes: Vec<CaseOutcome>,
pub temperature: f32,
pub backend: String,
pub system_prompt: String,
}Expand description
The aggregate report over a set of cases, plus latency/token statistics.
Fields§
§outcomes: Vec<CaseOutcome>One outcome per case, in run order.
temperature: f32The temperature the eval ran at (noted in the summary; default 0 for determinism).
backend: StringA short description of the backend the eval ran against (from ChatBackend::describe).
system_prompt: StringThe exact system prompt every case in this run used (the loop’s compact-vs-full selection). Stored
ONCE here rather than on each CaseOutcome (it is identical across cases), and shown at the top
of the run’s expander in the HTML report. #[serde(default)] keeps old result JSON loadable.
Implementations§
Source§impl EvalReport
impl EvalReport
Sourcepub fn new(
outcomes: Vec<CaseOutcome>,
temperature: f32,
backend: String,
system_prompt: String,
) -> Self
pub fn new( outcomes: Vec<CaseOutcome>, temperature: f32, backend: String, system_prompt: String, ) -> Self
Build a report from the per-case outcomes, recording the run temperature + backend label + the shared system prompt for the summary and the HTML report’s per-run expander.
Sourcepub fn accuracy(&self) -> f64
pub fn accuracy(&self) -> f64
Accuracy = fraction of cases that fully passed, in 0.0..=1.0. 0.0 for an empty report.
Sourcepub fn mean_latency(&self) -> Duration
pub fn mean_latency(&self) -> Duration
Mean per-case latency. Duration::ZERO for an empty report.
Sourcepub fn latency_percentile(&self, p: f64) -> Duration
pub fn latency_percentile(&self, p: f64) -> Duration
The p-quantile of per-case latency (p in 0.0..=1.0), via the nearest-rank method on the
sorted latencies. Duration::ZERO for an empty report.
Sourcepub fn p50_latency(&self) -> Duration
pub fn p50_latency(&self) -> Duration
Median (p50) per-case latency.
Sourcepub fn p95_latency(&self) -> Duration
pub fn p95_latency(&self) -> Duration
p95 per-case latency.
Sourcepub fn total_tokens(&self) -> Option<u32>
pub fn total_tokens(&self) -> Option<u32>
Total completion tokens across cases that reported a token count. None when NO case reported
any (so the summary can say “tokens unavailable” rather than print a misleading 0).
Sourcepub fn mean_tokens(&self) -> Option<f64>
pub fn mean_tokens(&self) -> Option<f64>
Mean completion tokens over the cases that reported a count; None when none reported.
Trait Implementations§
Source§impl Clone for EvalReport
impl Clone for EvalReport
Source§fn clone(&self) -> EvalReport
fn clone(&self) -> EvalReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more