Package com.google.genai
Class AsyncTunings
-
- All Implemented Interfaces:
public final class AsyncTuningsAsync module of Tunings
-
-
Constructor Summary
Constructors Constructor Description AsyncTunings(ApiClient apiClient)
-
Method Summary
Modifier and Type Method Description CompletableFuture<CancelTuningJobResponse>cancel(String name, CancelTuningJobConfig config)Asynchronously cancels a tuning job resource. CompletableFuture<AsyncPager<TuningJob>>list(ListTuningJobsConfig config)Asynchronously makes an API request to list the available tuning jobs. CompletableFuture<TuningJob>get(String name, GetTuningJobConfig config)Asynchronously makes an API request to get a tuning job. CompletableFuture<TuningJob>tune(String baseModel, TuningDataset trainingDataset, CreateTuningJobConfig config)Asynchronously makes an API request to create a supervised fine-tuning job. -
-
Constructor Detail
-
AsyncTunings
AsyncTunings(ApiClient apiClient)
-
-
Method Detail
-
cancel
CompletableFuture<CancelTuningJobResponse> cancel(String name, CancelTuningJobConfig config)
Asynchronously cancels a tuning job resource.
- Parameters:
name- The resource name of the tuning job.config- A CancelTuningJobConfig for configuring the cancel request.
-
list
CompletableFuture<AsyncPager<TuningJob>> list(ListTuningJobsConfig config)
Asynchronously makes an API request to list the available tuning jobs.
- Parameters:
config- A ListTuningJobsConfig 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.
-
get
CompletableFuture<TuningJob> get(String name, GetTuningJobConfig config)
Asynchronously 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 CompletableFuture that resolves to a TuningJob object.
-
tune
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- A CreateTuningJobConfig for configuring the create request.- Returns:
A CompletableFuture that resolves to a TuningJob object.
-
-
-
-