Class Model
-
- All Implemented Interfaces:
public abstract class Model extends JsonSerializable
A trained machine learning model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classModel.BuilderBuilder for Model.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description Model()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>name()Resource name of the model. abstract Optional<String>displayName()Display name of the model. abstract Optional<String>description()Description of the model. abstract Optional<String>version()Version ID of the model. abstract Optional<List<Endpoint>>endpoints()List of deployed models created from this base model. abstract Optional<Map<String, String>>labels()Labels with user-defined metadata to organize your models. abstract Optional<TunedModelInfo>tunedModelInfo()Information about the tuned model from the base model. abstract Optional<Integer>inputTokenLimit()The maximum number of input tokens that the model can handle. abstract Optional<Integer>outputTokenLimit()The maximum number of output tokens that the model can generate. abstract Optional<List<String>>supportedActions()List of actions that are supported by the model. abstract Optional<String>defaultCheckpointId()The default checkpoint id of a model version. abstract Optional<List<Checkpoint>>checkpoints()The checkpoints of the model. abstract Optional<Float>temperature()Temperature value used for sampling set when the dataset was saved. abstract Optional<Float>maxTemperature()The maximum temperature value used for sampling set when the dataset was saved. abstract Optional<Float>topP()Optional. abstract Optional<Integer>topK()Optional. abstract Optional<Boolean>thinking()Whether the model supports thinking features. static Model.Builderbuilder()Instantiates a builder for Model. abstract Model.BuildertoBuilder()Creates a builder with the same values as this instance. static ModelfromJson(String jsonString)Deserializes a JSON string to a Model object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
displayName
abstract Optional<String> displayName()
Display name of the model.
-
description
abstract Optional<String> description()
Description of the model.
-
version
abstract Optional<String> 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
abstract Optional<List<Endpoint>> endpoints()
List of deployed models created from this base model. Note that a model could have been deployed to endpoints in different locations.
-
labels
abstract Optional<Map<String, String>> labels()
Labels with user-defined metadata to organize your models.
-
tunedModelInfo
abstract Optional<TunedModelInfo> tunedModelInfo()
Information about the tuned model from the base model.
-
inputTokenLimit
abstract Optional<Integer> inputTokenLimit()
The maximum number of input tokens that the model can handle.
-
outputTokenLimit
abstract Optional<Integer> outputTokenLimit()
The maximum number of output tokens that the model can generate.
-
supportedActions
abstract Optional<List<String>> supportedActions()
List of actions that are supported by the model.
-
defaultCheckpointId
abstract Optional<String> defaultCheckpointId()
The default checkpoint id of a model version.
-
checkpoints
abstract Optional<List<Checkpoint>> checkpoints()
The checkpoints of the model.
-
temperature
abstract Optional<Float> temperature()
Temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness.
-
maxTemperature
abstract Optional<Float> 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
abstract Optional<Float> 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
abstract Optional<Integer> 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
abstract Optional<Boolean> thinking()
Whether the model supports thinking features. If true, thoughts are returned only if the model supports thought and thoughts are available.
-
builder
static Model.Builder builder()
Instantiates a builder for Model.
-
toBuilder
abstract Model.Builder toBuilder()
Creates a builder with the same values as this instance.
-
-
-
-