w.genie: Genie

class databricks.sdk.service.dashboards.GenieAPI

Genie provides a no-code experience for business users, powered by AI/BI. Analysts set up spaces that business users can use to ask questions using natural language. Genie uses data registered to Unity Catalog and requires at least CAN USE permission on a Pro or Serverless SQL warehouse. Also, Databricks Assistant must be enabled.

create_message(space_id: str, conversation_id: str, content: str [, enable_visualization: Optional[bool]]) → Wait[GenieMessage]

Sends a new message in a chat-mode [conversation](:method:genie/startconversation). The AI response uses all previously created messages in the conversation to respond.

Parameters:
  • space_id – str The ID associated with the Genie space where the conversation is started.

  • conversation_id – str The ID associated with the conversation.

  • content – str User message content.

  • enable_visualization – bool (optional) Enable visualization generation.

Returns:

Long-running operation waiter for GenieMessage. See :method:wait_get_message_genie_completed for more details.

create_message_and_wait(space_id: str, conversation_id: str, content: str [, enable_visualization: Optional[bool], timeout: datetime.timedelta = 0:20:00]) → GenieMessage
create_message_comment(space_id: str, conversation_id: str, message_id: str, content: str) → GenieMessageComment

Create a comment on a conversation message.

Parameters:
  • space_id – str The ID associated with the Genie space.

  • conversation_id – str The ID associated with the conversation.

  • message_id – str The ID associated with the message.

  • content – str Comment text content.

Returns:

GenieMessageComment

create_space(warehouse_id: str, serialized_space: str [, description: Optional[str], parent_path: Optional[str], title: Optional[str]]) → GenieSpace

Creates a Genie space from a serialized payload.

Parameters:
  • warehouse_id – str Warehouse to associate with the new space

  • serialized_space – str 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.

  • description – str (optional) Optional description

  • parent_path – str (optional) Parent folder path where the space will be registered

  • title – str (optional) Optional title override

Returns:

GenieSpace

delete_conversation(space_id: str, conversation_id: str)

Delete a conversation.

Parameters:
  • space_id – str The ID associated with the Genie space where the conversation is located.

  • conversation_id – str The ID of the conversation to delete.

delete_conversation_message(space_id: str, conversation_id: str, message_id: str)

Delete a conversation message.

Parameters:
  • space_id – str The ID associated with the Genie space where the message is located.

  • conversation_id – str The ID associated with the conversation.

  • message_id – str The ID associated with the message to delete.

download_message_attachment_visualization(name: str) → DownloadMessageAttachmentVisualizationResponse

Download a rendered image of a message visualization attachment. The response body is the raw PNG image, not a JSON payload. This is only available if the attachment is a visualization and the message status is COMPLETED. This endpoint is not supported for Private Link workspaces.

Parameters:

name – str The resource name of the attachment to render, in the format spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}.

Returns:

DownloadMessageAttachmentVisualizationResponse

execute_message_attachment_query(space_id: str, conversation_id: str, message_id: str, attachment_id: str) → GenieGetMessageQueryResultResponse

Execute the SQL for a message query attachment. Use this API when the query attachment has expired and needs to be re-executed.

Parameters:
  • space_id – str Genie space ID

  • conversation_id – str Conversation ID

  • message_id – str Message ID

  • attachment_id – str Attachment ID

Returns:

GenieGetMessageQueryResultResponse

execute_message_query(space_id: str, conversation_id: str, message_id: str) → GenieGetMessageQueryResultResponse

DEPRECATED: Use [Execute Message Attachment Query](:method:genie/executemessageattachmentquery) instead.

Parameters:
  • space_id – str Genie space ID

  • conversation_id – str Conversation ID

  • message_id – str Message ID

Returns:

GenieGetMessageQueryResultResponse

generate_download_full_query_result(space_id: str, conversation_id: str, message_id: str, attachment_id: str) → GenieGenerateDownloadFullQueryResultResponse

