Knowledge Assistants

These dataclasses are used in the SDK to represent API requests and responses for services in the databricks.sdk.service.knowledgeassistants module.

class databricks.sdk.service.knowledgeassistants.Example(question: str, create_time: Timestamp | None = None, example_id: str | None = None, guidelines: List[str] | None = None, name: str | None = None, update_time: Timestamp | None = None)

An example associated with a Knowledge Assistant. Contains a question and guidelines for how the assistant should respond.

question: str

The example question.

create_time: Timestamp | None = None

Timestamp when this example was created.

example_id: str | None = None

The universally unique identifier (UUID) of the example.

guidelines: List[str] | None = None

Guidelines for answering the question. Optional — examples may be created with just a question; the front-end form does not require guidelines.

name: str | None = None

Full resource name: knowledge-assistants/{knowledge_assistant_id}/examples/{example_id}

update_time: Timestamp | None = None

Timestamp when this example was last updated.

as_dict() dict

Serializes the Example into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the Example into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) Example

Deserializes the Example from a dictionary.

class databricks.sdk.service.knowledgeassistants.FileTableSpec(table_name: str, file_col: str)

FileTableSpec specifies a file table source configuration.

table_name: str

Full UC name of the table, in the format of {CATALOG}.{SCHEMA}.{TABLE_NAME}.

file_col: str

The name of the column containing BINARY file content to be indexed.

as_dict() dict

Serializes the FileTableSpec into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the FileTableSpec into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) FileTableSpec

Deserializes the FileTableSpec from a dictionary.

class databricks.sdk.service.knowledgeassistants.FilesSpec(path: str)

FilesSpec specifies a files source configuration.

path: str

A UC volume path that includes a list of files.

as_dict() dict

Serializes the FilesSpec into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the FilesSpec into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) FilesSpec

Deserializes the FilesSpec from a dictionary.

class databricks.sdk.service.knowledgeassistants.GetKnowledgeAssistantPermissionLevelsResponse(permission_levels: 'Optional[List[KnowledgeAssistantPermissionsDescription]]' = None)
permission_levels: List[KnowledgeAssistantPermissionsDescription] | None = None

Specific permission levels

as_dict() dict

Serializes the GetKnowledgeAssistantPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the GetKnowledgeAssistantPermissionLevelsResponse into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) GetKnowledgeAssistantPermissionLevelsResponse

Deserializes the GetKnowledgeAssistantPermissionLevelsResponse from a dictionary.

class databricks.sdk.service.knowledgeassistants.IndexSpec(index_name: str, text_col: str, doc_uri_col: str)

IndexSpec specifies a vector search index source configuration.

index_name: str

Full UC name of the vector search index, in the format of {CATALOG}.{SCHEMA}.{INDEX_NAME}.

text_col: str

The column that includes the document text for retrieval.

doc_uri_col: str

The column that specifies a link or reference to where the information came from.

as_dict() dict

Serializes the IndexSpec into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the IndexSpec into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) IndexSpec

Deserializes the IndexSpec from a dictionary.

class databricks.sdk.service.knowledgeassistants.KnowledgeAssistant(display_name: str, description: str, create_time: Timestamp | None = None, creator: str | None = None, endpoint_name: str | None = None, error_info: str | None = None, experiment_id: str | None = None, id: str | None = None, instructions: str | None = None, name: str | None = None, state: KnowledgeAssistantState | None = None)

Entity message that represents a knowledge assistant. Note: REQUIRED annotations below represent create-time requirements. For updates, required fields are determined by the update mask.

display_name: str

The 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.

description: str

Description 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.

create_time: Timestamp | None = None

Creation timestamp.

creator: str | None = None

The creator of the Knowledge Assistant.

endpoint_name: str | None = None

The name of the knowledge assistant agent endpoint.

error_info: str | None = None

Error details when the Knowledge Assistant is in FAILED state.

experiment_id: str | None = None

The MLflow experiment ID.

id: str | None = None

Deprecated: use knowledge_assistant_id instead.

