Struct TraceExpects
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.
Trait Implementations§
Source§impl Clone for TraceExpects
impl Clone for TraceExpects
Source§fn clone(&self) -> TraceExpects
fn clone(&self) -> TraceExpects
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TraceExpects
impl Debug for TraceExpects
Source§impl Default for TraceExpects
impl Default for TraceExpects
Source§fn default() -> TraceExpects
fn default() -> TraceExpects
Source§impl<'de> Deserialize<'de> for TraceExpects
impl<'de> Deserialize<'de> for TraceExpects
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TraceExpects
impl RefUnwindSafe for TraceExpects
impl Send for TraceExpects
impl Sync for TraceExpects
impl Unpin for TraceExpects
impl UnsafeUnpin for TraceExpects
impl UnwindSafe for TraceExpects
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more