Skip to main content

knowledge_assistants

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

Overview​

Nameknowledge_assistants
TypeResource
Iddatabricks_workspace.knowledgeassistants.knowledge_assistants

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringDeprecated: use knowledge_assistant_id instead.
namestringThe resource name of the Knowledge Assistant. Format: knowledge-assistants/{knowledge_assistant_id}
experiment_idstringThe MLflow experiment ID.
display_namestringThe display name of the Knowledge Assistant, unique at workspace level. Required when creating a Knowledge Assistant. When updating a Knowledge Assistant, optional unless included in update_mask.
endpoint_namestringThe name of the knowledge assistant agent endpoint.
create_timestring (date-time)Creation timestamp.
creatorstringThe creator of the Knowledge Assistant.
descriptionstringDescription of what this agent can do (user-facing). Required when creating a Knowledge Assistant. When updating a Knowledge Assistant, optional unless included in update_mask.
error_infostringError details when the Knowledge Assistant is in FAILED state.
instructionsstringAdditional global instructions on how the agent should generate answers. Optional on create and update. When updating a Knowledge Assistant, include this field in update_mask to modify it.
statestringState of the Knowledge Assistant. Not returned in List responses. (ACTIVE, CREATING, FAILED)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectknowledge_assistant_id, deployment_name, workspace_domainGets a Knowledge Assistant.
listselectdeployment_name, workspace_domainpage_size, page_tokenList Knowledge Assistants
createinsertdeployment_name, workspace_domain, display_name, descriptionCreates a Knowledge Assistant.
updateupdateknowledge_assistant_id, update_mask, deployment_name, workspace_domain, display_name, descriptionUpdates a Knowledge Assistant.
deletedeleteknowledge_assistant_id, deployment_name, workspace_domainDeletes a Knowledge Assistant.

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
deployment_namestringThe Databricks workspace deployment name: the host prefix of the workspace URL (dbc-abcd0123-a1bc on AWS, adb-1234567890123456.7 on Azure, 1234567890123456.7 on GCP). Set DATABRICKS_DEPLOYMENT_NAME to default it for the session. (default: dbc-abcd0123-a1bc, x-stackQL-envVar: DATABRICKS_DEPLOYMENT_NAME)
knowledge_assistant_idstringThe knowledge_assistant_id segment of the name resource name (knowledge-assistants/{knowledge_assistant_id}). The resource name of the knowledge assistant to be deleted. Format: knowledge-assistants/{knowledge_assistant_id}
update_maskobjectComma-delimited list of fields to update on the Knowledge Assistant. Allowed values: display_name, description, instructions. Examples: - display_name - description,instructions
workspace_domainstringThe Databricks workspace domain suffix for the cloud. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws). (default: cloud.databricks.com, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"cloud.databricks.com","azure":"azuredatabricks.net","gcp":"gcp.databricks.com"}})
page_sizeintegerThe maximum number of knowledge assistants to return. If unspecified, at most 100 knowledge assistants will be returned. The maximum value is 100; values above 100 will be coerced to 100.
page_tokenstringA page token, received from a previous ListKnowledgeAssistants call. Provide this to retrieve the subsequent page. If unspecified, the first page will be returned.

SELECT examples​

Gets a Knowledge Assistant.

SELECT
id,
name,
experiment_id,
display_name,
endpoint_name,
create_time,
creator,
description,
error_info,
instructions,
state
FROM databricks_workspace.knowledgeassistants.knowledge_assistants
WHERE knowledge_assistant_id = '{{ knowledge_assistant_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND workspace_domain = '{{ workspace_domain }}' -- required
;

INSERT examples​

Creates a Knowledge Assistant.

INSERT INTO databricks_workspace.knowledgeassistants.knowledge_assistants (
display_name,
description,
create_time,
creator,
endpoint_name,
error_info,
experiment_id,
id,
instructions,
name,
state,
deployment_name,
workspace_domain
)
SELECT
'{{ display_name }}' /* required */,
'{{ description }}' /* required */,
'{{ create_time }}',
'{{ creator }}',
'{{ endpoint_name }}',
'{{ error_info }}',
'{{ experiment_id }}',
'{{ id }}',
'{{ instructions }}',
'{{ name }}',
'{{ state }}',
'{{ deployment_name }}',
'{{ workspace_domain }}'
RETURNING
id,
name,
experiment_id,
display_name,
endpoint_name,
create_time,
creator,
description,
error_info,
instructions,
state
;

UPDATE examples​

Updates a Knowledge Assistant.

UPDATE databricks_workspace.knowledgeassistants.knowledge_assistants
SET
display_name = '{{ display_name }}',
description = '{{ description }}',
create_time = '{{ create_time }}',
creator = '{{ creator }}',
endpoint_name = '{{ endpoint_name }}',
error_info = '{{ error_info }}',
experiment_id = '{{ experiment_id }}',
id = '{{ id }}',
instructions = '{{ instructions }}',
name = '{{ name }}',
state = '{{ state }}'
WHERE
knowledge_assistant_id = '{{ knowledge_assistant_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
AND display_name = '{{ display_name }}' --required
AND description = '{{ description }}' --required
RETURNING
id,
name,
experiment_id,
display_name,
endpoint_name,
create_time,
creator,
description,
error_info,
instructions,
state;

DELETE examples​

Deletes a Knowledge Assistant.

DELETE FROM databricks_workspace.knowledgeassistants.knowledge_assistants
WHERE knowledge_assistant_id = '{{ knowledge_assistant_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
;