Package com.google.genai.types
Class PairwiseMetricSpec
-
- All Implemented Interfaces:
public abstract class PairwiseMetricSpec extends JsonSerializable
Spec for pairwise metric.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classPairwiseMetricSpec.BuilderBuilder for PairwiseMetricSpec.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description PairwiseMetricSpec()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>metricPromptTemplate()Required. abstract Optional<String>baselineResponseFieldName()Optional. abstract Optional<String>candidateResponseFieldName()Optional. abstract Optional<CustomOutputFormatConfig>customOutputFormatConfig()Optional. abstract Optional<String>systemInstruction()Optional. static PairwiseMetricSpec.Builderbuilder()Instantiates a builder for PairwiseMetricSpec. abstract PairwiseMetricSpec.BuildertoBuilder()Creates a builder with the same values as this instance. static PairwiseMetricSpecfromJson(String jsonString)Deserializes a JSON string to a PairwiseMetricSpec object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
metricPromptTemplate
abstract Optional<String> metricPromptTemplate()
Required. Metric prompt template for pairwise metric.
-
baselineResponseFieldName
abstract Optional<String> baselineResponseFieldName()
Optional. The field name of the baseline response.
-
candidateResponseFieldName
abstract Optional<String> candidateResponseFieldName()
Optional. The field name of the candidate response.
-
customOutputFormatConfig
abstract Optional<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.
-
systemInstruction
abstract Optional<String> systemInstruction()
Optional. System instructions for pairwise metric.
-
builder
static PairwiseMetricSpec.Builder builder()
Instantiates a builder for PairwiseMetricSpec.
-
toBuilder
abstract PairwiseMetricSpec.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static PairwiseMetricSpec fromJson(String jsonString)
Deserializes a JSON string to a PairwiseMetricSpec object.
-
-
-
-