Skip to main content

genie

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

Overview

Namegenie
TypeResource
Iddatabricks_workspace.dashboards.genie

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
commentsarray
next_page_tokenstringToken to get the next page of results.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
genie_list_message_commentsselectspace_id, conversation_id, message_id, deployment_namepage_size, page_tokenList comments on a specific conversation message.
genie_list_conversation_commentsselectspace_id, conversation_id, deployment_namepage_size, page_tokenList all comments across all messages in a conversation.
genie_download_message_attachment_visualizationselectname, deployment_nameDownload a rendered image of a message visualization attachment. The response body is the raw PNG
getselectspace_id, deployment_nameinclude_serialized_spaceGet details of a Genie Space.
listselectdeployment_namepage_size, page_tokenGet list of Genie Spaces.
genie_create_message_commentinsertspace_id, conversation_id, message_id, deployment_name, contentCreate a comment on a conversation message.
createinsertdeployment_name, warehouse_id, serialized_spaceCreates a Genie space from a serialized payload.
updateupdatespace_id, deployment_nameUpdates a Genie space with a serialized payload.
deletedeletespace_id, deployment_nameMove 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.

NameDatatypeDescription
conversation_idstringThe ID associated with the conversation.
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
message_idstringThe ID associated with the message.
namestringThe resource name of the attachment to render, in the format spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}.
space_idstringThe ID associated with the Genie space to be sent to the trash.
include_serialized_spacebooleanWhether to include the serialized space export in the response. Requires at least CAN EDIT permission on the space.
page_sizeintegerMaximum number of spaces to return per page
page_tokenstringPagination token for getting the next page of results

SELECT examples

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 }}'
;

INSERT examples

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
;

UPDATE examples

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

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
;