% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/providers.R
\name{llm_call}
\alias{llm_call}
\title{Call an LLM provider}
\usage{
llm_call(provider, messages, max_tokens = 15L, temperature = 0.7)
}
\arguments{
\item{provider}{An \code{llm_provider} object.}

\item{messages}{List of role/content pairs in OpenAI format, e.g.
\code{list(list(role = "system", content = "..."), list(role = "user", content = "..."))}.}

\item{max_tokens}{Token budget for the response.}

\item{temperature}{Sampling temperature.}
}
\value{
A character string, or \code{NA_character_} on failure.
}
\description{
Generic dispatch function. Passes a list of role/content message pairs to
the provider's internal call function and returns the text response.
}
\examples{
\dontrun{
p    <- llm_provider_openai()
msgs <- list(
  list(role = "system", content = "Reply with a single integer."),
  list(role = "user",   content = "What is 2 + 2?")
)
llm_call(p, msgs, max_tokens = 5L)
}
}
