This retrieves the latest state of a Batch job using its name as
returned by gemini_create_batch.
Usage
gemini_get_batch(
batch_name,
api_key = Sys.getenv("GEMINI_API_KEY"),
api_version = "v1beta"
)
Arguments
- batch_name
Character scalar giving the batch name.
- api_key
Optional Gemini API key. Defaults to
Sys.getenv("GEMINI_API_KEY").
- api_version
API version string for the path; defaults to
"v1beta".
Value
A list representing the Batch job object.
Details
It corresponds to a GET request on /v1beta/<BATCH_NAME>, where
BATCH_NAME is a string such as "batches/123456".
Examples
# Offline: basic batch name validation / object you would pass
batch_name <- "batches/123456"
# Online: retrieve the batch state from Gemini (requires API key + network)
if (FALSE) { # \dontrun{
batch <- gemini_get_batch(batch_name = batch_name)
batch$name
batch$metadata$state
} # }