instructions: str | None = None

Additional 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.

name: str | None = None

The resource name of the Knowledge Assistant. Format: knowledge-assistants/{knowledge_assistant_id}

state: KnowledgeAssistantState | None = None

State of the Knowledge Assistant. Not returned in List responses.

as_dict() dict

Serializes the KnowledgeAssistant into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the KnowledgeAssistant into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) KnowledgeAssistant

Deserializes the KnowledgeAssistant from a dictionary.

class databricks.sdk.service.knowledgeassistants.KnowledgeAssistantAccessControlRequest(group_name: 'Optional[str]' = None, permission_level: 'Optional[KnowledgeAssistantPermissionLevel]' = None, service_principal_name: 'Optional[str]' = None, user_name: 'Optional[str]' = None)
group_name: str | None = None

name of the group

permission_level: KnowledgeAssistantPermissionLevel | None = None
service_principal_name: str | None = None

application ID of a service principal

user_name: str | None = None

name of the user

as_dict() dict

Serializes the KnowledgeAssistantAccessControlRequest into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the KnowledgeAssistantAccessControlRequest into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) KnowledgeAssistantAccessControlRequest

Deserializes the KnowledgeAssistantAccessControlRequest from a dictionary.

class databricks.sdk.service.knowledgeassistants.KnowledgeAssistantAccessControlResponse(all_permissions: 'Optional[List[KnowledgeAssistantPermission]]' = None, display_name: 'Optional[str]' = None, group_name: 'Optional[str]' = None, service_principal_name: 'Optional[str]' = None, user_name: 'Optional[str]' = None)
all_permissions: List[KnowledgeAssistantPermission] | None = None

All permissions.

display_name: str | None = None

Display name of the user or service principal.

group_name: str | None = None

name of the group

service_principal_name: str | None = None

Name of the service principal.

user_name: str | None = None

name of the user

as_dict() dict

Serializes the KnowledgeAssistantAccessControlResponse into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the KnowledgeAssistantAccessControlResponse into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) KnowledgeAssistantAccessControlResponse

Deserializes the KnowledgeAssistantAccessControlResponse from a dictionary.

class databricks.sdk.service.knowledgeassistants.KnowledgeAssistantPermission(inherited: 'Optional[bool]' = None, inherited_from_object: 'Optional[List[str]]' = None, permission_level: 'Optional[KnowledgeAssistantPermissionLevel]' = None)
inherited: bool | None = None
inherited_from_object: List[str] | None = None
permission_level: KnowledgeAssistantPermissionLevel | None = None
as_dict() dict

Serializes the KnowledgeAssistantPermission into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the KnowledgeAssistantPermission into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) KnowledgeAssistantPermission

Deserializes the KnowledgeAssistantPermission from a dictionary.

class databricks.sdk.service.knowledgeassistants.KnowledgeAssistantPermissionLevel

Permission level

CAN_MANAGE = "CAN_MANAGE"
CAN_QUERY = "CAN_QUERY"
class databricks.sdk.service.knowledgeassistants.KnowledgeAssistantPermissions(access_control_list: 'Optional[List[KnowledgeAssistantAccessControlResponse]]' = None, object_id: 'Optional[str]' = None, object_type: 'Optional[str]' = None)
access_control_list: List[KnowledgeAssistantAccessControlResponse] | None = None
object_id: str | None = None
object_type: str | None = None
as_dict() dict

Serializes the KnowledgeAssistantPermissions into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the KnowledgeAssistantPermissions into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) KnowledgeAssistantPermissions

Deserializes the KnowledgeAssistantPermissions from a dictionary.

class databricks.sdk.service.knowledgeassistants.KnowledgeAssistantPermissionsDescription(description: 'Optional[str]' = None, permission_level: 'Optional[KnowledgeAssistantPermissionLevel]' = None)
description: str | None = None
permission_level: KnowledgeAssistantPermissionLevel | None = None
as_dict() dict

