llm_fn_structured | R Documentation |
Schema-first variant of llm_fn()
. It enables structured output on the config,
calls the model via call_llm_broadcast()
, parses JSON, and optionally validates.
llm_fn_structured(
x,
prompt,
.config,
.system_prompt = NULL,
...,
.schema = NULL,
.fields = NULL,
.local_only = FALSE,
.validate_local = TRUE
)
x |
A character vector or a data.frame/tibble. |
prompt |
A glue template string. With a data-frame you may reference
columns ( |
.config |
An llm_config object. |
.system_prompt |
Optional system message (character scalar). |
... |
Passed unchanged to |
.schema |
Optional JSON Schema list; if |
.fields |
Optional fields to hoist from parsed JSON (supports nested paths). |
.local_only |
If TRUE, do not send schema to the provider (parse/validate locally). |
.validate_local |
If TRUE and |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.