Package com.google.genai
Class Tunings
java.lang.Object
com.google.genai.Tunings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel
(String name, CancelTuningJobConfig config) Cancels a tuning job resource.get
(String name, GetTuningJobConfig config) Makes an API request to get a tuning job.list
(ListTuningJobsConfig config) Makes an API request to list the available tuning jobs.tune
(String baseModel, TuningDataset trainingDataset, CreateTuningJobConfig config) Makes an API request to create a supervised fine-tuning job.
-
Constructor Details
-
Tunings
public Tunings(com.google.genai.ApiClient apiClient)
-
-
Method Details
-
cancel
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
- ACancelTuningJobConfig
for configuring the cancel request.
-
get
Makes an API request to get a tuning job.- Parameters:
name
- The resource name of the tuning job.config
- AGetTuningJobConfig
for configuring the get request.- Returns:
- A
TuningJob
object.
-
list
Makes an API request to list the available tuning jobs.- Parameters:
config
- AListTuningJobsConfig
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
- ACreateTuningJobConfig
for configuring the create request.- Returns:
- A
TuningJob
object.
-