pub struct TestCase {
pub name: String,
pub skill: PathBuf,
pub input: String,
pub user: Option<SimulatedUser>,
pub evals: Vec<Eval>,
}Expand description
One test case.
Fields§
§name: StringHuman-readable name (defaults to the file stem when loaded from a file).
skill: PathBufPath to the skill directory under test, relative to the test-case file.
input: StringThe initial data/prompt handed to the skill as the first user message.
user: Option<SimulatedUser>Present for multi-turn cases; absent for single-turn.
evals: Vec<Eval>The evals that decide whether this case passes. Must be non-empty.
Implementations§
Source§impl TestCase
impl TestCase
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Load a test case from a YAML file. The name defaults to the file stem
and skill is resolved relative to the file’s directory.
§Errors
Error::Io if the file cannot be read, Error::Yaml on parse
failure, and Error::Invalid if the case is internally inconsistent.
Sourcepub fn is_multi_turn(&self) -> bool
pub fn is_multi_turn(&self) -> bool
Whether this is a multi-turn case (has a simulated user).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TestCase
impl<'de> Deserialize<'de> for TestCase
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for TestCase
Auto Trait Implementations§
impl Freeze for TestCase
impl RefUnwindSafe for TestCase
impl Send for TestCase
impl Sync for TestCase
impl Unpin for TestCase
impl UnsafeUnpin for TestCase
impl UnwindSafe for TestCase
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