| foundry_extract_batch | R Documentation |
Prepare JSONL requests for structured extraction, upload them, and create a
batch. With wait = TRUE, waits for completion and returns parsed results
joined back to the input rows.
foundry_extract_batch(
data,
text_col,
schema,
model,
wait = FALSE,
path = tempfile(fileext = ".jsonl"),
schema_name = "ExtractedData",
strict = TRUE,
instructions = NULL,
completion_window = "24h",
api_key = NULL,
token = NULL,
endpoint_url = NULL,
api_version = NULL
)
data |
Data frame containing input rows. |
text_col |
Character. Name of the column containing input text. |
schema |
List. JSON Schema object for structured extraction. |
model |
Character. Model deployment name to include in each request. |
wait |
Logical. Whether to block until the batch reaches a terminal state and parse results. |
path |
Character. Optional JSONL path. Defaults to a temporary file. |
schema_name |
Character. Name for |
strict |
Logical. Whether structured output should be strict. |
instructions |
Character. Optional instructions for Responses API requests. |
completion_window |
Character. Batch completion window, usually |
api_key |
Character. Optional API key override. |
token |
Character. Optional bearer token override. |
endpoint_url |
Character. Optional Foundry endpoint override. |
api_version |
Character. Optional API version query value. |
A batch tibble when wait = FALSE, or parsed result rows when
wait = TRUE.
## Not run:
# Requires a configured Azure endpoint, credentials, and a batch deployment.
local({
jobs <- data.frame(text = c("Great service.", "Slow support."))
schema <- foundry_schema(sentiment = schema_string())
path <- tempfile(fileext = ".jsonl")
on.exit(unlink(path))
foundry_extract_batch(
jobs, text_col = "text", schema = schema,
model = "gpt-5-nano", path = path
)
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.