pub struct TraceExpects {
pub response_contains: Vec<String>,
pub response_not_contains: Vec<String>,
pub tools_used: Vec<String>,
pub tools_not_used: Vec<String>,
pub max_tool_calls: Option<usize>,
pub all_tools_succeeded: Option<bool>,
pub response_matches: Vec<String>,
pub min_tool_calls: Option<usize>,
pub exact_tool_calls: Option<usize>,
pub tool_arguments_contain: Vec<ToolPayloadExpect>,
pub tool_results_contain: Vec<ToolPayloadExpect>,
}Expand description
Declarative expectations for grading a run.
Unknown keys are rejected so a typoed expectation cannot degrade a case
into a silent no-op. See TraceExpects::is_empty for the companion
guard against a fixture that declares no expectation at all.
Fields§
§response_contains: Vec<String>Substrings the final response must contain.
response_not_contains: Vec<String>Substrings the final response must NOT contain.
tools_used: Vec<String>Tool names that must have been called.
tools_not_used: Vec<String>Tool names that must NOT have been called.
max_tool_calls: Option<usize>Upper bound on the number of tool calls.
all_tools_succeeded: Option<bool>If set, whether every tool call must have succeeded.
response_matches: Vec<String>Regex patterns the final response must match.
min_tool_calls: Option<usize>Lower bound on the number of tool calls.
exact_tool_calls: Option<usize>Exact number of tool calls the run must have made. Unlike tools_used
(existential) and max_tool_calls (upper bound), this fails when a
dispatch the fixture claims is missing.
tool_arguments_contain: Vec<ToolPayloadExpect>Substrings that must appear in the arguments dispatched to a tool.
tool_results_contain: Vec<ToolPayloadExpect>Substrings that must appear in the result a tool returned.
Implementations§
Source§impl TraceExpects
impl TraceExpects
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True when the fixture declares no effective assertion.
evaluate_expects produces one grade per declared expectation, and
CaseReport::passed() is vacuously true over zero grades. A case in
this state exercises the agent but certifies nothing, so a required
gate must reject it at load time rather than report it green.