Skip to contents

Create an ellmer chat object for a given LLM provider

Usage

llm_chat(provider = "anthropic", model, ...)

Arguments

provider

character(1) provider name; see llm_env_var

model

character(1) model identifier appropriate for the chosen provider

...

additional arguments passed to the underlying chat_* function

Value

an ellmer Chat object

Note

Supply a model name appropriate for the chosen provider.

Examples

if (interactive() && nchar(Sys.getenv("ANTHROPIC_API_KEY")) > 0) {
    ch <- llm_chat("anthropic", model = "claude-haiku-4-5")
    ch$chat("Name one EDAM topic term.")
}