Expand description
Async Metric trait and EvalRunner execution engine.
§Example
use traitclaw_eval::runner::{AsyncMetric, EvalRunner};
use traitclaw_eval::{EvalSuite, TestCase};
use async_trait::async_trait;
struct AlwaysOne;
#[async_trait]
impl AsyncMetric for AlwaysOne {
fn name(&self) -> &'static str { "always_one" }
async fn score(&self, _input: &str, _output: &str, _kw: &[&str]) -> f64 { 1.0 }
}
let runner = EvalRunner::new().metric(Box::new(AlwaysOne)).threshold(0.8);Structs§
- Eval
Runner - Evaluation runner — executes a suite against an agent using async metrics.
- Sync
Metric Adapter - Wraps a sync
Metricimpl as anAsyncMetric.
Traits§
- Async
Metric - Async trait for evaluation metrics.
- Eval
Agent - A callable async agent for use with
EvalRunner.