Class Model.Builder

java.lang.Object
com.google.genai.types.Model.Builder
Enclosing class:
Model

public abstract static class Model.Builder extends Object
Builder for Model.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      public abstract Model.Builder name(String name)
      Setter for name.

      name: Resource name of the model.

    • clearName

      @CanIgnoreReturnValue public Model.Builder clearName()
      Clears the value of name field.
    • displayName

      public abstract Model.Builder displayName(String displayName)
      Setter for displayName.

      displayName: Display name of the model.

    • clearDisplayName

      @CanIgnoreReturnValue public Model.Builder clearDisplayName()
      Clears the value of displayName field.
    • description

      public abstract Model.Builder description(String description)
      Setter for description.

      description: Description of the model.

    • clearDescription

      @CanIgnoreReturnValue public Model.Builder clearDescription()
      Clears the value of description field.
    • version

      public abstract Model.Builder version(String version)
      Setter for version.

      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.

    • clearVersion

      @CanIgnoreReturnValue public Model.Builder clearVersion()
      Clears the value of version field.
    • endpoints

      public abstract Model.Builder endpoints(List<Endpoint> endpoints)
      Setter for endpoints.

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

    • endpoints

      @CanIgnoreReturnValue public Model.Builder endpoints(Endpoint... endpoints)
      Setter for endpoints.

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

    • endpoints

      @CanIgnoreReturnValue public Model.Builder endpoints(Endpoint.Builder... endpointsBuilders)
      Setter for endpoints builder.

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

    • clearEndpoints

      @CanIgnoreReturnValue public Model.Builder clearEndpoints()
      Clears the value of endpoints field.
    • labels

      public abstract Model.Builder labels(Map<String,String> labels)
      Setter for labels.

      labels: Labels with user-defined metadata to organize your models.

    • clearLabels

      @CanIgnoreReturnValue public Model.Builder clearLabels()
      Clears the value of labels field.
    • tunedModelInfo

      public abstract Model.Builder tunedModelInfo(TunedModelInfo tunedModelInfo)
      Setter for tunedModelInfo.

      tunedModelInfo: Information about the tuned model from the base model.

    • tunedModelInfo

      @CanIgnoreReturnValue public Model.Builder tunedModelInfo(TunedModelInfo.Builder tunedModelInfoBuilder)
      Setter for tunedModelInfo builder.

      tunedModelInfo: Information about the tuned model from the base model.

    • clearTunedModelInfo

      @CanIgnoreReturnValue public Model.Builder clearTunedModelInfo()
      Clears the value of tunedModelInfo field.
    • inputTokenLimit

      public abstract Model.Builder inputTokenLimit(Integer inputTokenLimit)
      Setter for inputTokenLimit.

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

    • clearInputTokenLimit

      @CanIgnoreReturnValue public Model.Builder clearInputTokenLimit()
      Clears the value of inputTokenLimit field.
    • outputTokenLimit

      public abstract Model.Builder outputTokenLimit(Integer outputTokenLimit)
      Setter for outputTokenLimit.

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

    • clearOutputTokenLimit

      @CanIgnoreReturnValue public Model.Builder clearOutputTokenLimit()
      Clears the value of outputTokenLimit field.
    • supportedActions

      public abstract Model.Builder supportedActions(List<String> supportedActions)
      Setter for supportedActions.

      supportedActions: List of actions that are supported by the model.

    • supportedActions

      @CanIgnoreReturnValue public Model.Builder supportedActions(String... supportedActions)
      Setter for supportedActions.

      supportedActions: List of actions that are supported by the model.

    • clearSupportedActions

      @CanIgnoreReturnValue public Model.Builder clearSupportedActions()
      Clears the value of supportedActions field.
    • defaultCheckpointId

      public abstract Model.Builder defaultCheckpointId(String defaultCheckpointId)
      Setter for defaultCheckpointId.

      defaultCheckpointId: The default checkpoint id of a model version.

    • clearDefaultCheckpointId

      @CanIgnoreReturnValue public Model.Builder clearDefaultCheckpointId()
      Clears the value of defaultCheckpointId field.
    • checkpoints

      public abstract Model.Builder checkpoints(List<Checkpoint> checkpoints)
      Setter for checkpoints.

      checkpoints: The checkpoints of the model.

    • checkpoints

      @CanIgnoreReturnValue public Model.Builder checkpoints(Checkpoint... checkpoints)
      Setter for checkpoints.

      checkpoints: The checkpoints of the model.

    • checkpoints

      @CanIgnoreReturnValue public Model.Builder checkpoints(Checkpoint.Builder... checkpointsBuilders)
      Setter for checkpoints builder.

      checkpoints: The checkpoints of the model.

    • clearCheckpoints

      @CanIgnoreReturnValue public Model.Builder clearCheckpoints()
      Clears the value of checkpoints field.
    • temperature

      public abstract Model.Builder temperature(Float temperature)
      Setter for temperature.

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

    • clearTemperature

      @CanIgnoreReturnValue public Model.Builder clearTemperature()
      Clears the value of temperature field.
    • maxTemperature

      public abstract Model.Builder maxTemperature(Float maxTemperature)
      Setter for maxTemperature.

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

    • clearMaxTemperature

      @CanIgnoreReturnValue public Model.Builder clearMaxTemperature()
      Clears the value of maxTemperature field.
    • topP

      public abstract Model.Builder topP(Float topP)
      Setter for topP.

      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.

    • clearTopP

      @CanIgnoreReturnValue public Model.Builder clearTopP()
      Clears the value of topP field.
    • topK

      public abstract Model.Builder topK(Integer topK)
      Setter for topK.

      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.

    • clearTopK

      @CanIgnoreReturnValue public Model.Builder clearTopK()
      Clears the value of topK field.
    • thinking

      public abstract Model.Builder thinking(boolean thinking)
      Setter for thinking.

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

    • clearThinking

      @CanIgnoreReturnValue public Model.Builder clearThinking()
      Clears the value of thinking field.
    • build

      public abstract Model build()