messages
Creates, updates, deletes, gets or lists a messages resource.
Overview
| Name | messages |
| Type | Resource |
| Id | snowflake.cortex.messages |
Fields
The following fields are returned by SELECT queries:
- create
| Name | Datatype | Description |
|---|---|---|
id | string | Unique message identifier. |
content | array | Generated content blocks. |
model | string | Model that handled the request. |
role | string | Conversational role of the generated message (assistant). |
stop_reason | string | Reason generation stopped. |
stop_sequence | string | Which custom stop sequence was generated, if any. |
type | string | Object type (message). |
usage | string | Billing and rate-limit token usage. (opaque JSON object) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
create | select | endpoint | Perform 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.
| Name | Datatype | Description |
|---|---|---|
endpoint | string | Organization and account identifier (orgname-accountname) (default: orgname-accountname) |
SELECT examples
- create
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
;