Skip to content

Commit

Permalink
release public preview
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-zli committed Aug 13, 2024
1 parent e6b06c5 commit e6fe000
Show file tree
Hide file tree
Showing 37 changed files with 117,315 additions and 0 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

11,981 changes: 11,981 additions & 0 deletions public-preview/8.30/collection/Snowflake Database API.postman_collection.json

Large diffs are not rendered by default.

11,314 changes: 11,314 additions & 0 deletions public-preview/8.30/collection/Snowflake Dynamic Table API.postman_collection.json

Large diffs are not rendered by default.

4,062 changes: 4,062 additions & 0 deletions public-preview/8.30/collection/Snowflake Function API.postman_collection.json

Large diffs are not rendered by default.

7,441 changes: 7,441 additions & 0 deletions public-preview/8.30/collection/Snowflake Grant API.postman_collection.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2,564 changes: 2,564 additions & 0 deletions public-preview/8.30/collection/Snowflake Role API.postman_collection.json

Large diffs are not rendered by default.

6,666 changes: 6,666 additions & 0 deletions public-preview/8.30/collection/Snowflake Schema API.postman_collection.json

Large diffs are not rendered by default.

7,328 changes: 7,328 additions & 0 deletions public-preview/8.30/collection/Snowflake Services API.postman_collection.json

Large diffs are not rendered by default.

4,980 changes: 4,980 additions & 0 deletions public-preview/8.30/collection/Snowflake Stage API.postman_collection.json

Large diffs are not rendered by default.

19,286 changes: 19,286 additions & 0 deletions public-preview/8.30/collection/Snowflake Table API.postman_collection.json

Large diffs are not rendered by default.

10,546 changes: 10,546 additions & 0 deletions public-preview/8.30/collection/Snowflake Task API.postman_collection.json

Large diffs are not rendered by default.

3,230 changes: 3,230 additions & 0 deletions public-preview/8.30/collection/Snowflake User API.postman_collection.json

Large diffs are not rendered by default.

7,422 changes: 7,422 additions & 0 deletions public-preview/8.30/collection/Snowflake Warehouse API.postman_collection.json

Large diffs are not rendered by default.

530 changes: 530 additions & 0 deletions public-preview/8.30/specification/common.yaml

Large diffs are not rendered by default.

422 changes: 422 additions & 0 deletions public-preview/8.30/specification/compute-pool.yaml

Large diffs are not rendered by default.

