Interface BatchImageModel
- All Known Implementing Classes:
GoogleAiGeminiBatchImageModel
A model interface for processing multiple image generation requests asynchronously in a batch.
Batch processing typically offers significant cost reductions compared to real-time requests and is ideal for large-scale, non-urgent tasks.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidCancels an image generation batch operation that is currently pending or running.list(@Nullable BatchPagination pagination) Lists image generation batch jobs with optional pagination.Retrieves the current state and results of an image generation batch operation.submit(BatchRequest<String> request) Creates a batch of image generation prompts and submits them for asynchronous processing.
-
Method Details
-
submit
Creates a batch of image generation prompts and submits them for asynchronous processing.The returned
BatchResponserepresents the status of the batch operation.- Parameters:
request- the list of image generation prompts or requests to process- Returns:
- a
BatchResponserepresenting the initial state of the batch operation
-
retrieve
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.
- Parameters:
batchId- the batch identifier obtained fromsubmit(BatchRequest)- Returns:
- a
BatchResponserepresenting the current state of the image batch operation
-
cancel
Cancels an image generation batch operation that is currently pending or running.- Parameters:
batchId- the batch identifier to cancel
-
list
Lists image generation batch jobs with optional pagination.- Parameters:
pagination- the maximum number of batch jobs to return and token for retrieving a specific page; if null, uses server default- Returns:
- a
BatchPagecontaining image generation batch responses and pagination information
-