Table of Contents

Class AutoraterConfig

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Autorater config used for evaluation.

public record AutoraterConfig : IEquatable<AutoraterConfig>
Inheritance
AutoraterConfig
Implements
Inherited Members

Properties

AutoraterModel

The fully qualified name of the publisher model or tuned autorater endpoint to use. Publisher model format: projects/{project}/locations/{location}/publishers/{publisher}/models/{model} Tuned model endpoint format: projects/{project}/locations/{location}/endpoints/{endpoint}

[JsonPropertyName("autoraterModel")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? AutoraterModel { get; set; }

Property Value

string

FlipEnabled

Optional. Default is true. Whether to flip the candidate and baseline responses. This is only applicable to the pairwise metric. If enabled, also provide PairwiseMetricSpec.candidate_response_field_name and PairwiseMetricSpec.baseline_response_field_name. When rendering PairwiseMetricSpec.metric_prompt_template, the candidate and baseline fields will be flipped for half of the samples to reduce bias.

[JsonPropertyName("flipEnabled")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? FlipEnabled { get; set; }

Property Value

bool?

GenerationConfig

Configuration options for model generation and outputs.

[JsonPropertyName("generationConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GenerationConfig? GenerationConfig { get; set; }

Property Value

GenerationConfig

SamplingCount

Number of samples for each instance in the dataset. If not specified, the default is 4. Minimum value is 1, maximum value is 32.

[JsonPropertyName("samplingCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? SamplingCount { get; set; }

Property Value

int?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a AutoraterConfig object.

public static AutoraterConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

AutoraterConfig

The deserialized AutoraterConfig object, or null if deserialization fails.