Class AsyncBatches

java.lang.Object
com.google.genai.AsyncBatches

public final class AsyncBatches extends Object
Async module of Batches
  • Constructor Details

    • AsyncBatches

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

    • get

      public CompletableFuture<BatchJob> get(String name, GetBatchJobConfig config)
      Asynchronously gets a batch job resource.
      Parameters:
      name - A fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the Vertex AI client. Or "batches/abc" using the Gemini Developer AI client.
      config - A GetBatchJobConfig for configuring the get request.
      Returns:
      A BatchJob object that contains the info of the batch job.
    • cancel

      public CompletableFuture<Void> cancel(String name, CancelBatchJobConfig config)
      Asynchronously cancels a batch job resource.
      Parameters:
      name - A fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the Vertex AI client. Or "batches/abc" using the Gemini Developer AI client.
      config - A CancelBatchJobConfig for configuring the cancel request.
    • delete

      Asynchronously deletes a batch job resource.
      Parameters:
      name - A fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the Vertex AI client. Or "batches/abc" using the Gemini Developer AI client.
      config - A DeleteBatchJobConfig for configuring the delete request.
    • create

      public 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.
    • list

      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.