Class Tunings

java.lang.Object
com.google.genai.Tunings

public final class Tunings extends Object
  • Constructor Details

    • Tunings

      public Tunings(com.google.genai.ApiClient apiClient)
  • Method Details

    • cancel

      public void cancel(String name, CancelTuningJobConfig config)
      Cancels a tuning job resource.
      Parameters:
      name - The resource name of the tuning job. For Vertex, this is the full resource name. For Gemini API, this is `tunedModels/{id}`.
      config - A CancelTuningJobConfig for configuring the cancel request.
    • get

      public TuningJob get(String name, GetTuningJobConfig config)
      Makes an API request to get a tuning job.
      Parameters:
      name - The resource name of the tuning job.
      config - A GetTuningJobConfig for configuring the get request.
      Returns:
      A TuningJob object.
    • list

      public Pager<TuningJob> list(ListTuningJobsConfig config)
      Makes an API request to list the available tuning jobs.
      Parameters:
      config - A ListTuningJobsConfig for configuring the list request.
      Returns:
      A Pager object that contains the list of tuning jobs. The pager is an iterable and automatically queries the next page once the current page is exhausted.
    • tune

      public TuningJob tune(String baseModel, TuningDataset trainingDataset, CreateTuningJobConfig config)
      Makes an API request to create a supervised fine-tuning job.

      This method is experimental.

      Parameters:
      baseModel - The base model to tune.
      trainingDataset - The training dataset to use for tuning.
      config - A CreateTuningJobConfig for configuring the create request.
      Returns:
      A TuningJob object.