Class Batches
public sealed class Batches
- Inheritance
-
Batches
- Inherited Members
Constructors
Batches(ApiClient)
public Batches(ApiClient apiClient)
Parameters
apiClientApiClient
Methods
CancelAsync(string, CancelBatchJobConfig?, CancellationToken)
Cancels a batch job resource.
public Task CancelAsync(string name, CancelBatchJobConfig? config = null, CancellationToken cancellationToken = default)
Parameters
namestringA 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.
configCancelBatchJobConfigA CancelBatchJobConfig for configuring the cancel request.
cancellationTokenCancellationTokenThe CancellationToken for the request.
Returns
CreateAsync(string, BatchJobSource, CreateBatchJobConfig, CancellationToken)
Creates a batch job.
public Task<BatchJob> CreateAsync(string model, BatchJobSource src, CreateBatchJobConfig config, CancellationToken cancellationToken = default)
Parameters
modelstringThe model to use for the batch job.
srcBatchJobSourceThe BatchJobSource of the batch job. Currently Gemini Enterprise Agent Platform supports GCS URIs or BigQuery URI. Example: "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId". Gemini Developer API supports List of inlined_request, or file name. Example: "files/file_name".
configCreateBatchJobConfigOptional CreateBatchJobConfig to configure the batch job.
cancellationTokenCancellationTokenThe cancellation token for the request.
Returns
- Task<BatchJob>
A Task<TResult> that represents the asynchronous operation. The task result contains a BatchJob instance with batch job details.
CreateEmbeddingsAsync(string, EmbeddingsBatchJobSource, CreateEmbeddingsBatchJobConfig, CancellationToken)
Makes an API request to create the batch embeddings job. This method is experimental.
public Task<BatchJob> CreateEmbeddingsAsync(string model, EmbeddingsBatchJobSource src, CreateEmbeddingsBatchJobConfig config, CancellationToken cancellationToken = default)
Parameters
modelstringThe model to use for the embeddings.
srcEmbeddingsBatchJobSourceThe EmbeddingsBatchJobSource of the batch job. Gemini Developer API supports List of inlined_request, or file name. Example: "files/file_name".
configCreateEmbeddingsBatchJobConfigOptional CreateEmbeddingsBatchJobConfig to configure the batch job.
cancellationTokenCancellationTokenThe cancellation token for the request.
Returns
- Task<BatchJob>
A Task<TResult> that represents the asynchronous operation. The task result contains a BatchJob instance with batch job details.
DeleteAsync(string, DeleteBatchJobConfig?, CancellationToken)
Deletes a batch job resource.
public Task<DeleteResourceJob> DeleteAsync(string name, DeleteBatchJobConfig? config = null, CancellationToken cancellationToken = default)
Parameters
namestringA fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the Gemini Enterprise Agent Platform client. Or "batches/abc" using the Gemini Developer AI client.
configDeleteBatchJobConfigA DeleteBatchJobConfig for configuring the delete request.
cancellationTokenCancellationTokenThe CancellationToken for the request.
Returns
- Task<DeleteResourceJob>
A DeleteResourceJob object that shows the status of the deletion.
GetAsync(string, GetBatchJobConfig?, CancellationToken)
Gets a batch job resource.
public Task<BatchJob> GetAsync(string name, GetBatchJobConfig? config = null, CancellationToken cancellationToken = default)
Parameters
namestringA fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the Gemini Enterprise Agent Platform client. Or "batches/abc" using the Gemini Developer AI client.
configGetBatchJobConfigA GetBatchJobConfig for configuring the get request.
cancellationTokenCancellationTokenThe CancellationToken for the request.
Returns
ListAsync(ListBatchJobsConfig?, CancellationToken)
Makes an API request to list the available batch jobs.
public Task<Pager<BatchJob, ListBatchJobsConfig, ListBatchJobsResponse>> ListAsync(ListBatchJobsConfig? config = null, CancellationToken cancellationToken = default)
Parameters
configListBatchJobsConfigA ListBatchJobsConfig for configuring the list request.
cancellationTokenCancellationTokenThe CancellationToken for the request.
Returns
- Task<Pager<BatchJob, ListBatchJobsConfig, ListBatchJobsResponse>>
A Pager<TItem, TConfig, TResponse> 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.