Skip to contents

Create an ellmer chat object for a given LLM provider

Usage

llm_chat(provider = "openai", 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

The model default in calling functions is typically an OpenAI model name. When using a different provider, supply an appropriate model name for that 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.")
}