Class JsonataMetric

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

public class JsonataMetric extends Object
JSONata metric evaluator.

Evaluates the output using a JSONata expression provided in the reference. The expression should return a truthy value for pass, falsy for fail.

  • Constructor Details

    • JsonataMetric

      public JsonataMetric()
  • Method Details

    • evaluate

      public EvalResponse evaluate(EvalDataPoint dataPoint)
      Evaluates the output using the JSONata expression in the reference.
      Parameters:
      dataPoint - the evaluation data point
      Returns:
      the evaluation response