Table of Contents

Class SupervisedTuningSpec

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

Supervised tuning spec for tuning.

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

Properties

ExportLastCheckpointOnly

Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false.

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

Property Value

bool?

HyperParameters

Optional. Hyperparameters for SFT.

[JsonPropertyName("hyperParameters")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SupervisedHyperParameters? HyperParameters { get; set; }

Property Value

SupervisedHyperParameters

TrainingDatasetUri

Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset.

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

Property Value

string

TuningMode

Tuning mode.

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

Property Value

TuningMode?

ValidationDatasetUri

Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset.

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

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a SupervisedTuningSpec object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

SupervisedTuningSpec

The deserialized SupervisedTuningSpec object, or null if deserialization fails.