pub struct Evaluator { /* private fields */ }Available on crate feature
eval only.Expand description
The main evaluator struct
Implementations§
Source§impl Evaluator
impl Evaluator
Sourcepub fn new(config: EvaluationConfig) -> Evaluator
pub fn new(config: EvaluationConfig) -> Evaluator
Create a new evaluator with default configuration
Sourcepub fn with_llm_judge(
config: EvaluationConfig,
judge_model: Arc<dyn Llm>,
) -> Evaluator
pub fn with_llm_judge( config: EvaluationConfig, judge_model: Arc<dyn Llm>, ) -> Evaluator
Create an evaluator with an LLM judge for semantic matching and rubric evaluation
Sourcepub fn set_llm_judge(&mut self, judge_model: Arc<dyn Llm>)
pub fn set_llm_judge(&mut self, judge_model: Arc<dyn Llm>)
Set the LLM judge model
Sourcepub fn has_llm_judge(&self) -> bool
pub fn has_llm_judge(&self) -> bool
Check if LLM judge is available
Sourcepub async fn evaluate_file(
&self,
agent: Arc<dyn Agent>,
path: impl AsRef<Path>,
) -> Result<EvaluationReport, EvalError>
pub async fn evaluate_file( &self, agent: Arc<dyn Agent>, path: impl AsRef<Path>, ) -> Result<EvaluationReport, EvalError>
Evaluate a test file against an agent
Sourcepub async fn evaluate_test_file(
&self,
agent: Arc<dyn Agent>,
test_file: &TestFile,
) -> Result<EvaluationReport, EvalError>
pub async fn evaluate_test_file( &self, agent: Arc<dyn Agent>, test_file: &TestFile, ) -> Result<EvaluationReport, EvalError>
Evaluate a TestFile struct
Sourcepub async fn evaluate_case(
&self,
agent: Arc<dyn Agent>,
eval_case: &EvalCase,
) -> Result<EvaluationResult, EvalError>
pub async fn evaluate_case( &self, agent: Arc<dyn Agent>, eval_case: &EvalCase, ) -> Result<EvaluationResult, EvalError>
Evaluate a single test case
Sourcepub async fn evaluate_cases_parallel(
&self,
agent: Arc<dyn Agent>,
cases: &[EvalCase],
concurrency: usize,
) -> Vec<Result<EvaluationResult, EvalError>>
pub async fn evaluate_cases_parallel( &self, agent: Arc<dyn Agent>, cases: &[EvalCase], concurrency: usize, ) -> Vec<Result<EvaluationResult, EvalError>>
Evaluate multiple test cases in parallel
Sourcepub async fn evaluate_directory(
&self,
agent: Arc<dyn Agent>,
dir: impl AsRef<Path>,
) -> Result<Vec<EvaluationReport>, EvalError>
pub async fn evaluate_directory( &self, agent: Arc<dyn Agent>, dir: impl AsRef<Path>, ) -> Result<Vec<EvaluationReport>, EvalError>
Evaluate a directory of test files
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Evaluator
impl !RefUnwindSafe for Evaluator
impl Send for Evaluator
impl Sync for Evaluator
impl Unpin for Evaluator
impl UnsafeUnpin for Evaluator
impl !UnwindSafe for Evaluator
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.