Class PairwiseMetricSpec.Builder

java.lang.Object
com.google.genai.types.PairwiseMetricSpec.Builder
Enclosing class:
PairwiseMetricSpec

public abstract static class PairwiseMetricSpec.Builder extends Object
Builder for PairwiseMetricSpec.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • metricPromptTemplate

      public abstract PairwiseMetricSpec.Builder metricPromptTemplate(String metricPromptTemplate)
      Setter for metricPromptTemplate.

      metricPromptTemplate: Required. Metric prompt template for pairwise metric.

    • clearMetricPromptTemplate

      @CanIgnoreReturnValue public PairwiseMetricSpec.Builder clearMetricPromptTemplate()
      Clears the value of metricPromptTemplate field.
    • baselineResponseFieldName

      public abstract PairwiseMetricSpec.Builder baselineResponseFieldName(String baselineResponseFieldName)
      Setter for baselineResponseFieldName.

      baselineResponseFieldName: Optional. The field name of the baseline response.

    • clearBaselineResponseFieldName

      @CanIgnoreReturnValue public PairwiseMetricSpec.Builder clearBaselineResponseFieldName()
      Clears the value of baselineResponseFieldName field.
    • candidateResponseFieldName

      public abstract PairwiseMetricSpec.Builder candidateResponseFieldName(String candidateResponseFieldName)
      Setter for candidateResponseFieldName.

      candidateResponseFieldName: Optional. The field name of the candidate response.

    • clearCandidateResponseFieldName

      @CanIgnoreReturnValue public PairwiseMetricSpec.Builder clearCandidateResponseFieldName()
      Clears the value of candidateResponseFieldName field.
    • customOutputFormatConfig

      public abstract PairwiseMetricSpec.Builder customOutputFormatConfig(CustomOutputFormatConfig customOutputFormatConfig)
      Setter for customOutputFormatConfig.

      customOutputFormatConfig: Optional. CustomOutputFormatConfig allows customization of metric output. When this config is set, the default output is replaced with the raw output string. If a custom format is chosen, the `pairwise_choice` and `explanation` fields in the corresponding metric result will be empty.

    • customOutputFormatConfig

      @CanIgnoreReturnValue public PairwiseMetricSpec.Builder customOutputFormatConfig(CustomOutputFormatConfig.Builder customOutputFormatConfigBuilder)
      Setter for customOutputFormatConfig builder.

      customOutputFormatConfig: Optional. CustomOutputFormatConfig allows customization of metric output. When this config is set, the default output is replaced with the raw output string. If a custom format is chosen, the `pairwise_choice` and `explanation` fields in the corresponding metric result will be empty.

    • clearCustomOutputFormatConfig

      @CanIgnoreReturnValue public PairwiseMetricSpec.Builder clearCustomOutputFormatConfig()
      Clears the value of customOutputFormatConfig field.
    • systemInstruction

      public abstract PairwiseMetricSpec.Builder systemInstruction(String systemInstruction)
      Setter for systemInstruction.

      systemInstruction: Optional. System instructions for pairwise metric.

    • clearSystemInstruction

      @CanIgnoreReturnValue public PairwiseMetricSpec.Builder clearSystemInstruction()
      Clears the value of systemInstruction field.
    • build

      public abstract PairwiseMetricSpec build()