| foundry_batch_requests | R Documentation |
Convert a data frame of prompts into a JSON Lines file that can be uploaded
with foundry_file_upload(..., purpose = "batch") and submitted with
foundry_batch_create().
foundry_batch_requests(
data,
input,
path,
model,
endpoint = "/v1/responses",
custom_id = NULL,
body = list(),
schema = NULL,
schema_name = "ExtractedData",
strict = TRUE,
instructions = NULL,
body_columns = NULL,
overwrite = FALSE
)
data |
Data frame containing input rows. |
input |
Character. Name of the column containing prompt/input text. |
path |
Character. Path to write the JSONL file. |
model |
Character. Model deployment name to include in each request. |
endpoint |
Character. Batch endpoint path. Defaults to |
custom_id |
Character. Optional column name for custom IDs. If omitted,
IDs are generated as |
body |
List. Additional request body fields added to each request. |
schema |
List. Optional JSON Schema for structured Responses API output. |
schema_name |
Character. Name for |
strict |
Logical. Whether structured output should be strict. |
instructions |
Character. Optional instructions for Responses API requests. |
body_columns |
Character vector. Optional column names whose per-row values should be added to each request body. |
overwrite |
Logical. Whether to overwrite an existing file. |
A tibble with the JSONL path, request count, and endpoint.
local({
jobs <- data.frame(text = c("Summarize this.", "Extract entities."))
path <- tempfile(fileext = ".jsonl")
on.exit(unlink(path))
foundry_batch_requests(
jobs, input = "text", path = path, model = "gpt-5-nano"
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.