% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chat.R
\name{safe_call_llm_history}
\alias{safe_call_llm_history}
\title{Safely call the LLM with full message history}
\usage{
safe_call_llm_history(messages, system_prompt_override = NULL)
}
\arguments{
\item{messages}{List of messages, each \code{list(role = ..., content = ...)}.
The last message must have \code{role = "user"}.}

\item{system_prompt_override}{Override system prompt (optional).}
}
\value{
Either a character string (response text) or
\code{list(error = message)} on failure.
}
\description{
Safely call the LLM with full message history
}
\keyword{internal}
