Package com.google.genai.types
Class LLMBasedMetricSpec
-
- All Implemented Interfaces:
public abstract class LLMBasedMetricSpec extends JsonSerializable
Specification for an LLM based metric.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classLLMBasedMetricSpec.BuilderBuilder for LLMBasedMetricSpec.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description LLMBasedMetricSpec()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>metricPromptTemplate()Template for the prompt sent to the judge model. abstract Optional<String>systemInstruction()System instruction for the judge model. abstract Optional<AutoraterConfig>judgeAutoraterConfig()Optional configuration for the judge LLM (Autorater). abstract Optional<String>rubricGroupKey()Use a pre-defined group of rubrics associated with the input. abstract Optional<PredefinedMetricSpec>predefinedRubricGenerationSpec()Dynamically generate rubrics using a predefined spec. abstract Optional<RubricGenerationSpec>rubricGenerationSpec()Dynamically generate rubrics using this specification. abstract Optional<Map<String, Object>>additionalConfig()Optional. static LLMBasedMetricSpec.Builderbuilder()Instantiates a builder for LLMBasedMetricSpec. abstract LLMBasedMetricSpec.BuildertoBuilder()Creates a builder with the same values as this instance. static LLMBasedMetricSpecfromJson(String jsonString)Deserializes a JSON string to a LLMBasedMetricSpec 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()
Template for the prompt sent to the judge model.
-
systemInstruction
abstract Optional<String> systemInstruction()
System instruction for the judge model.
-
judgeAutoraterConfig
abstract Optional<AutoraterConfig> judgeAutoraterConfig()
Optional configuration for the judge LLM (Autorater).
-
rubricGroupKey
abstract Optional<String> rubricGroupKey()
Use a pre-defined group of rubrics associated with the input. Refers to a key in the rubric_groups map of EvaluationInstance.
-
predefinedRubricGenerationSpec
abstract Optional<PredefinedMetricSpec> predefinedRubricGenerationSpec()
Dynamically generate rubrics using a predefined spec.
-
rubricGenerationSpec
abstract Optional<RubricGenerationSpec> rubricGenerationSpec()
Dynamically generate rubrics using this specification.
-
additionalConfig
abstract Optional<Map<String, Object>> additionalConfig()
Optional. Optional additional configuration for the metric.
-
builder
static LLMBasedMetricSpec.Builder builder()
Instantiates a builder for LLMBasedMetricSpec.
-
toBuilder
abstract LLMBasedMetricSpec.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static LLMBasedMetricSpec fromJson(String jsonString)
Deserializes a JSON string to a LLMBasedMetricSpec object.
-
-
-
-