Package com.google.genai
Class AsyncBatches
-
- All Implemented Interfaces:
public final class AsyncBatchesAsync module of Batches
-
-
Constructor Summary
Constructors Constructor Description AsyncBatches(ApiClient apiClient)
-
Method Summary
Modifier and Type Method Description CompletableFuture<BatchJob>get(String name, GetBatchJobConfig config)Asynchronously gets a batch job resource. CompletableFuture<Void>cancel(String name, CancelBatchJobConfig config)Asynchronously cancels a batch job resource. CompletableFuture<DeleteResourceJob>delete(String name, DeleteBatchJobConfig config)Asynchronously deletes a batch job resource. CompletableFuture<AsyncPager<BatchJob>>list(ListBatchJobsConfig config)Asynchronously makes an API request to list the available batch jobs. CompletableFuture<BatchJob>create(String model, BatchJobSource src, CreateBatchJobConfig config)Asynchronously creates a batch job. CompletableFuture<BatchJob>createEmbeddings(String model, EmbeddingsBatchJobSource src, CreateEmbeddingsBatchJobConfig config)Makes an API request to create the batch embeddings job. -
-
Constructor Detail
-
AsyncBatches
AsyncBatches(ApiClient apiClient)
-
-
Method Detail
-
get
CompletableFuture<BatchJob> get(String name, GetBatchJobConfig config)
Asynchronously gets a batch job resource.
- Parameters:
name- A fully-qualified BatchJob resource name or ID.config- A GetBatchJobConfig for configuring the get request.- Returns:
A BatchJob object that contains the info of the batch job.
-
cancel
CompletableFuture<Void> cancel(String name, CancelBatchJobConfig config)
Asynchronously cancels a batch job resource.
- Parameters:
name- A fully-qualified BatchJob resource name or ID.config- A CancelBatchJobConfig for configuring the cancel request.
-
delete
CompletableFuture<DeleteResourceJob> delete(String name, DeleteBatchJobConfig config)
Asynchronously deletes a batch job resource.
- Parameters:
name- A fully-qualified BatchJob resource name or ID.config- A DeleteBatchJobConfig for configuring the delete request.
-
list
CompletableFuture<AsyncPager<BatchJob>> list(ListBatchJobsConfig config)
Asynchronously makes an API request to list the available batch jobs.
- Parameters:
config- A ListBatchJobsConfig 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.
-
create
CompletableFuture<BatchJob> create(String model, BatchJobSource src, CreateBatchJobConfig config)
Asynchronously creates a batch job.
- Parameters:
model- the name of the GenAI model to use for batch generation.src- The BatchJobSource of the batch job.config- The configuration CreateBatchJobConfig for the batch job.- Returns:
A future that resolves to the batch job.
-
createEmbeddings
CompletableFuture<BatchJob> createEmbeddings(String model, EmbeddingsBatchJobSource src, CreateEmbeddingsBatchJobConfig config)
Makes an API request to create the batch embeddings job.
This method is experimental.
- Parameters:
model- the name of the GenAI model to use for generationsrc- The EmbeddingsBatchJobSource of the batch job.config- The configuration CreateEmbeddingsBatchJobConfig for the batch job.- Returns:
A BatchJob.
-
-
-
-