R/provider-snowflake-cortex.R
chat_cortex_analyst.RdPlease use chat_snowflake() instead as that appears to be where Snowflake
is putting their efforts.
Chat with the LLM-powered Snowflake Cortex Analyst.
chat_cortex_analyst() 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.
Unlike most comparable model APIs, Cortex does not take a system prompt. Instead, the caller must provide a "semantic model" describing available tables, their meaning, and verified queries that can be run against them as a starting point. The semantic model can be passed as a YAML string or via reference to an existing file in a Snowflake Stage.
Note that Cortex does not support multi-turn, so it will not remember previous messages. Nor does it support registering tools, and attempting to do so will result in an error.
See chat_snowflake() to chat with more general-purpose models hosted on
Snowflake.
A Snowflake account identifier,
e.g. "testorg-test_account". Defaults to the value of the
SNOWFLAKE_ACCOUNT environment variable.
A list of authentication headers to pass into
httr2::req_headers(), a function that returns them when called, or
NULL, the default, to use ambient credentials.
A semantic model specification, or NULL when
using model_file instead.
Path to a semantic model file stored in a Snowflake Stage,
or NULL when using model_spec instead.
Named list of arbitrary extra arguments appended to the body
of every chat API call. Combined with the body object generated by ellmer
with modifyList().
One of the following options:
none: don't emit any output (default when running in a function).
output: echo text and tool-calling output as it streams in (default
when running at the console).
all: echo all input and output.
Note this only affects the chat() method.
Named character vector of arbitrary extra headers appended to every chat API call.
A Chat object.