Skip to main content

EvalCase

Struct EvalCase 

Source
pub struct EvalCase {
Show 19 fields pub id: String, pub name: String, pub description: Option<String>, pub system_prompt: String, pub user_messages: Vec<String>, pub expected_trajectory: Option<Vec<ExpectedToolCall>>, pub expected_response: Option<ResponseCriteria>, pub expected_assertion: Option<Assertion>, pub expected_interactions: Option<Vec<InteractionExpectation>>, pub few_shot_examples: Vec<FewShotExample>, pub budget: Option<BudgetConstraints>, pub evaluators: Vec<String>, pub metadata: Value, pub attachments: Vec<Attachment>, pub session_id: Option<Uuid>, pub expected_environment_state: Option<Vec<EnvironmentState>>, pub expected_tool_intent: Option<ToolIntent>, pub semantic_tool_selection: bool, pub state_capture: Option<StateCapture>,
}
Expand description

A single evaluation scenario.

Defines the agent prompt, expected outcomes, and which evaluators to run.

Fields§

§id: String

Unique identifier for this case.

§name: String

Human-readable name.

§description: Option<String>

Optional description of what this case tests.

§system_prompt: String

System prompt for the agent.

§user_messages: Vec<String>

Initial user messages (the prompt).

§expected_trajectory: Option<Vec<ExpectedToolCall>>

Expected tool call trajectory (golden path).

§expected_response: Option<ResponseCriteria>

Expected final response criteria.

§expected_assertion: Option<Assertion>

Judge-evaluated assertion expected to hold after the run.

§expected_interactions: Option<Vec<InteractionExpectation>>

Expected interactions or hand-offs within the run.

§few_shot_examples: Vec<FewShotExample>

Prompt examples injected ahead of judge-backed evaluations.

§budget: Option<BudgetConstraints>

Cost/budget governance constraints.

§evaluators: Vec<String>

Names of evaluators to run. Empty means all registered evaluators.

§metadata: Value

Arbitrary metadata for user-defined extensions and filtering.

§attachments: Vec<Attachment>

Multimodal data references consumed by multimodal evaluators.

§session_id: Option<Uuid>

Stable case/session identifier. When absent, callers may derive one deterministically via Self::default_session_id.

§expected_environment_state: Option<Vec<EnvironmentState>>

Expected environment-state snapshots keyed by name (FR-013).

Compared against the output of state_capture via full JSON equality. Duplicate names are rejected at case-load time (FR-015, SC-009).

§expected_tool_intent: Option<ToolIntent>

Expected semantic tool intent for the tool-parameter evaluator (FR-012).

§semantic_tool_selection: bool

Enable semantic tool-selection scoring for this case (FR-011).

§state_capture: Option<StateCapture>

Callback that produces the actual environment state after the agent completes. Programmatic only — mirrors ResponseCriteria::Custom.

Implementations§

Source§

impl EvalCase

Source

pub fn content_fingerprint(&self) -> CaseFingerprint

Canonical serializable projection used by deterministic ID and cache-key derivation.

Source

pub fn default_session_id(&self) -> Uuid

Deterministically derive the default session ID for this case.

Programmatic-only closures such as state_capture and ResponseCriteria::Custom bodies are never serialized directly. Instead, this hashes a stable canonical fingerprint that preserves the presence of custom criteria while avoiding pointer-address instability.

Source

pub fn validate(&self) -> Result<(), EvalError>

Validate this case’s static configuration.

Trait Implementations§

Source§

impl Clone for EvalCase

Source§

fn clone(&self) -> EvalCase

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EvalCase

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EvalCase

Source§

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<&EvalCase> for CaseFingerprint

Source§

fn from(case: &EvalCase) -> Self

Converts to this type from the input type.
Source§

impl Serialize for EvalCase

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,