Skip to main content

TestCaseBuilder

Struct TestCaseBuilder 

Source
pub struct TestCaseBuilder { /* private fields */ }
Expand description

Builder for constructing test cases fluently.

Implementations§

Source§

impl TestCaseBuilder

Source

pub fn new(id: impl Into<String>, user_message: impl Into<String>) -> Self

Source

pub fn name(self, name: impl Into<String>) -> Self

Source

pub fn tag(self, tag: impl Into<String>) -> Self

Source

pub fn tags(self, tags: &[&str]) -> Self

Source

pub fn config(self, config: AgentConfig) -> Self

Source

pub fn config_json(self, data: Value) -> Self

Source

pub fn retries(self, n: usize) -> Self

Source

pub fn consensus(self, runs: usize, required: usize) -> Self

Source

pub fn timeout(self, duration: Duration) -> Self

Source

pub fn expect_tools(self, tools: &[&str]) -> Self

Source

pub fn forbid_tools(self, tools: &[&str]) -> Self

Source

pub fn expect_any_tool(self) -> Self

Source

pub fn expect_no_tools(self) -> Self

Source

pub fn expect_text_contains(self, s: impl Into<String>) -> Self

Source

pub fn expect_text_not_contains(self, s: impl Into<String>) -> Self

Source

pub fn expect_turns(self, range: RangeInclusive<usize>) -> Self

Source

pub fn expect_tools_within_allowlist(self) -> Self

Source

pub fn expect_no_error(self) -> Self

Source

pub fn expect_tool_args(self, tool: impl Into<String>, args: Value) -> Self

Source

pub fn expect_tool_args_contain( self, tool: impl Into<String>, partial: Value, ) -> Self

Source

pub fn expect_tool_arg( self, tool: impl Into<String>, param: impl Into<String>, value: Value, ) -> Self

Source

pub fn expect_tool_arg_exists( self, tool: impl Into<String>, param: impl Into<String>, ) -> Self

Source

pub fn expect_tool_call_count( self, tool: impl Into<String>, count: usize, ) -> Self

Source

pub fn expect_tool_call_order(self, order: &[&str]) -> Self

Source

pub fn expect_tool_on_turn(self, turn: usize, tool: impl Into<String>) -> Self

Source

pub fn expect<F>(self, f: F) -> Self
where F: Fn(&AgentOutput) -> Result<(), String> + Send + Sync + 'static,

Source

pub fn with_role(self, role: &str) -> Self

Source

pub fn expect_tools_in_turn_range( self, range: RangeInclusive<usize>, tools: &[&str], ) -> Self

Source

pub fn forbid_tools_in_turn_range( self, range: RangeInclusive<usize>, tools: &[&str], ) -> Self

Source

pub fn expect_final_tool(self, tool: &str) -> Self

Source

pub fn expect_final_tool_arg( self, tool: &str, param: &str, value: Value, ) -> Self

Source

pub fn expect_gathering_phase(self, gather_tools: &[&str]) -> Self

Shorthand: gathering tools before default action tools (say_to_user, task_fully_completed).

Source

pub fn expect_gathering_before_action( self, gather_tools: &[&str], action_tools: &[&str], ) -> Self

Explicit: gathering tools before specified action tools.

Source

pub fn expect_tool_only_on_final_turn(self, tool: &str) -> Self

Source

pub fn build(self) -> TestCase

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.