Package com.google.genai.types
Class Model
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Model
A trained machine learning model.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Model.Builderbuilder()Instantiates a builder for Model.abstract Optional<List<Checkpoint>>The checkpoints of the model.The default checkpoint id of a model version.Description of the model.Display name of the model.List of deployed models created from this base model.static ModelDeserializes a JSON string to a Model object.The maximum number of input tokens that the model can handle.labels()Labels with user-defined metadata to organize your models.The maximum temperature value used for sampling set when the dataset was saved.name()Resource name of the model.The maximum number of output tokens that the model can generate.List of actions that are supported by the model.Temperature value used for sampling set when the dataset was saved.thinking()Whether the model supports thinking features.abstract Model.BuilderCreates a builder with the same values as this instance.topK()Optional.topP()Optional.abstract Optional<TunedModelInfo>Information about the tuned model from the base model.version()Version ID of the model.Methods inherited from class com.google.genai.JsonSerializable
setMaxReadLength, stringToJsonNode, toJson
-
Constructor Details
-
Model
public Model()
-
-
Method Details
-
name
Resource name of the model. -
displayName
Display name of the model. -
description
Description of the model. -
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. -
endpoints
List of deployed models created from this base model. Note that a model could have been deployed to endpoints in different locations. -
labels
Labels with user-defined metadata to organize your models. -
tunedModelInfo
Information about the tuned model from the base model. -
inputTokenLimit
The maximum number of input tokens that the model can handle. -
outputTokenLimit
The maximum number of output tokens that the model can generate. -
supportedActions
List of actions that are supported by the model. -
defaultCheckpointId
The default checkpoint id of a model version. -
checkpoints
The checkpoints of the model. -
temperature
Temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness. -
maxTemperature
The maximum temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness. -
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. -
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. -
thinking
Whether the model supports thinking features. If true, thoughts are returned only if the model supports thought and thoughts are available. -
builder
Instantiates a builder for Model. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a Model object.
-