Package dev.dokimos.core
Class BaseEvaluator
java.lang.Object
dev.dokimos.core.BaseEvaluator
- All Implemented Interfaces:
Evaluator
- Direct Known Subclasses:
ContextualRelevanceEvaluator,ExactMatchEvaluator,FaithfulnessEvaluator,HallucinationEvaluator,LLMJudgeEvaluator,PrecisionEvaluator,RecallEvaluator,RegexEvaluator,TaskCompletionEvaluator,ToolArgumentHallucinationEvaluator,ToolCallValidityEvaluator,ToolCorrectnessEvaluator,ToolDescriptionReliabilityEvaluator,ToolNameReliabilityEvaluator,TrajectoryEvaluator
Base class for implementing concrete evaluators.
Provides parameter validation before evaluation and async evaluation support.
-
Method Summary
Modifier and TypeMethodDescriptionfinal EvalResultevaluate(EvalTestCase testCase) Evaluates the test case and returns a scored result.evaluateAsync(EvalTestCase testCase) Evaluates the test case asynchronously using the common fork-join pool.evaluateAsync(EvalTestCase testCase, ExecutorService executor) Evaluates the test case asynchronously using the provided executor.name()Returns the evaluator name.doubleReturns the minimum score threshold for success.
-
Method Details
-
evaluate
Description copied from interface:EvaluatorEvaluates the test case and returns a scored result. -
name
Description copied from interface:EvaluatorReturns the evaluator name. -
threshold
public double threshold()Description copied from interface:EvaluatorReturns the minimum score threshold for success. -
evaluateAsync
Evaluates the test case asynchronously using the common fork-join pool.This method allows for non-blocking evaluation, which is useful when processing multiple test cases concurrently.
- Parameters:
testCase- the test case to evaluate- Returns:
- a CompletableFuture that will complete with the evaluation result
-
evaluateAsync
Evaluates the test case asynchronously using the provided executor.- Parameters:
testCase- the test case to evaluateexecutor- the executor to use for async execution- Returns:
- a CompletableFuture that will complete with the evaluation result
-