Skip to main content

messages

Creates, updates, deletes, gets or lists a messages resource.

Overview

Namemessages
TypeResource
Idsnowflake.cortex.messages

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique message identifier.
contentarrayGenerated content blocks.
modelstringModel that handled the request.
rolestringConversational role of the generated message (assistant).
stop_reasonstringReason generation stopped.
stop_sequencestringWhich custom stop sequence was generated, if any.
typestringObject type (message).
usagestringBilling and rate-limit token usage. (opaque JSON object)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
createselectendpointPerform LLM text completion inference using Cortex Messages API format.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringOrganization and account identifier (orgname-accountname) (default: orgname-accountname)

SELECT examples

Perform LLM text completion inference using Cortex Messages API format.

SELECT
id,
content,
model,
role,
stop_reason,
stop_sequence,
type,
usage
FROM snowflake.cortex.messages
WHERE endpoint = '{{ endpoint }}' -- required
;