View source: R/LLM_parallel_utils.R
| llm_cross_design | R Documentation |
Creates an experimental design tibble that crosses every row in .data with
every config in configs, evaluating glue prompt templates row-by-row.
The result has config and messages list-columns ready for call_llm_par().
llm_cross_design(
.data,
configs,
prompt = NULL,
.messages = NULL,
.system_prompt = NULL
)
.data |
A data frame containing variables for the glue prompt. |
configs |
A list of llm_config objects (or a single llm_config). |
prompt |
A glue string for a single user turn. |
.messages |
Optional named character vector of glue templates (roles as names). |
.system_prompt |
Optional system prompt template (glue string). |
A tibble with all original data columns plus config and messages
list-columns.
expand_llm_config(), call_llm_par(), build_factorial_experiments()
## Not run:
cities <- data.frame(city = c("Cairo", "Lima"))
cfgs <- list(llm_config("groq", "openai/gpt-oss-20b"), llm_config("deepseek", "deepseek-chat"))
design <- llm_cross_design(cities, cfgs, prompt = "What country is {city} in?")
results <- call_llm_par(design)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.