pub struct TestCaseBuilder { /* private fields */ }Expand description
Builder for constructing test cases fluently.
Implementations§
Source§impl TestCaseBuilder
impl TestCaseBuilder
pub fn new(id: impl Into<String>, user_message: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
pub fn tag(self, tag: impl Into<String>) -> Self
pub fn config(self, config: AgentConfig) -> Self
pub fn config_json(self, data: Value) -> Self
pub fn retries(self, n: usize) -> Self
pub fn consensus(self, runs: usize, required: usize) -> Self
pub fn timeout(self, duration: Duration) -> Self
pub fn expect_tools(self, tools: &[&str]) -> Self
pub fn forbid_tools(self, tools: &[&str]) -> Self
pub fn expect_any_tool(self) -> Self
pub fn expect_no_tools(self) -> Self
pub fn expect_text_contains(self, s: impl Into<String>) -> Self
pub fn expect_text_not_contains(self, s: impl Into<String>) -> Self
pub fn expect_turns(self, range: RangeInclusive<usize>) -> Self
pub fn expect_tools_within_allowlist(self) -> Self
pub fn expect_no_error(self) -> Self
pub fn expect_tool_args(self, tool: impl Into<String>, args: Value) -> Self
pub fn expect_tool_args_contain( self, tool: impl Into<String>, partial: Value, ) -> Self
pub fn expect_tool_arg( self, tool: impl Into<String>, param: impl Into<String>, value: Value, ) -> Self
pub fn expect_tool_arg_exists( self, tool: impl Into<String>, param: impl Into<String>, ) -> Self
pub fn expect_tool_call_count( self, tool: impl Into<String>, count: usize, ) -> Self
pub fn expect_tool_call_order(self, order: &[&str]) -> Self
pub fn expect_tool_on_turn(self, turn: usize, tool: impl Into<String>) -> Self
pub fn expect<F>(self, f: F) -> Self
pub fn with_role(self, role: &str) -> Self
pub fn expect_tools_in_turn_range( self, range: RangeInclusive<usize>, tools: &[&str], ) -> Self
pub fn forbid_tools_in_turn_range( self, range: RangeInclusive<usize>, tools: &[&str], ) -> Self
pub fn expect_final_tool(self, tool: &str) -> Self
pub fn expect_final_tool_arg( self, tool: &str, param: &str, value: Value, ) -> Self
Sourcepub fn expect_gathering_phase(self, gather_tools: &[&str]) -> Self
pub fn expect_gathering_phase(self, gather_tools: &[&str]) -> Self
Shorthand: gathering tools before default action tools (say_to_user, task_fully_completed).
Sourcepub fn expect_gathering_before_action(
self,
gather_tools: &[&str],
action_tools: &[&str],
) -> Self
pub fn expect_gathering_before_action( self, gather_tools: &[&str], action_tools: &[&str], ) -> Self
Explicit: gathering tools before specified action tools.
pub fn expect_tool_only_on_final_turn(self, tool: &str) -> Self
pub fn build(self) -> TestCase
Auto Trait Implementations§
impl Freeze for TestCaseBuilder
impl !RefUnwindSafe for TestCaseBuilder
impl Send for TestCaseBuilder
impl Sync for TestCaseBuilder
impl Unpin for TestCaseBuilder
impl UnsafeUnpin for TestCaseBuilder
impl !UnwindSafe for TestCaseBuilder
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