Initiates a new SQL execution and returns a download_id and download_id_signature that you can use to track the progress of the download. The query result is stored in an external link and can be retrieved using the [Get Download Full Query Result](:method:genie/getdownloadfullqueryresult) API. Both download_id and download_id_signature must be provided when calling the Get endpoint.

Warning: Databricks strongly recommends that you protect the URLs that are returned by the ``EXTERNAL_LINKS`` disposition.

When you use the EXTERNAL_LINKS disposition, a short-lived cloud-storage URL is generated to download the results. The URL contains temporary access credentials, so protect it and do not set an Authorization header in the download request.

See [Execute Statement](:method:statementexecution/executestatement) for more details.

Parameters:
  • space_id – str Genie space ID

  • conversation_id – str Conversation ID

  • message_id – str Message ID

  • attachment_id – str Attachment ID

Returns:

GenieGenerateDownloadFullQueryResultResponse

genie_cancel_response(agent_id: str, conversation_id: str, response_id: str) → GenieMessage

Cancels an in-flight agent-mode response. response_id is the id returned in the response.created event from the agent-mode responses endpoint. The response stops at the next agent boundary and its terminal state is returned.

Parameters:
  • agent_id – str The ID of the Genie agent (synonymous with the Genie space ID).

  • conversation_id – str The ID of the conversation containing the response.

  • response_id – str The ID of the response to cancel (the id from the response.created event).

Returns:

GenieMessage

genie_create_eval_run(space_id: str [, benchmark_question_ids: Optional[List[str]]]) → GenieEvalRunResponse

Creates and runs chat-mode evaluations for multiple benchmark questions in a Genie space.

Parameters:
  • space_id – str The ID associated with the Genie space where the evaluations will be executed.

  • benchmark_question_ids – List[str] (optional) List of benchmark question IDs to evaluate. These questions must exist in the specified Genie space. If none are specified, then all benchmark questions are evaluated.

Returns:

GenieEvalRunResponse

genie_get_eval_result_details(space_id: str, eval_run_id: str, result_id: str) → GenieEvalResultDetails

Get details for evaluation results.

Parameters:
  • space_id – str The ID associated with the Genie space where the evaluation run is located.

  • eval_run_id – str The unique identifier for the evaluation run.

  • result_id – str The unique identifier for the evaluation result.

Returns:

GenieEvalResultDetails

genie_get_eval_run(space_id: str, eval_run_id: str) → GenieEvalRunResponse

Get evaluation run details.

Parameters:
  • space_id – str The ID associated with the Genie space where the evaluation run is located.

  • eval_run_id – str

Returns:

GenieEvalRunResponse

genie_list_eval_results(space_id: str, eval_run_id: str [, page_size: Optional[int], page_token: Optional[str]]) → GenieListEvalResultsResponse

List evaluation results for a specific evaluation run.

Parameters:
  • space_id – str The ID associated with the Genie space where the evaluation run is located.

  • eval_run_id – str The unique identifier for the evaluation run.

  • page_size – int (optional) Maximum number of eval results to return per page.

  • page_token – str (optional) Opaque token to retrieve the next page of results.

Returns:

GenieListEvalResultsResponse

genie_list_eval_runs(space_id: str [, page_size: Optional[int], page_token: Optional[str]]) → GenieListEvalRunsResponse

Lists all evaluation runs in a space.

Parameters:
  • space_id – str The ID associated with the Genie space where the evaluation run is located.

  • page_size – int (optional) Maximum number of evaluation runs to return per page

  • page_token – str (optional) Token to get the next page of results

Returns:

GenieListEvalRunsResponse

get_download_full_query_result(space_id: str, conversation_id: str, message_id: str, attachment_id: str, download_id: str, download_id_signature: str) → GenieGetDownloadFullQueryResultResponse

After [Generating a Full Query Result Download](:method:genie/generatedownloadfullqueryresult) and successfully receiving a download_id and download_id_signature, use this API to poll the download progress. Both download_id and download_id_signature are required to call this endpoint. When the download is complete, the API returns the result in the EXTERNAL_LINKS disposition, containing one or more external links to the query result files.