256 changes: 256 additions & 0 deletions public-preview/8.30/specification/cortex-analyst.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
openapi: 3.0.0
servers:
- description: Snowflake API
url: https://org-account.snowflakecomputing.com
info:
version: 0.0.1
title: Cortex Analyst API
description: The Snowflake Cortex Analyst API is a REST API that allows end user
to chat with their data leveraging semantic models to generate SQL queries.
contact:
name: Snowflake, Inc.
url: https://snowflake.com
email: [email protected]
paths:
/api/v2/cortex/analyst/message:
post:
operationId: sendMessage
tags:
- cortex-analyst
summary: Send a data question to the Cortex Analyst
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SendMessageRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SendMessageResponse'
text/event-stream:
schema:
type: string
'400':
$ref: common.yaml#/components/responses/400BadRequest
'401':
$ref: common.yaml#/components/responses/401Unauthorized
'403':
$ref: common.yaml#/components/responses/403Forbidden
'404':
$ref: common.yaml#/components/responses/404NotFound
'405':
$ref: common.yaml#/components/responses/405MethodNotAllowed
'429':
$ref: common.yaml#/components/responses/429LimitExceeded
'500':
$ref: common.yaml#/components/responses/500InternalServerError
'503':
$ref: common.yaml#/components/responses/503ServiceUnavailable
'504':
$ref: common.yaml#/components/responses/504GatewayTimeout
components:
schemas:
StatusUpdate:
type: object
properties:
status:
description: The latest status for processing the request
type: string
status_message:
description: A human readable description on the current request processing
status
type: string
required:
- status
MessageContentDelta:
type: object
properties:
type:
type: string
index:
type: integer
description: The index of the content array this delta object represents
discriminator:
propertyName: type
mapping:
text: '#/components/schemas/MessageContentDeltaTextObject'
sql: '#/components/schemas/MessageContentDeltaSqlObject'
suggestions: '#/components/schemas/MessageContentDeltaSuggestionsObject'
MessageContentDeltaTextObject:
allOf:
- $ref: '#/components/schemas/MessageContentDelta'
- title: Text
type: object
description: The text content that is part of a message.
properties:
text_delta:
type: string
description: The delta of the text content, clients should concatenate
all deltas for the same index
example: To answer the question "What is the profit per store?" we must
aggregate sales at the store level
required:
- text_delta
MessageContentDeltaSqlObject:
allOf:
- $ref: '#/components/schemas/MessageContentDelta'
- title: SQL
type: object
description: The SQL content that is part of a message.
properties:
statement_delta:
type: string
description: The delta of the sql statement, clients should concatenate
all deltas for the same index
example: SELECT store, SUM(profit) FROM sales GROUP BY store
required:
- statement_delta
MessageContentDeltaSuggestionsObject:
allOf:
- $ref: '#/components/schemas/MessageContentDelta'
- title: Suggested Questions
type: object
description: If SQL cannot be generated, a list of questions the semantic
model can generate SQL for.
properties:
suggestions_delta:
$ref: '#/components/schemas/SuggestionDelta'
required:
- suggestions_delta
SuggestionDelta:
type: object
properties:
index:
type: integer
description: The index of the suggestions array this delta object represents
suggestion_delta:
type: string
description: The delta of a suggestion text, clients should concatenate
all deltas for the same index
StreamingError:
type: object
properties:
message:
type: string
description: A description of the error
code:
type: string
description: The Snowflake error code categorizing the error
request_id:
type: string
description: Unique request ID
SendMessageResponse:
type: object
description: The non-streaming response object for the sendMessage
properties:
message:
$ref: '#/components/schemas/MessageObject'
request_id:
type: string
description: Unique request ID
required:
- message
MessageObject:
type: object
title: The message object
description: Represents a message within a chat.
properties:
role:
description: The entity that produced the message. One of `user` or `analyst`.
type: string
enum:
- user
- analyst
content:
description: The content of the message in array of text or SQL.
type: array
items:
$ref: '#/components/schemas/MessageContent'
required:
- content
MessageContent:
type: object
properties:
type:
type: string
enum:
- text
- sql
- suggestions
discriminator:
propertyName: type
mapping:
text: '#/components/schemas/MessageContentTextObject'
sql: '#/components/schemas/MessageContentSqlObject'
suggestions: '#/components/schemas/MessageContentSuggestionsObject'
MessageContentTextObject:
allOf:
- $ref: '#/components/schemas/MessageContent'
- title: Text
type: object
description: The text content that is part of a message.
properties:
text:
type: string
example: To answer the question "What is the profit per store?" we must
aggregate sales at the store level
required:
- text
MessageContentSqlObject:
allOf:
- $ref: '#/components/schemas/MessageContent'
- title: SQL
type: object
description: The SQL content that is part of a message.
properties:
statement:
type: string
description: The executable SQL statement
example: SELECT store, SUM(profit) FROM sales GROUP BY store
required:
- statement
MessageContentSuggestionsObject:
allOf:
- $ref: '#/components/schemas/MessageContent'
- title: Suggested Questions
type: object
description: If SQL cannot be generated, a list of questions the semantic
model can generate SQL for.
properties:
suggestions:
type: array
items:
type: string
example: What is the lifetime revenue for the top 5 clients?
required:
- suggestions
SendMessageRequest:
type: object
description: The request object for sendMessage requests
properties:
semantic_model_file:
type: string
description: The path to a file stored in a Snowflake Stage holding the
semantic model yaml. Must be in the database and schema provided in the
url parameters.
example: '@my_stage/my_semantic_model.yaml'
semantic_model:
type: string
description: A string containing the entire semantic model yaml
example: 'name: my_semantic_model\ntables:\n - name: orders\n...'
stream:
type: boolean
description: Whether to stream the response or not
default: false
messages:
type: array
items:
$ref: '#/components/schemas/MessageObject'
required:
- messages
tags:
- name: cortex-analyst
Loading

0 comments on commit e6fe000

Please sign in to comment.