Package com.google.genai
Class Batches
java.lang.Object
com.google.genai.Batches
Provides methods for managing the batch jobs. Instantiating this class is not required. After
instantiating a
Client
, access methods through `client.batches.methodName(...)` directly.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel
(String name, CancelBatchJobConfig config) Cancels a batch job resource.create
(String model, BatchJobSource src, CreateBatchJobConfig config) Makes an API request to create the batch job.delete
(String name, DeleteBatchJobConfig config) Deletes a batch job resource.get
(String name, GetBatchJobConfig config) Gets a batch job resource.list
(ListBatchJobsConfig config) Makes an API request to list the available batch jobs.
-
Constructor Details
-
Batches
public Batches(com.google.genai.ApiClient apiClient)
-
-
Method Details
-
get
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
- AGetBatchJobConfig
for configuring the get request.- Returns:
- A
BatchJob
object that contains the info of the batch job.
-
cancel
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
- ACancelBatchJobConfig
for configuring the cancel request.
-
delete
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
- ADeleteBatchJobConfig
for configuring the delete request.
-
create
Makes an API request to create the batch job.- Parameters:
model
- the name of the GenAI model to use for generationsrc
- TheBatchJobSource
of the batch job.config
- The configurationCreateBatchJobConfig
for the batch job.- Returns:
- A BatchJob.
-
list
Makes an API request to list the available batch jobs.- Parameters:
config
- AListBatchJobsConfig
for configuring the list request.- Returns:
- A
Pager
object that contains the list of batch jobs. The pager is an iterable and automatically queries the next page once the current page is exhausted.
-