Warning: Databricks strongly recommends that you protect the URLs that are returned by the ``EXTERNAL_LINKS`` disposition.

When you use the EXTERNAL_LINKS disposition, a short-lived cloud-storage URL is generated to download the results. The URL contains temporary access credentials, so protect it and do not set an Authorization header in the download request.

See [Execute Statement](:method:statementexecution/executestatement) for more details.

Parameters:
  • space_id – str Genie space ID

  • conversation_id – str Conversation ID

  • message_id – str Message ID

  • attachment_id – str Attachment ID

  • download_id – str Download ID. This ID is provided by the [Generate Download endpoint](:method:genie/generateDownloadFullQueryResult)

  • download_id_signature – str JWT signature for the download_id to ensure secure access to query results

Returns:

GenieGetDownloadFullQueryResultResponse

get_message(space_id: str, conversation_id: str, message_id: str) → GenieMessage

Gets a message from a chat-mode or agent-mode conversation. For a complete agent-mode transcript, use the List conversation items endpoint.

Parameters:
  • space_id – str The ID associated with the Genie space where the target conversation is located.

  • conversation_id – str The ID associated with the target conversation.

  • message_id – str The ID associated with the target message from the identified conversation.

Returns:

GenieMessage

get_message_attachment_query_result(space_id: str, conversation_id: str, message_id: str, attachment_id: str) → GenieGetMessageQueryResultResponse

Get the result of SQL query if the message has a query attachment. This is only available if a message has a query attachment and the message status is EXECUTING_QUERY OR COMPLETED.

Parameters:
  • space_id – str Genie space ID

  • conversation_id – str Conversation ID

  • message_id – str Message ID

  • attachment_id – str Attachment ID

Returns:

GenieGetMessageQueryResultResponse

get_message_query_result(space_id: str, conversation_id: str, message_id: str) → GenieGetMessageQueryResultResponse

DEPRECATED: Use [Get Message Attachment Query Result](:method:genie/getmessageattachmentqueryresult) instead.

Parameters:
  • space_id – str Genie space ID

  • conversation_id – str Conversation ID

  • message_id – str Message ID

Returns:

GenieGetMessageQueryResultResponse

get_message_query_result_by_attachment(space_id: str, conversation_id: str, message_id: str, attachment_id: str) → GenieGetMessageQueryResultResponse

DEPRECATED: Use [Get Message Attachment Query Result](:method:genie/getmessageattachmentqueryresult) instead.

Parameters:
  • space_id – str Genie space ID

  • conversation_id – str Conversation ID

  • message_id – str Message ID

  • attachment_id – str Attachment ID

Returns:

GenieGetMessageQueryResultResponse

get_space(space_id: str [, include_serialized_space: Optional[bool]]) → GenieSpace

Get details of a Genie Space.

Parameters:
  • space_id – str The ID associated with the Genie space

  • include_serialized_space – bool (optional) Whether to include the serialized space export in the response. Requires at least CAN EDIT permission on the space.

Returns:

GenieSpace

list_conversation_comments(space_id: str, conversation_id: str [, page_size: Optional[int], page_token: Optional[str]]) → GenieListConversationCommentsResponse

List all comments across all messages in a conversation.

Parameters:
  • space_id – str The ID associated with the Genie space.

  • conversation_id – str The ID associated with the conversation.

  • page_size – int (optional) Maximum number of comments to return per page.

  • page_token – str (optional) Pagination token for getting the next page of results.

Returns:

GenieListConversationCommentsResponse

list_conversation_messages(space_id: str, conversation_id: str [, page_size: Optional[int], page_token: Optional[str]]) → GenieListConversationMessagesResponse

Lists messages in a chat-mode or agent-mode conversation. Agent-mode messages are returned as GenieMessage projections. Use the List conversation items endpoint for the complete reasoning and tool-call history.

