Package com.google.genai.types
Class Metric
-
- All Implemented Interfaces:
public abstract class Metric extends JsonSerializable
The metric used for evaluation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classMetric.BuilderBuilder for Metric.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description Metric()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>name()The name of the metric. abstract Optional<String>promptTemplate()The prompt template for the metric. abstract Optional<String>judgeModelSystemInstruction()The system instruction for the judge model. abstract Optional<Boolean>returnRawOutput()Whether to return the raw output from the judge model. static Metric.Builderbuilder()Instantiates a builder for Metric. abstract Metric.BuildertoBuilder()Creates a builder with the same values as this instance. static MetricfromJson(String jsonString)Deserializes a JSON string to a Metric 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
-
promptTemplate
abstract Optional<String> promptTemplate()
The prompt template for the metric.
-
judgeModelSystemInstruction
abstract Optional<String> judgeModelSystemInstruction()
The system instruction for the judge model.
-
returnRawOutput
abstract Optional<Boolean> returnRawOutput()
Whether to return the raw output from the judge model.
-
builder
static Metric.Builder builder()
Instantiates a builder for Metric.
-
toBuilder
abstract Metric.Builder toBuilder()
Creates a builder with the same values as this instance.
-
-
-
-