pub enum Assertion {
Show 23 variants
ExpectTools(Vec<String>),
ForbidTools(Vec<String>),
ExpectAnyTool,
ExpectNoTools,
ExpectTextContains(String),
ExpectTextNotContains(String),
ExpectTurns(RangeInclusive<usize>),
ExpectToolsWithinAllowlist,
ExpectNoError,
ExpectToolArgs(String, Value),
ExpectToolArgsContain(String, Value),
ExpectToolArg(String, String, Value),
ExpectToolArgExists(String, String),
ExpectToolCallCount(String, usize),
ExpectToolCallOrder(Vec<String>),
ExpectToolOnTurn(usize, String),
ExpectToolsInTurnRange(RangeInclusive<usize>, Vec<String>),
ForbidToolsInTurnRange(RangeInclusive<usize>, Vec<String>),
ExpectFinalTool(String),
ExpectFinalToolArg(String, String, Value),
ExpectGatheringBeforeAction(Vec<String>, Vec<String>),
ExpectToolOnlyOnFinalTurn(String),
Custom(Box<dyn Fn(&AgentOutput) -> Result<(), String> + Send + Sync>),
}Expand description
An assertion to evaluate against agent output.
Variants§
ExpectTools(Vec<String>)
ForbidTools(Vec<String>)
ExpectAnyTool
ExpectNoTools
ExpectTextContains(String)
ExpectTextNotContains(String)
ExpectTurns(RangeInclusive<usize>)
ExpectToolsWithinAllowlist
ExpectNoError
ExpectToolArgs(String, Value)
ExpectToolArgsContain(String, Value)
ExpectToolArg(String, String, Value)
ExpectToolArgExists(String, String)
ExpectToolCallCount(String, usize)
ExpectToolCallOrder(Vec<String>)
ExpectToolOnTurn(usize, String)
ExpectToolsInTurnRange(RangeInclusive<usize>, Vec<String>)
Tools must appear in the specified turn range.
ForbidToolsInTurnRange(RangeInclusive<usize>, Vec<String>)
Tools must NOT appear in the specified turn range.
ExpectFinalTool(String)
Last turn must contain this tool call.
ExpectFinalToolArg(String, String, Value)
Last turn’s tool call must have this argument value.
ExpectGatheringBeforeAction(Vec<String>, Vec<String>)
Gather tools must appear before action tools.
ExpectToolOnlyOnFinalTurn(String)
Tool appears on last turn and no other.
Custom(Box<dyn Fn(&AgentOutput) -> Result<(), String> + Send + Sync>)
Implementations§
Source§impl Assertion
impl Assertion
Sourcepub fn is_security(&self) -> bool
pub fn is_security(&self) -> bool
Whether this is a security-related assertion.
Sourcepub fn evaluate(
&self,
output: &AgentOutput,
available_tools: &[String],
) -> AssertionResult
pub fn evaluate( &self, output: &AgentOutput, available_tools: &[String], ) -> AssertionResult
Evaluate this assertion against agent output.
Auto Trait Implementations§
impl Freeze for Assertion
impl !RefUnwindSafe for Assertion
impl Send for Assertion
impl Sync for Assertion
impl Unpin for Assertion
impl UnsafeUnpin for Assertion
impl !UnwindSafe for Assertion
Blanket Implementations§
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
Mutably borrows from an owned value. Read more