Parameters:
  • space_id – str The ID associated with the Genie space where the conversation is located

  • conversation_id – str The ID of the conversation to list messages from

  • page_size – int (optional) Maximum number of messages to return per page

  • page_token – str (optional) Token to get the next page of results

Returns:

GenieListConversationMessagesResponse

list_conversations(space_id: str [, include_all: Optional[bool], page_size: Optional[int], page_token: Optional[str]]) → GenieListConversationsResponse

Get a list of conversations in a Genie Space.

Parameters:
  • space_id – str The ID of the Genie space to retrieve conversations from.

  • include_all – bool (optional) Include all conversations in the space across all users. Requires at least CAN MANAGE permission on the space.

  • page_size – int (optional) Maximum number of conversations to return per page

  • page_token – str (optional) Token to get the next page of results

Returns:

GenieListConversationsResponse

list_message_comments(space_id: str, conversation_id: str, message_id: str [, page_size: Optional[int], page_token: Optional[str]]) → GenieListMessageCommentsResponse

List comments on a specific conversation message.

Parameters:
  • space_id – str The ID associated with the Genie space.

  • conversation_id – str The ID associated with the conversation.

  • message_id – str The ID associated with the message.

  • page_size – int (optional) Maximum number of comments to return per page.

  • page_token – str (optional) Pagination token for getting the next page of results.

Returns:

GenieListMessageCommentsResponse

list_spaces([, page_size: Optional[int], page_token: Optional[str]]) → GenieListSpacesResponse

Get list of Genie Spaces.

Parameters:
  • page_size – int (optional) Maximum number of spaces to return per page

  • page_token – str (optional) Pagination token for getting the next page of results

Returns:

GenieListSpacesResponse

send_message_feedback(space_id: str, conversation_id: str, message_id: str, rating: GenieFeedbackRating [, comment: Optional[str]])

Sends feedback for a message in a chat-mode or agent-mode conversation.

Parameters:
  • space_id – str The ID associated with the Genie space where the message is located.

  • conversation_id – str The ID associated with the conversation.

  • message_id – str The ID associated with the message to provide feedback for.

  • rating – GenieFeedbackRating The rating (POSITIVE, NEGATIVE, or NONE).

  • comment – str (optional) Optional text feedback that will be stored as a comment.

start_conversation(space_id: str, content: str [, enable_visualization: Optional[bool]]) → Wait[GenieMessage]

Starts a new chat-mode conversation and sends its first message.

Parameters:
  • space_id – str The ID associated with the Genie space where you want to start a conversation.

  • content – str The text of the message that starts the conversation.

  • enable_visualization – bool (optional) Enable visualization generation.

Returns:

Long-running operation waiter for GenieMessage. See :method:wait_get_message_genie_completed for more details.

start_conversation_and_wait(space_id: str, content: str [, enable_visualization: Optional[bool], timeout: datetime.timedelta = 0:20:00]) → GenieMessage
trash_space(space_id: str)

Move a Genie Space to the trash.

Parameters:

space_id – str The ID associated with the Genie space to be sent to the trash.

update_space(space_id: str [, description: Optional[str], etag: Optional[str], parent_path: Optional[str], serialized_space: Optional[str], title: Optional[str], warehouse_id: Optional[str]]) → GenieSpace

Updates a Genie space with a serialized payload.

Parameters:
  • space_id – str Genie space ID

  • description – str (optional) Optional description

  • etag – str (optional) ETag returned by a previous GET or UPDATE. When set, the update will fail if the space has been modified since. Omit to apply the update unconditionally.

  • parent_path – str (optional) Parent workspace folder path to move this Genie space under.

  • serialized_space – str (optional) The contents of the Genie Space in serialized string form (full replacement). 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 – str (optional) Optional title override

  • warehouse_id – str (optional) Optional warehouse override

Returns:

GenieSpace

wait_get_message_genie_completed(conversation_id: str, message_id: str, space_id: str, timeout: datetime.timedelta = 0:20:00, callback: Optional[Callable[[GenieMessage], None]]) → GenieMessage