Package dev.dokimos.core.conversation
Class TrajectoryEvaluator.Builder
java.lang.Object
dev.dokimos.core.conversation.TrajectoryEvaluator.Builder
- Enclosing class:
TrajectoryEvaluator
Builder for constructing trajectory evaluators.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregationStrategy(AggregationStrategy strategy) Sets the score aggregation strategy.build()Builds the trajectory evaluator.criteria(List<EvaluationCriterion> criteria) Sets all evaluation criteria.criterion(EvaluationCriterion criterion) Adds an evaluation criterion.includePerCriterionScores(boolean include) Sets whether to include per-criterion scores in the result metadata.Sets the JudgeLM to use for evaluation.Sets the evaluator name.threshold(double threshold) Sets the minimum score threshold for success.trajectoryKey(String key) Sets the key used to retrieve the trajectory from actualOutputs.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the evaluator name.- Parameters:
name- the evaluator name- Returns:
- this builder
-
threshold
Sets the minimum score threshold for success.- Parameters:
threshold- the threshold value- Returns:
- this builder
-
judge
Sets the JudgeLM to use for evaluation.- Parameters:
judge- the JudgeLM instance- Returns:
- this builder
-
criterion
Adds an evaluation criterion.- Parameters:
criterion- the criterion to add- Returns:
- this builder
-
criteria
Sets all evaluation criteria.- Parameters:
criteria- the list of criteria- Returns:
- this builder
-
aggregationStrategy
Sets the score aggregation strategy.- Parameters:
strategy- the aggregation strategy- Returns:
- this builder
-
trajectoryKey
Sets the key used to retrieve the trajectory from actualOutputs.Default is "trajectory".
- Parameters:
key- the key name- Returns:
- this builder
-
includePerCriterionScores
Sets whether to include per-criterion scores in the result metadata.Default is true.
- Parameters:
include- true to include per-criterion scores- Returns:
- this builder
-
build
Builds the trajectory evaluator.- Returns:
- a new trajectory evaluator
- Throws:
IllegalStateException- if required fields are not set
-