Class MetricConfig

java.lang.Object
com.google.genkit.plugins.evaluators.MetricConfig

public class MetricConfig extends Object
Configuration for a specific evaluation metric.

This class allows configuring individual metrics with their required dependencies like judge models and embedders.

  • Method Details

    • builder

      public static MetricConfig.Builder builder()
    • of

      public static MetricConfig of(GenkitMetric metricType)
      Creates a simple metric configuration with just the metric type.
      Parameters:
      metricType - the type of metric
      Returns:
      a new MetricConfig
    • withJudge

      public static MetricConfig withJudge(GenkitMetric metricType, String judge)
      Creates a metric configuration with a judge model.
      Parameters:
      metricType - the type of metric
      judge - the judge model name
      Returns:
      a new MetricConfig
    • withJudgeAndEmbedder

      public static MetricConfig withJudgeAndEmbedder(GenkitMetric metricType, String judge, String embedder)
      Creates a metric configuration with a judge model and embedder.
      Parameters:
      metricType - the type of metric
      judge - the judge model name
      embedder - the embedder name
      Returns:
      a new MetricConfig
    • getMetricType

      public GenkitMetric getMetricType()
    • getJudge

      public String getJudge()
    • getJudgeConfig

      public Map<String,Object> getJudgeConfig()
    • getEmbedder

      public String getEmbedder()
    • getEmbedderOptions

      public Map<String,Object> getEmbedderOptions()
    • getStatusOverrideFn

      public Function<Score,EvalStatus> getStatusOverrideFn()