Serializes the KnowledgeAssistantPermissionsDescription into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the KnowledgeAssistantPermissionsDescription into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) KnowledgeAssistantPermissionsDescription

Deserializes the KnowledgeAssistantPermissionsDescription from a dictionary.

class databricks.sdk.service.knowledgeassistants.KnowledgeAssistantState
ACTIVE = "ACTIVE"
CREATING = "CREATING"
FAILED = "FAILED"
class databricks.sdk.service.knowledgeassistants.KnowledgeSource(display_name: str, description: str, source_type: str, create_time: Timestamp | None = None, file_table: FileTableSpec | None = None, files: FilesSpec | None = None, id: str | None = None, index: IndexSpec | None = None, knowledge_cutoff_time: Timestamp | None = None, name: str | None = None, state: KnowledgeSourceState | None = None)

KnowledgeSource represents a source of knowledge for the KnowledgeAssistant. Used in create/update requests and returned in Get/List responses. Note: REQUIRED annotations below represent create-time requirements. For updates, required fields are determined by the update mask.

display_name: str

Human-readable display name of the knowledge source. Required when creating a Knowledge Source. When updating a Knowledge Source, optional unless included in update_mask.

description: str

Description of the knowledge source. Required when creating a Knowledge Source. When updating a Knowledge Source, optional unless included in update_mask.

source_type: str

The type of the source: “index”, “files”, or “file_table”. Required when creating a Knowledge Source. When updating a Knowledge Source, this field is ignored.

create_time: Timestamp | None = None

Timestamp when this knowledge source was created.

file_table: FileTableSpec | None = None
files: FilesSpec | None = None
id: str | None = None
index: IndexSpec | None = None
knowledge_cutoff_time: Timestamp | None = None

Timestamp representing the cutoff before which content in this knowledge source is being ingested.

name: str | None = None

Full resource name: knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id}

state: KnowledgeSourceState | None = None
as_dict() dict

Serializes the KnowledgeSource into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the KnowledgeSource into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) KnowledgeSource

Deserializes the KnowledgeSource from a dictionary.

class databricks.sdk.service.knowledgeassistants.KnowledgeSourceState
FAILED_UPDATE = "FAILED_UPDATE"
UPDATED = "UPDATED"
UPDATING = "UPDATING"
class databricks.sdk.service.knowledgeassistants.ListExamplesResponse(examples: List[Example] | None = None, next_page_token: str | None = None)

A list of Knowledge Assistant examples.

examples: List[Example] | None = None
next_page_token: str | None = None
as_dict() dict

Serializes the ListExamplesResponse into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the ListExamplesResponse into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) ListExamplesResponse

Deserializes the ListExamplesResponse from a dictionary.

class databricks.sdk.service.knowledgeassistants.ListKnowledgeAssistantsResponse(knowledge_assistants: List[KnowledgeAssistant] | None = None, next_page_token: str | None = None)

A list of Knowledge Assistants.

knowledge_assistants: List[KnowledgeAssistant] | None = None
next_page_token: str | None = None

A token that can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

as_dict() dict

Serializes the ListKnowledgeAssistantsResponse into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the ListKnowledgeAssistantsResponse into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) ListKnowledgeAssistantsResponse

Deserializes the ListKnowledgeAssistantsResponse from a dictionary.

class databricks.sdk.service.knowledgeassistants.ListKnowledgeSourcesResponse(knowledge_sources: 'Optional[List[KnowledgeSource]]' = None, next_page_token: 'Optional[str]' = None)
knowledge_sources: List[KnowledgeSource] | None = None
next_page_token: str | None = None
as_dict() dict

Serializes the ListKnowledgeSourcesResponse into a dictionary suitable for use as a JSON request body.

as_shallow_dict() dict

Serializes the ListKnowledgeSourcesResponse into a shallow dictionary of its immediate attributes.

classmethod from_dict(d: Dict[str, Any]) ListKnowledgeSourcesResponse

Deserializes the ListKnowledgeSourcesResponse from a dictionary.