View source: R/provider-snowflake.R
| chat_snowflake | R Documentation |
The Snowflake provider allows you to interact with LLM models available through the Cortex LLM REST API.
chat_snowflake() picks up the following ambient Snowflake credentials:
A static OAuth token defined via the SNOWFLAKE_TOKEN environment
variable.
Key-pair authentication credentials defined via the SNOWFLAKE_USER and
SNOWFLAKE_PRIVATE_KEY (which can be a PEM-encoded private key or a path
to one) environment variables.
Posit Workbench-managed Snowflake credentials for the corresponding
account.
Viewer-based credentials on Posit Connect. Requires the connectcreds package.
Note that Snowflake-hosted models do not support images.
chat_snowflake(
system_prompt = NULL,
account = snowflake_account(),
credentials = NULL,
model = NULL,
params = NULL,
api_args = list(),
echo = c("none", "output", "all"),
api_headers = character()
)
system_prompt |
A system prompt to set the behavior of the assistant. |
account |
A Snowflake account identifier,
e.g. |
credentials |
A list of authentication headers to pass into
|
model |
The model to use for the chat (defaults to "claude-sonnet-4-6"). We regularly update the default, so we strongly recommend explicitly specifying a model for anything other than casual use. |
params |
Common model parameters, usually created by |
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 |
echo |
One of the following options:
Note this only affects the |
api_headers |
Named character vector of arbitrary extra headers appended to every chat API call. |
A Chat object.
chat <- chat_snowflake()
chat$chat("Tell me a joke in the form of a SQL query.")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.