Drop-in schema-first variant of llm_mutate()
. Produces parsed columns.
llm_mutate_structured(
.data,
output,
prompt = NULL,
.messages = NULL,
.config,
.system_prompt = NULL,
.before = NULL,
.after = NULL,
.schema = NULL,
.fields = NULL,
...
)
A data.frame / tibble.
Unquoted name that becomes the new column (generative) or the prefix for embedding columns.
Optional glue template string for a single user turn; reference
any columns in .data
(e.g. "{id}. {question}\nContext: {context}"
).
Ignored if .messages
is supplied.
Optional named character vector of glue templates to build
a multi-turn message, using roles in c("system","user","assistant","file")
.
Values are glue templates evaluated per-row; all can reference multiple columns.
For multimodal, use role "file"
with a column containing a path template.
An llm_config object (generative or embedding).
Optional system message sent with every request when
.messages
does not include a system
entry.
Standard dplyr::relocate helpers controlling where the generated column(s) are placed.
Optional JSON Schema list; if NULL
, only JSON object is enforced.
Optional fields to hoist (supports nested paths).
Passed to the underlying calls: call_llm_broadcast()
in
generative mode, get_batched_embeddings()
in embedding mode.