% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/provider-databricks.R
\name{chat_databricks}
\alias{chat_databricks}
\title{Chat with a model hosted on Databricks}
\usage{
chat_databricks(
  workspace = databricks_workspace(),
  system_prompt = NULL,
  model = NULL,
  token = NULL,
  params = NULL,
  api_args = list(),
  echo = c("none", "output", "all"),
  api_headers = character()
)
}
\arguments{
\item{workspace}{The URL of a Databricks workspace, e.g.
\code{"https://example.cloud.databricks.com"}. Will use the value of the
environment variable \code{DATABRICKS_HOST}, if set.}

\item{system_prompt}{A system prompt to set the behavior of the assistant.}

\item{model}{The model to use for the chat (defaults to "databricks-claude-sonnet-5").
We regularly update the default, so we strongly recommend explicitly specifying a model for anything other than casual use.

Available foundational models include:
\itemize{
\item \code{databricks-claude-sonnet-5} (the default)
\item \verb{databricks-mixtral-8x7b-instruct}
\item \verb{databricks-meta-llama-3-1-70b-instruct}
\item \verb{databricks-meta-llama-3-1-405b-instruct}
}}

\item{token}{An authentication token for the Databricks workspace, or
\code{NULL} to use ambient credentials.}

\item{params}{Common model parameters, usually created by \code{\link[=params]{params()}}.}

\item{api_args}{Named list of arbitrary extra arguments appended to the body
of every chat API call. Combined with the body object generated by ellmer
with \code{\link[=modifyList]{modifyList()}}.}

\item{echo}{One of the following options:
\itemize{
\item \code{none}: don't emit any output (default when running in a function).
\item \code{output}: echo text and tool-calling output as it streams in (default
when running at the console).
\item \code{all}: echo all input and output.
}

Note this only affects the \code{chat()} method.}

\item{api_headers}{Named character vector of arbitrary extra headers appended
to every chat API call.}
}
\value{
A \link{Chat} object.
}
\description{
\ifelse{html}{\figure{support-official.svg}{options: alt='[Official supported provider]'}}{\strong{[Official supported provider]}}

Databricks provides out-of-the-box access to a number of \href{https://docs.databricks.com/en/machine-learning/model-serving/score-foundation-models.html}{foundation models}
and can also serve as a gateway for external models hosted by a third party.

Built on top of \code{\link[=chat_openai_compatible]{chat_openai_compatible()}}.
\subsection{Authentication}{

\code{chat_databricks()} picks up on ambient Databricks credentials for a subset
of the \href{https://docs.databricks.com/en/dev-tools/auth/unified-auth.html}{Databricks client unified authentication}
model. Specifically, it supports:
\itemize{
\item Personal access tokens
\item Service principals via OAuth (OAuth M2M)
\item User account via OAuth (OAuth U2M)
\item Authentication via the Databricks CLI
\item Posit Workbench-managed credentials
\item Viewer-based credentials on Posit Connect. Requires the \pkg{connectcreds}
package.
}
}
}
\examples{
\dontrun{
chat <- chat_databricks()
chat$chat("Tell me three jokes about statisticians")
}
}
\seealso{
Other chatbots:
\code{\link[=chat_anthropic]{chat_anthropic()}},
\code{\link[=chat_aws_bedrock]{chat_aws_bedrock()}},
\code{\link[=chat_azure_openai]{chat_azure_openai()}},
\code{\link[=chat_cloudflare]{chat_cloudflare()}},
\code{\link[=chat_deepseek]{chat_deepseek()}},
\code{\link[=chat_github]{chat_github()}},
\code{\link[=chat_google_gemini]{chat_google_gemini()}},
\code{\link[=chat_groq]{chat_groq()}},
\code{\link[=chat_huggingface]{chat_huggingface()}},
\code{\link[=chat_lmstudio]{chat_lmstudio()}},
\code{\link[=chat_mistral]{chat_mistral()}},
\code{\link[=chat_ollama]{chat_ollama()}},
\code{\link[=chat_openai]{chat_openai()}},
\code{\link[=chat_openai_compatible]{chat_openai_compatible()}},
\code{\link[=chat_openrouter]{chat_openrouter()}},
\code{\link[=chat_perplexity]{chat_perplexity()}},
\code{\link[=chat_portkey]{chat_portkey()}},
\code{\link[=chat_posit]{chat_posit()}}
}
\concept{chatbots}
