enable_structured_output | R Documentation |
Turn on structured output for a model configuration. Supports OpenAI‑compatible providers (OpenAI, Groq, Together, x.ai, DeepSeek), Anthropic, and Gemini.
enable_structured_output(
config,
schema = NULL,
name = "llmr_schema",
method = c("auto", "json_mode", "tool_call"),
strict = TRUE
)
config |
An llm_config object. |
schema |
A named list representing a JSON Schema.
If |
name |
Character. Schema/tool name for providers requiring one. Default "llmr_schema". |
method |
One of c("auto","json_mode","tool_call"). "auto" chooses the best per provider. You rarely need to change this. |
strict |
Logical. Request strict validation when supported (OpenAI-compatible). |
Modified llm_config
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.