Tags-first variant of llm_fn(). Injects tag instructions, calls the model
via call_llm_broadcast(), then parses XML-like tags from each response.
Arguments
- x
A character vector or a data.frame/tibble.
- prompt
A glue template string. With a data-frame you may reference columns (
{col}); with a vector the placeholder is{x}.- .config
An llm_config object.
- .system_prompt
Optional system message (character scalar).
- ...
Passed unchanged to
call_llm_broadcast()(e.g.tries,progress,verbose).Character vector of tag names to request and parse.
- .fields
NULLto extract all tags, a character vector of tags, a named vector such asc(person_age = "age"), orFALSEto skip field extraction.- .return
One of
c("columns","text","object")."columns"returns a tibble with the parsed tag columns and diagnostics;"text"returns the raw response text. Unlikellm_fn(),"object"here returns the parsed tag data (a list, one element per row), notllmr_responseobjects; this form is also supported together with.rows_per_prompt > 1.- .rows_per_prompt
Integer scalar, or
Inf. Number of input elements packed into a single generative request. The default,1, sends one request per element (the historical behaviour). When greater than1, elements are grouped and transmitted in one call wrapped in numbered<row_1>...</row_1>tags (see Row batching below);Infsends all elements in a single call. Ignored for embedding configurations, which useget_batched_embeddings()instead.- .rowpack_payload
One of
c("user","system"). Channel to which the<row_i>data block is appended when batching. The imperative instruction is always placed in the system message; this argument controls only where the data goes. The default,"user", keeps a static system prompt cacheable.- .rowpack_recovery
How to handle rows that a batched call leaves unresolved (dropped, malformed, or truncated). One of:
"halve_recursive"(default) re-issue the unresolved rows at half the batch size, recursing down to single rows.
"halve_once"re-issue at half the batch size exactly once, then give up on any still-unresolved rows.
"singletons"re-issue each unresolved row on its own.
"retry_same"re-issue the failed batch once at the same size.
"none"do not recover; unresolved rows are returned as
NA.
Recovery is bounded by an internal call budget so it always terminates.