pub struct Expectation {
pub tool_trajectory: Vec<ExpectedToolCall>,
pub state: Vec<StatePredicate>,
pub forbid_tools: Vec<String>,
pub max_cost_usd: Option<f64>,
pub max_latency_ms: Option<u64>,
}Expand description
The declarative expectations of an EvalCase.
Expectations stay data (JSON-serializable, diffable); they become
executable Assertions via Expectation::assertions. Empty sections
are omitted on the wire, so a case declares only what it checks.
Fields§
§tool_trajectory: Vec<ExpectedToolCall>The tool calls a correct run makes, as an ordered subsequence: each
expected call must appear in order, but the run may make additional
calls between them. Empty means “no trajectory requirement” — use
forbid_tools to require tool-free runs.
state: Vec<StatePredicate>Predicates over the run’s final state.
forbid_tools: Vec<String>Tools a correct run never calls.
max_cost_usd: Option<f64>Upper bound on the run’s total journaled cost in USD.
max_latency_ms: Option<u64>Upper bound on the run’s wall latency in milliseconds.
Implementations§
Source§impl Expectation
impl Expectation
Sourcepub fn assertions(&self) -> Vec<Assertion>
pub fn assertions(&self) -> Vec<Assertion>
Convert into executable assertions. Each expectation section maps to
at most one assertion (state maps to one per predicate), so a case
with a trajectory, two state predicates, and a latency bound yields
four assertions, each reported and aggregated separately.