pub struct Judge { /* private fields */ }Expand description
Grades open-ended answers against a rubric, using a second model.
Kept separate from grade, which stays synchronous and pure. A judge is a
model, so it is slow, costs money, and can be wrong — the deterministic
checks should never have to wait behind it or inherit its uncertainty.
Implementations§
Source§impl Judge
impl Judge
pub fn new(provider: Box<dyn Provider>, model: Option<String>) -> Self
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Override the verdict budget. Only worth touching for a judge that reasons at unusual length.
pub fn model(&self) -> &str
Sourcepub async fn assess(
&self,
prompt: &str,
rubric: &str,
answer: &str,
) -> Result<Verdict>
pub async fn assess( &self, prompt: &str, rubric: &str, answer: &str, ) -> Result<Verdict>
Grade one answer. The judge gets no tools and no history.
Sourcepub async fn check(&self, case: &EvalCase, answer: &str) -> Option<Check>
pub async fn check(&self, case: &EvalCase, answer: &str) -> Option<Check>
Grade a case’s answer and return the check to append.
A judge that cannot be reached produces a failing check, never a skipped one. A case whose only real assertion silently evaporates is worse than a case that fails loudly.
Auto Trait Implementations§
impl !RefUnwindSafe for Judge
impl !UnwindSafe for Judge
impl Freeze for Judge
impl Send for Judge
impl Sync for Judge
impl Unpin for Judge
impl UnsafeUnpin for Judge
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