Table of Contents

Class Model

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

A trained machine learning model.

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

Properties

Checkpoints

The checkpoints of the model.

[JsonPropertyName("checkpoints")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Checkpoint>? Checkpoints { get; set; }

Property Value

List<Checkpoint>

DefaultCheckpointId

The default checkpoint id of a model version.

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

Property Value

string

Description

Description of the model.

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

Property Value

string

DisplayName

Display name of the model.

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

Property Value

string

Endpoints

List of deployed models created from this base model. Note that a model could have been deployed to endpoints in different locations.

[JsonPropertyName("endpoints")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Endpoint>? Endpoints { get; set; }

Property Value

List<Endpoint>

InputTokenLimit

The maximum number of input tokens that the model can handle.

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

Property Value

int?

Labels

Labels with user-defined metadata to organize your models.

[JsonPropertyName("labels")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, string>? Labels { get; set; }

Property Value

Dictionary<string, string>

MaxTemperature

The maximum temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness.

[JsonPropertyName("maxTemperature")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? MaxTemperature { get; set; }

Property Value

double?

Name

Resource name of the model.

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

Property Value

string

OutputTokenLimit

The maximum number of output tokens that the model can generate.

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

Property Value

int?

SupportedActions

List of actions that are supported by the model.

[JsonPropertyName("supportedActions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? SupportedActions { get; set; }

Property Value

List<string>

Temperature

Temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness.

[JsonPropertyName("temperature")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? Temperature { get; set; }

Property Value

double?

Thinking

Whether the model supports thinking features. If true, thoughts are returned only if the model supports thought and thoughts are available.

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

Property Value

bool?

TopK

Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a top_k of 40 means the model will choose the next word from the 40 most likely words.

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

Property Value

int?

TopP

Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least top_p. This helps generate more diverse and less repetitive responses. For example, a top_p of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or top_p, but not both.

[JsonPropertyName("topP")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? TopP { get; set; }

Property Value

double?

TunedModelInfo

Information about the tuned model from the base model.

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

Property Value

TunedModelInfo

Version

Version ID of the model. A new version is committed when a new model version is uploaded or trained under an existing model ID. The version ID is an auto-incrementing decimal number in string representation.

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

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a Model object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

Model

The deserialized Model object, or null if deserialization fails.