swink-agent-eval 0.7.8

Evaluation framework for swink-agent: trajectory tracing, golden path verification, and cost governance
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! YAML loading support for eval sets (requires `yaml` feature).

use std::fs;
use std::path::Path;

use crate::error::EvalError;
use crate::types::EvalSet;

/// Load an [`EvalSet`] from a YAML file.
///
/// All [`ResponseCriteria`](crate::ResponseCriteria) variants except `Custom`
/// are supported — `Custom` requires programmatic construction.
pub fn load_eval_set_yaml(path: &Path) -> Result<EvalSet, EvalError> {
    let contents = fs::read_to_string(path)?;
    Ok(serde_yaml::from_str(&contents)?)
}