Class TuningJob.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • sdkHttpResponse

      public abstract TuningJob.Builder sdkHttpResponse(HttpResponse sdkHttpResponse)
      Setter for sdkHttpResponse.

      sdkHttpResponse: Used to retain the full HTTP response.

    • sdkHttpResponse

      @CanIgnoreReturnValue public TuningJob.Builder sdkHttpResponse(HttpResponse.Builder sdkHttpResponseBuilder)
      Setter for sdkHttpResponse builder.

      sdkHttpResponse: Used to retain the full HTTP response.

    • clearSdkHttpResponse

      @CanIgnoreReturnValue public TuningJob.Builder clearSdkHttpResponse()
      Clears the value of sdkHttpResponse field.
    • name

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

      name: Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`

    • clearName

      @CanIgnoreReturnValue public TuningJob.Builder clearName()
      Clears the value of name field.
    • state

      public abstract TuningJob.Builder state(JobState state)
      Setter for state.

      state: Output only. The detailed state of the job.

    • clearState

      @CanIgnoreReturnValue public TuningJob.Builder clearState()
      Clears the value of state field.
    • state

      @CanIgnoreReturnValue public TuningJob.Builder state(JobState.Known knownType)
      Setter for state given a known enum.

      state: Output only. The detailed state of the job.

    • state

      @CanIgnoreReturnValue public TuningJob.Builder state(String state)
      Setter for state given a string.

      state: Output only. The detailed state of the job.

    • createTime

      public abstract TuningJob.Builder createTime(Instant createTime)
      Setter for createTime.

      createTime: Output only. Time when the TuningJob was created.

    • clearCreateTime

      @CanIgnoreReturnValue public TuningJob.Builder clearCreateTime()
      Clears the value of createTime field.
    • startTime

      public abstract TuningJob.Builder startTime(Instant startTime)
      Setter for startTime.

      startTime: Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.

    • clearStartTime

      @CanIgnoreReturnValue public TuningJob.Builder clearStartTime()
      Clears the value of startTime field.
    • endTime

      public abstract TuningJob.Builder endTime(Instant endTime)
      Setter for endTime.

      endTime: Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.

    • clearEndTime

      @CanIgnoreReturnValue public TuningJob.Builder clearEndTime()
      Clears the value of endTime field.
    • updateTime

      public abstract TuningJob.Builder updateTime(Instant updateTime)
      Setter for updateTime.

      updateTime: Output only. Time when the TuningJob was most recently updated.

    • clearUpdateTime

      @CanIgnoreReturnValue public TuningJob.Builder clearUpdateTime()
      Clears the value of updateTime field.
    • error

      public abstract TuningJob.Builder error(GoogleRpcStatus error)
      Setter for error.

      error: Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.

    • error

      @CanIgnoreReturnValue public TuningJob.Builder error(GoogleRpcStatus.Builder errorBuilder)
      Setter for error builder.

      error: Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.

    • clearError

      @CanIgnoreReturnValue public TuningJob.Builder clearError()
      Clears the value of error field.
    • description

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

      description: Optional. The description of the TuningJob.

    • clearDescription

      @CanIgnoreReturnValue public TuningJob.Builder clearDescription()
      Clears the value of description field.
    • baseModel

      public abstract TuningJob.Builder baseModel(String baseModel)
      Setter for baseModel.

      baseModel: The base model that is being tuned. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models).

    • clearBaseModel

      @CanIgnoreReturnValue public TuningJob.Builder clearBaseModel()
      Clears the value of baseModel field.
    • tunedModel

      public abstract TuningJob.Builder tunedModel(TunedModel tunedModel)
      Setter for tunedModel.

      tunedModel: Output only. The tuned model resources associated with this TuningJob.

    • tunedModel

      @CanIgnoreReturnValue public TuningJob.Builder tunedModel(TunedModel.Builder tunedModelBuilder)
      Setter for tunedModel builder.

      tunedModel: Output only. The tuned model resources associated with this TuningJob.

    • clearTunedModel

      @CanIgnoreReturnValue public TuningJob.Builder clearTunedModel()
      Clears the value of tunedModel field.
    • preTunedModel

      public abstract TuningJob.Builder preTunedModel(PreTunedModel preTunedModel)
      Setter for preTunedModel.

      preTunedModel: The pre-tuned model for continuous tuning.

    • preTunedModel

      @CanIgnoreReturnValue public TuningJob.Builder preTunedModel(PreTunedModel.Builder preTunedModelBuilder)
      Setter for preTunedModel builder.

      preTunedModel: The pre-tuned model for continuous tuning.

    • clearPreTunedModel

      @CanIgnoreReturnValue public TuningJob.Builder clearPreTunedModel()
      Clears the value of preTunedModel field.
    • supervisedTuningSpec

      public abstract TuningJob.Builder supervisedTuningSpec(SupervisedTuningSpec supervisedTuningSpec)
      Setter for supervisedTuningSpec.

      supervisedTuningSpec: Tuning Spec for Supervised Fine Tuning.

    • supervisedTuningSpec

      @CanIgnoreReturnValue public TuningJob.Builder supervisedTuningSpec(SupervisedTuningSpec.Builder supervisedTuningSpecBuilder)
      Setter for supervisedTuningSpec builder.

      supervisedTuningSpec: Tuning Spec for Supervised Fine Tuning.

    • clearSupervisedTuningSpec

      @CanIgnoreReturnValue public TuningJob.Builder clearSupervisedTuningSpec()
      Clears the value of supervisedTuningSpec field.
    • preferenceOptimizationSpec

      public abstract TuningJob.Builder preferenceOptimizationSpec(PreferenceOptimizationSpec preferenceOptimizationSpec)
      Setter for preferenceOptimizationSpec.

      preferenceOptimizationSpec: Tuning Spec for Preference Optimization.

    • preferenceOptimizationSpec

      @CanIgnoreReturnValue public TuningJob.Builder preferenceOptimizationSpec(PreferenceOptimizationSpec.Builder preferenceOptimizationSpecBuilder)
      Setter for preferenceOptimizationSpec builder.

      preferenceOptimizationSpec: Tuning Spec for Preference Optimization.

    • clearPreferenceOptimizationSpec

      @CanIgnoreReturnValue public TuningJob.Builder clearPreferenceOptimizationSpec()
      Clears the value of preferenceOptimizationSpec field.
    • tuningDataStats

      public abstract TuningJob.Builder tuningDataStats(TuningDataStats tuningDataStats)
      Setter for tuningDataStats.

      tuningDataStats: Output only. The tuning data statistics associated with this TuningJob.

    • tuningDataStats

      @CanIgnoreReturnValue public TuningJob.Builder tuningDataStats(TuningDataStats.Builder tuningDataStatsBuilder)
      Setter for tuningDataStats builder.

      tuningDataStats: Output only. The tuning data statistics associated with this TuningJob.

    • clearTuningDataStats

      @CanIgnoreReturnValue public TuningJob.Builder clearTuningDataStats()
      Clears the value of tuningDataStats field.
    • encryptionSpec

      public abstract TuningJob.Builder encryptionSpec(EncryptionSpec encryptionSpec)
      Setter for encryptionSpec.

      encryptionSpec: Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.

    • encryptionSpec

      @CanIgnoreReturnValue public TuningJob.Builder encryptionSpec(EncryptionSpec.Builder encryptionSpecBuilder)
      Setter for encryptionSpec builder.

      encryptionSpec: Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.

    • clearEncryptionSpec

      @CanIgnoreReturnValue public TuningJob.Builder clearEncryptionSpec()
      Clears the value of encryptionSpec field.
    • partnerModelTuningSpec

      public abstract TuningJob.Builder partnerModelTuningSpec(PartnerModelTuningSpec partnerModelTuningSpec)
      Setter for partnerModelTuningSpec.

      partnerModelTuningSpec: Tuning Spec for open sourced and third party Partner models.

    • partnerModelTuningSpec

      @CanIgnoreReturnValue public TuningJob.Builder partnerModelTuningSpec(PartnerModelTuningSpec.Builder partnerModelTuningSpecBuilder)
      Setter for partnerModelTuningSpec builder.

      partnerModelTuningSpec: Tuning Spec for open sourced and third party Partner models.

    • clearPartnerModelTuningSpec

      @CanIgnoreReturnValue public TuningJob.Builder clearPartnerModelTuningSpec()
      Clears the value of partnerModelTuningSpec field.
    • evaluationConfig

      public abstract TuningJob.Builder evaluationConfig(EvaluationConfig evaluationConfig)
      Setter for evaluationConfig.

      evaluationConfig: Evaluation config for the tuning job.

    • evaluationConfig

      @CanIgnoreReturnValue public TuningJob.Builder evaluationConfig(EvaluationConfig.Builder evaluationConfigBuilder)
      Setter for evaluationConfig builder.

      evaluationConfig: Evaluation config for the tuning job.

    • clearEvaluationConfig

      @CanIgnoreReturnValue public TuningJob.Builder clearEvaluationConfig()
      Clears the value of evaluationConfig field.
    • customBaseModel

      public abstract TuningJob.Builder customBaseModel(String customBaseModel)
      Setter for customBaseModel.

      customBaseModel: Optional. The user-provided path to custom model weights. Set this field to tune a custom model. The path must be a Cloud Storage directory that contains the model weights in .safetensors format along with associated model metadata files. If this field is set, the base_model field must still be set to indicate which base model the custom model is derived from. This feature is only available for open source models.

    • clearCustomBaseModel

      @CanIgnoreReturnValue public TuningJob.Builder clearCustomBaseModel()
      Clears the value of customBaseModel field.
    • experiment

      public abstract TuningJob.Builder experiment(String experiment)
      Setter for experiment.

      experiment: Output only. The Experiment associated with this TuningJob.

    • clearExperiment

      @CanIgnoreReturnValue public TuningJob.Builder clearExperiment()
      Clears the value of experiment field.
    • labels

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

      labels: Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.

    • clearLabels

      @CanIgnoreReturnValue public TuningJob.Builder clearLabels()
      Clears the value of labels field.
    • outputUri

      public abstract TuningJob.Builder outputUri(String outputUri)
      Setter for outputUri.

      outputUri: Optional. Cloud Storage path to the directory where tuning job outputs are written to. This field is only available and required for open source models.

    • clearOutputUri

      @CanIgnoreReturnValue public TuningJob.Builder clearOutputUri()
      Clears the value of outputUri field.
    • pipelineJob

      public abstract TuningJob.Builder pipelineJob(String pipelineJob)
      Setter for pipelineJob.

      pipelineJob: Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`.

    • clearPipelineJob

      @CanIgnoreReturnValue public TuningJob.Builder clearPipelineJob()
      Clears the value of pipelineJob field.
    • serviceAccount

      public abstract TuningJob.Builder serviceAccount(String serviceAccount)
      Setter for serviceAccount.

      serviceAccount: The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account.

    • clearServiceAccount

      @CanIgnoreReturnValue public TuningJob.Builder clearServiceAccount()
      Clears the value of serviceAccount field.
    • tunedModelDisplayName

      public abstract TuningJob.Builder tunedModelDisplayName(String tunedModelDisplayName)
      Setter for tunedModelDisplayName.

      tunedModelDisplayName: Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. For continuous tuning, tuned_model_display_name will by default use the same display name as the pre-tuned model. If a new display name is provided, the tuning job will create a new model instead of a new version.

    • clearTunedModelDisplayName

      @CanIgnoreReturnValue public TuningJob.Builder clearTunedModelDisplayName()
      Clears the value of tunedModelDisplayName field.
    • veoTuningSpec

      public abstract TuningJob.Builder veoTuningSpec(VeoTuningSpec veoTuningSpec)
      Setter for veoTuningSpec.

      veoTuningSpec: Tuning Spec for Veo Tuning.

    • veoTuningSpec

      @CanIgnoreReturnValue public TuningJob.Builder veoTuningSpec(VeoTuningSpec.Builder veoTuningSpecBuilder)
      Setter for veoTuningSpec builder.

      veoTuningSpec: Tuning Spec for Veo Tuning.

    • clearVeoTuningSpec

      @CanIgnoreReturnValue public TuningJob.Builder clearVeoTuningSpec()
      Clears the value of veoTuningSpec field.
    • build

      public abstract TuningJob build()