Class GoogleGenAiBatchImageModel

java.lang.Object
dev.langchain4j.model.google.genai.GoogleGenAiBatchImageModel
All Implemented Interfaces:
BatchImageModel

@Experimental public final class GoogleGenAiBatchImageModel extends Object implements BatchImageModel
Provides an interface for interacting with the Google GenAI Batch API for Image generation models.
  • Method Details

    • builder

      public static GoogleGenAiBatchImageModel.Builder builder()
    • submit

      public BatchResponse<Response<Image>> submit(BatchRequest<String> request)
      Description copied from interface: BatchImageModel
      Creates a batch of image generation prompts and submits them for asynchronous processing.

      The returned BatchResponse represents the status of the batch operation.

      Specified by:
      submit in interface BatchImageModel
      Parameters:
      request - the list of image generation prompts or requests to process
      Returns:
      a BatchResponse representing the initial state of the batch operation
    • retrieve

      public BatchResponse<Response<Image>> retrieve(String batchId)
      Description copied from interface: BatchImageModel
      Retrieves the current state and results of an image generation batch operation.

      The response indicates whether the batch is still processing, completed successfully, or failed. Once completed, the response will contain the generated image data.

      Specified by:
      retrieve in interface BatchImageModel
      Parameters:
      batchId - the batch identifier obtained from BatchImageModel.submit(BatchRequest)
      Returns:
      a BatchResponse representing the current state of the image batch operation
    • cancel

      public void cancel(String batchId)
      Description copied from interface: BatchImageModel
      Cancels an image generation batch operation that is currently pending or running.
      Specified by:
      cancel in interface BatchImageModel
      Parameters:
      batchId - the batch identifier to cancel
    • list

      public BatchPage<Response<Image>> list(BatchPagination pagination)
      Description copied from interface: BatchImageModel
      Lists image generation batch jobs with optional pagination.
      Specified by:
      list in interface BatchImageModel
      Parameters:
      pagination - the maximum number of batch jobs to return and token for retrieving a specific page; if null, uses server default
      Returns:
      a BatchPage containing image generation batch responses and pagination information
    • submit

      public BatchResponse<Response<Image>> submit(String displayName, List<String> prompts)
      Creates and enqueues a batch of image generation requests for asynchronous processing.
      Parameters:
      displayName - a user-defined name for the batch
      prompts - a list of image generation prompt strings to be processed in the batch
      Returns:
      a BatchResponse representing the initial state of the batch operation
    • submit

      public BatchResponse<Response<Image>> submit(String displayName, com.google.genai.types.File file)
      Creates a batch of image generation requests from an uploaded file.
      Parameters:
      displayName - a user-defined name for the batch
      file - the Google GenAI File object representing the uploaded file containing batch requests
      Returns:
      a BatchResponse representing the initial state of the batch operation
    • deleteBatchJob

      public void deleteBatchJob(String batchId)
      Deletes a batch job from the system.