genie
Creates, updates, deletes, gets or lists a genie resource.
Overview
| Name | genie |
| Type | Resource |
| Id | databricks_workspace.dashboards.genie |
Fields
The following fields are returned by SELECT queries:
- genie_list_message_comments
- genie_list_conversation_comments
- genie_download_message_attachment_visualization
- get
- list
| Name | Datatype | Description |
|---|---|---|
comments | array | |
next_page_token | string | Token to get the next page of results. |
| Name | Datatype | Description |
|---|---|---|
comments | array | |
next_page_token | string | Token to get the next page of results. |
| Name | Datatype | Description |
|---|
| Name | Datatype | Description |
|---|---|---|
space_id | string | |
warehouse_id | string | Warehouse associated with the Genie Space |
description | string | Description of the Genie Space |
etag | string | ETag for this space. Pass this value back in the update request to prevent overwriting concurrent changes. |
parent_path | string | Parent folder path of the Genie Space |
serialized_space | string | The contents of the Genie Space in serialized string form. This field is excluded in List Genie spaces responses. Use the [Get Genie Space](:method:genie/getspace) API to retrieve an example response, which includes the ``serialized_space`` field. This field provides the structure of the JSON string that represents the space's layout and components. |
title | string | Title of the Genie Space |
| Name | Datatype | Description |
|---|---|---|
next_page_token | string | |
spaces | array | List of Genie spaces |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
genie_list_message_comments | select | space_id, conversation_id, message_id, deployment_name | page_size, page_token | List comments on a specific conversation message. |
genie_list_conversation_comments | select | space_id, conversation_id, deployment_name | page_size, page_token | List all comments across all messages in a conversation. |
genie_download_message_attachment_visualization | select | name, deployment_name | Download a rendered image of a message visualization attachment. The response body is the raw PNG | |
get | select | space_id, deployment_name | include_serialized_space | Get details of a Genie Space. |
list | select | deployment_name | page_size, page_token | Get list of Genie Spaces. |
genie_create_message_comment | insert | space_id, conversation_id, message_id, deployment_name, content | Create a comment on a conversation message. | |
create | insert | deployment_name, warehouse_id, serialized_space | Creates a Genie space from a serialized payload. | |
update | update | space_id, deployment_name | Updates a Genie space with a serialized payload. | |
delete | delete | space_id, deployment_name | Move a Genie Space to the trash. |
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 |
|---|---|---|
conversation_id | string | The ID associated with the conversation. |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
message_id | string | The ID associated with the message. |
name | string | The resource name of the attachment to render, in the format spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}. |
space_id | string | The ID associated with the Genie space to be sent to the trash. |
include_serialized_space | boolean | Whether to include the serialized space export in the response. Requires at least CAN EDIT permission on the space. |
page_size | integer | Maximum number of spaces to return per page |
page_token | string | Pagination token for getting the next page of results |
SELECT examples
- genie_list_message_comments
- genie_list_conversation_comments
- genie_download_message_attachment_visualization
- get
- list
List comments on a specific conversation message.
SELECT
comments,
next_page_token
FROM databricks_workspace.dashboards.genie
WHERE space_id = '{{ space_id }}' -- required
AND conversation_id = '{{ conversation_id }}' -- required
AND message_id = '{{ message_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
List all comments across all messages in a conversation.
SELECT
comments,
next_page_token
FROM databricks_workspace.dashboards.genie
WHERE space_id = '{{ space_id }}' -- required
AND conversation_id = '{{ conversation_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
Download a rendered image of a message visualization attachment. The response body is the raw PNG
SELECT
*
FROM databricks_workspace.dashboards.genie
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
Get details of a Genie Space.
SELECT
space_id,
warehouse_id,
description,
etag,
parent_path,
serialized_space,
title
FROM databricks_workspace.dashboards.genie
WHERE space_id = '{{ space_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND include_serialized_space = '{{ include_serialized_space }}'
;
Get list of Genie Spaces.
SELECT
next_page_token,
spaces
FROM databricks_workspace.dashboards.genie
WHERE deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- genie_create_message_comment
- create
- Manifest
Create a comment on a conversation message.
INSERT INTO databricks_workspace.dashboards.genie (
content,
space_id,
conversation_id,
message_id,
deployment_name
)
SELECT
'{{ content }}' /* required */,
'{{ space_id }}',
'{{ conversation_id }}',
'{{ message_id }}',
'{{ deployment_name }}'
RETURNING
conversation_id,
message_comment_id,
message_id,
space_id,
user_id,
content,
created_timestamp
;
Creates a Genie space from a serialized payload.
INSERT INTO databricks_workspace.dashboards.genie (
warehouse_id,
serialized_space,
description,
parent_path,
title,
deployment_name
)
SELECT
'{{ warehouse_id }}' /* required */,
'{{ serialized_space }}' /* required */,
'{{ description }}',
'{{ parent_path }}',
'{{ title }}',
'{{ deployment_name }}'
RETURNING
space_id,
warehouse_id,
description,
etag,
parent_path,
serialized_space,
title
;
# Description fields are for documentation purposes
- name: genie
props:
- name: space_id
value: "{{ space_id }}"
description: Required parameter for the genie resource.
- name: conversation_id
value: "{{ conversation_id }}"
description: Required parameter for the genie resource.
- name: message_id
value: "{{ message_id }}"
description: Required parameter for the genie resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the genie resource.
- name: content
value: "{{ content }}"
description: |
Comment text content.
- name: warehouse_id
value: "{{ warehouse_id }}"
description: |
Warehouse to associate with the new space
- name: serialized_space
value: "{{ serialized_space }}"
description: |
The contents of the Genie Space in serialized string form. Use the [Get Genie Space](:method:genie/getspace) API to retrieve an example response, which includes the ``serialized_space`` field. This field provides the structure of the JSON string that represents the space's layout and components.
- name: description
value: "{{ description }}"
description: |
Optional description
- name: parent_path
value: "{{ parent_path }}"
description: |
Parent folder path where the space will be registered
- name: title
value: "{{ title }}"
description: |
Optional title override
UPDATE examples
- update
Updates a Genie space with a serialized payload.
UPDATE databricks_workspace.dashboards.genie
SET
description = '{{ description }}',
etag = '{{ etag }}',
parent_path = '{{ parent_path }}',
serialized_space = '{{ serialized_space }}',
title = '{{ title }}',
warehouse_id = '{{ warehouse_id }}'
WHERE
space_id = '{{ space_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
space_id,
warehouse_id,
description,
etag,
parent_path,
serialized_space,
title;
DELETE examples
- delete
Move a Genie Space to the trash.
DELETE FROM databricks_workspace.dashboards.genie
WHERE space_id = '{{ space_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;