| dragon_llm_anthropic | R Documentation |
Judges, teachers, and students in dragonfarm are plain functions from a character vector of prompts to a character vector of replies. These helpers build such functions.
dragon_llm_anthropic(
model = "claude-opus-5",
system = NULL,
api_key = Sys.getenv("ANTHROPIC_API_KEY"),
max_tokens = 1024,
max_active = 4,
temperature = NULL
)
dragon_judge_anthropic(
model = "claude-opus-5",
api_key = Sys.getenv("ANTHROPIC_API_KEY"),
max_tokens = 1024,
max_active = 4
)
dragon_llm_ellmer(chat, system = NULL)
dragon_judge_ellmer(chat)
model |
Claude model id. The default is the most capable general
model; |
system |
Optional system prompt. |
api_key |
Anthropic API key. |
max_tokens |
Reply length cap. |
max_active |
How many requests to run at once. |
temperature |
Sampling temperature, or |
chat |
An |
dragon_llm_anthropic() calls the Claude API directly over HTTP with
refusal fallbacks enabled, reading the key from ANTHROPIC_API_KEY.
dragon_llm_ellmer() wraps any ellmer chat, so every provider ellmer
supports works; each prompt gets a fresh copy of the chat so no history
leaks between questions. The dragon_judge_*() variants are the same
with a system prompt that asks for JSON-only answers, which
dragon_judge() and dragon_synthesize_pairs() need.
A function suitable for the judge, teacher, or student
arguments of dragon_judge(), dragon_synthesize(), and
dragon_synthesize_pairs().
if (interactive()) {
teacher <- dragon_llm_anthropic(system = "You are a concise support agent.")
teacher(c("My thermostat drops off Wi-Fi.", "Invoice total looks wrong."))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.