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

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

      sdkHttpResponse: Used to retain the full HTTP response.

    • 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}`

    • state

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

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

    • 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.

    • 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.

    • 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`.

    • updateTime

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

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

    • 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

      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`.

    • description

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

      description: Optional. The description of the TuningJob.

    • 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).

    • tunedModel

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

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

    • tunedModel

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

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

    • preTunedModel

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

      preTunedModel: The pre-tuned model for continuous tuning.

    • preTunedModel

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

      preTunedModel: The pre-tuned model for continuous tuning.

    • supervisedTuningSpec

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

      supervisedTuningSpec: Tuning Spec for Supervised Fine Tuning.

    • supervisedTuningSpec

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

      supervisedTuningSpec: Tuning Spec for Supervised Fine Tuning.

    • tuningDataStats

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

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

    • tuningDataStats

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

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

    • 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

      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.

    • partnerModelTuningSpec

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

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

    • partnerModelTuningSpec

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

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

    • 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.

    • experiment

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

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

    • 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.

    • 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.

    • 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}`.

    • 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.

    • 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.

    • build

      public abstract TuningJob build()