Class AnswerAccuracyMetric

java.lang.Object
com.google.genkit.plugins.evaluators.metrics.AnswerAccuracyMetric

public class AnswerAccuracyMetric extends Object
Answer Accuracy metric evaluator.

Measures the accuracy of the generated answer against a reference answer. Uses bidirectional comparison for semantic equivalence.

  • Constructor Details

  • Method Details

    • evaluate

      public EvalResponse evaluate(EvalDataPoint dataPoint) throws Exception
      Evaluates the accuracy of the output against the reference.
      Parameters:
      dataPoint - the evaluation data point
      Returns:
      the evaluation response
      Throws:
      Exception - if evaluation fails