Package com.google.genai
Class AsyncTunings
java.lang.Object
com.google.genai.AsyncTunings
Async module of
Tunings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncancel
(String name, CancelTuningJobConfig config) Asynchronously cancels a tuning job resource.get
(String name, GetTuningJobConfig config) Asynchronously makes an API request to get a tuning job.list
(ListTuningJobsConfig config) Asynchronously makes an API request to list the available tuning jobs.tune
(String baseModel, TuningDataset trainingDataset, CreateTuningJobConfig config) Asynchronously makes an API request to create a supervised fine-tuning job.
-
Constructor Details
-
AsyncTunings
public AsyncTunings(com.google.genai.ApiClient apiClient)
-
-
Method Details
-
cancel
Asynchronously 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
Asynchronously 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 CompletableFuture that resolves to a
TuningJob
object.
-
list
Asynchronously makes an API request to list the available tuning jobs.- Parameters:
config
- AListTuningJobsConfig
for configuring the list request.- Returns:
- A CompletableFuture that resolves to a
AsyncPager
. The AsyncPager has a `forEach` method that can be used to asynchronously process items in the page and automatically query the next page once the current page is exhausted.
-
tune
public CompletableFuture<TuningJob> tune(String baseModel, TuningDataset trainingDataset, CreateTuningJobConfig config) Asynchronously 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 CompletableFuture that resolves to a
TuningJob
object.
-