Class LengthEvaluator.Builder

java.lang.Object
dev.dokimos.core.evaluators.LengthEvaluator.Builder
Enclosing class:
LengthEvaluator

public static class LengthEvaluator.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      public LengthEvaluator.Builder name(String name)
      Sets the evaluator name.
      Parameters:
      name - the evaluator name
      Returns:
      this builder
    • threshold

      public LengthEvaluator.Builder threshold(double threshold)
      Sets the minimum score threshold for success.
      Parameters:
      threshold - the threshold value
      Returns:
      this builder
    • evaluationParams

      public LengthEvaluator.Builder evaluationParams(List<EvalTestCaseParam> evaluationParams)
      Sets which test case parameters to evaluate.
      Parameters:
      evaluationParams - the parameters to evaluate
      Returns:
      this builder
    • maximumOutputLength

      public LengthEvaluator.Builder maximumOutputLength(int maximumOutputLength)
      Sets the maximum allowed output length (inclusive). Required.
      Parameters:
      maximumOutputLength - the maximum length in code points, at least 1
      Returns:
      this builder
    • minimumOutputLength

      public LengthEvaluator.Builder minimumOutputLength(int minimumOutputLength)
      Sets the minimum allowed output length (inclusive). Defaults to 0.
      Parameters:
      minimumOutputLength - the minimum length in code points, at least 0
      Returns:
      this builder
    • build

      public LengthEvaluator build()
      Builds the evaluator.
      Returns:
      a new length evaluator
      Throws:
      IllegalStateException - if the maximum length is missing or less than 1, the minimum length is negative, or the minimum length exceeds the maximum length