Class Metric
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
The metric used for evaluation during model tuning.
public class Metric
- Inheritance
-
Metric
- Inherited Members
- Extension Methods
Remarks
Set the convenience properties (Name, PromptTemplate, JudgeModelSystemInstruction, ReturnRawOutput) and TuningClient converts them to the wire format (ExactMatchSpec, BleuSpec, RougeSpec or PointwiseMetricSpec plus AggregationMetrics) the same way the google-genai SDK does. The wire-format properties can also be set directly.
Properties
AggregationMetrics
Wire format. The aggregation metrics to compute (for example AVERAGE, STANDARD_DEVIATION).
[JsonPropertyName("aggregationMetrics")]
public List<string>? AggregationMetrics { get; set; }
Property Value
BleuSpec
Wire format. Spec for the BLEU metric.
[JsonPropertyName("bleuSpec")]
public JsonObject? BleuSpec { get; set; }
Property Value
ExactMatchSpec
Wire format. Spec for the exact match metric.
[JsonPropertyName("exactMatchSpec")]
public JsonObject? ExactMatchSpec { get; set; }
Property Value
JudgeModelSystemInstruction
The system instruction for the judge model.
[JsonPropertyName("judgeModelSystemInstruction")]
public string? JudgeModelSystemInstruction { get; set; }
Property Value
Name
The name of the metric (for example exact_match, bleu, rouge_l_sum or a custom name
used together with PromptTemplate).
[JsonPropertyName("name")]
public string? Name { get; set; }
Property Value
PointwiseMetricSpec
Wire format. Spec for a pointwise (model-based) metric.
[JsonPropertyName("pointwiseMetricSpec")]
public JsonObject? PointwiseMetricSpec { get; set; }
Property Value
PromptTemplate
The prompt template for the metric.
[JsonPropertyName("promptTemplate")]
public string? PromptTemplate { get; set; }
Property Value
ReturnRawOutput
Whether to return the raw output from the judge model.
[JsonPropertyName("returnRawOutput")]
public bool? ReturnRawOutput { get; set; }
Property Value
- bool?
RougeSpec
Wire format. Spec for the ROUGE metric (for example {"rougeType": "rougeLSum"}).
[JsonPropertyName("rougeSpec")]
public JsonObject? RougeSpec { get; set; }