knowledgeassistants

package
v0.119.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Manage Knowledge Assistants and related resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateKnowledgeAssistantRequest

type CreateKnowledgeAssistantRequest struct {
	// The Knowledge Assistant to create.
	KnowledgeAssistant KnowledgeAssistant `json:"knowledge_assistant"`
}

type CreateKnowledgeSourceRequest

type CreateKnowledgeSourceRequest struct {
	KnowledgeSource KnowledgeSource `json:"knowledge_source"`
	// Parent resource where this source will be created. Format:
	// knowledge-assistants/{knowledge_assistant_id}
	Parent string `json:"-" url:"-"`
}

type DeleteKnowledgeAssistantRequest

type DeleteKnowledgeAssistantRequest struct {
	// The resource name of the knowledge assistant to be deleted. Format:
	// knowledge-assistants/{knowledge_assistant_id}
	Name string `json:"-" url:"-"`
}

type DeleteKnowledgeSourceRequest

type DeleteKnowledgeSourceRequest struct {
	// The resource name of the Knowledge Source to delete. Format:
	// knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id}
	Name string `json:"-" url:"-"`
}

type FileTableSpec

type FileTableSpec struct {
	// The name of the column containing BINARY file content to be indexed.
	FileCol string `json:"file_col"`
	// Full UC name of the table, in the format of
	// {CATALOG}.{SCHEMA}.{TABLE_NAME}.
	TableName string `json:"table_name"`
}

FileTableSpec specifies a file table source configuration.

type FilesSpec

type FilesSpec struct {
	// A UC volume path that includes a list of files.
	Path string `json:"path"`
}

FilesSpec specifies a files source configuration.

type GetKnowledgeAssistantRequest

type GetKnowledgeAssistantRequest struct {
	// The resource name of the knowledge assistant. Format:
	// knowledge-assistants/{knowledge_assistant_id}
	Name string `json:"-" url:"-"`
}

type GetKnowledgeSourceRequest

type GetKnowledgeSourceRequest struct {
	// The resource name of the Knowledge Source. Format:
	// knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id}
	Name string `json:"-" url:"-"`
}

type IndexSpec

type IndexSpec struct {
	// The column that specifies a link or reference to where the information
	// came from.
	DocUriCol string `json:"doc_uri_col"`
	// Full UC name of the vector search index, in the format of
	// {CATALOG}.{SCHEMA}.{INDEX_NAME}.
	IndexName string `json:"index_name"`
	// The column that includes the document text for retrieval.
	TextCol string `json:"text_col"`
}

IndexSpec specifies a vector search index source configuration.

type KnowledgeAssistant

type KnowledgeAssistant struct {
	// Creation timestamp.
	CreateTime *time.Time `json:"create_time,omitempty"`
	// The creator of the Knowledge Assistant.
	Creator string `json:"creator,omitempty"`
	// 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.
	Description string `json:"description"`
	// 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.
	DisplayName string `json:"display_name"`
	// The name of the knowledge assistant agent endpoint.
	EndpointName string `json:"endpoint_name,omitempty"`
	// Error details when the Knowledge Assistant is in FAILED state.
	ErrorInfo string `json:"error_info,omitempty"`
	// The MLflow experiment ID.
	ExperimentId string `json:"experiment_id,omitempty"`
	// The universally unique identifier (UUID) of the Knowledge Assistant.
	Id string `json:"id,omitempty"`
	// 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.
	Instructions string `json:"instructions,omitempty"`
	// The resource name of the Knowledge Assistant. Format:
	// knowledge-assistants/{knowledge_assistant_id}
	Name string `json:"name,omitempty"`
	// State of the Knowledge Assistant. Not returned in List responses.
	State KnowledgeAssistantState `json:"state,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

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.

func (KnowledgeAssistant) MarshalJSON

func (s KnowledgeAssistant) MarshalJSON() ([]byte, error)

func (*KnowledgeAssistant) UnmarshalJSON

func (s *KnowledgeAssistant) UnmarshalJSON(b []byte) error

type KnowledgeAssistantState

type KnowledgeAssistantState string
const KnowledgeAssistantStateActive KnowledgeAssistantState = `ACTIVE`
const KnowledgeAssistantStateCreating KnowledgeAssistantState = `CREATING`
const KnowledgeAssistantStateFailed KnowledgeAssistantState = `FAILED`

func (*KnowledgeAssistantState) Set

Set raw string value and validate it against allowed values

func (*KnowledgeAssistantState) String

func (f *KnowledgeAssistantState) String() string

String representation for fmt.Print

func (*KnowledgeAssistantState) Type

func (f *KnowledgeAssistantState) Type() string

Type always returns KnowledgeAssistantState to satisfy [pflag.Value] interface

func (*KnowledgeAssistantState) Values

Values returns all possible values for KnowledgeAssistantState.

There is no guarantee on the order of the values in the slice.

type KnowledgeAssistantsAPI

type KnowledgeAssistantsAPI struct {
	// contains filtered or unexported fields
}

Manage Knowledge Assistants and related resources.

func NewKnowledgeAssistants

func NewKnowledgeAssistants(client *client.DatabricksClient) *KnowledgeAssistantsAPI

func (*KnowledgeAssistantsAPI) CreateKnowledgeAssistant

func (a *KnowledgeAssistantsAPI) CreateKnowledgeAssistant(ctx context.Context, request CreateKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

func (*KnowledgeAssistantsAPI) CreateKnowledgeSource

func (a *KnowledgeAssistantsAPI) CreateKnowledgeSource(ctx context.Context, request CreateKnowledgeSourceRequest) (*KnowledgeSource, error)

func (*KnowledgeAssistantsAPI) DeleteKnowledgeAssistant

func (a *KnowledgeAssistantsAPI) DeleteKnowledgeAssistant(ctx context.Context, request DeleteKnowledgeAssistantRequest) error

func (*KnowledgeAssistantsAPI) DeleteKnowledgeSource

func (a *KnowledgeAssistantsAPI) DeleteKnowledgeSource(ctx context.Context, request DeleteKnowledgeSourceRequest) error

func (*KnowledgeAssistantsAPI) GetKnowledgeAssistant

func (a *KnowledgeAssistantsAPI) GetKnowledgeAssistant(ctx context.Context, request GetKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

func (*KnowledgeAssistantsAPI) GetKnowledgeSource

func (a *KnowledgeAssistantsAPI) GetKnowledgeSource(ctx context.Context, request GetKnowledgeSourceRequest) (*KnowledgeSource, error)

func (*KnowledgeAssistantsAPI) ListKnowledgeAssistants

func (a *KnowledgeAssistantsAPI) ListKnowledgeAssistants(ctx context.Context, request ListKnowledgeAssistantsRequest) listing.Iterator[KnowledgeAssistant]

List Knowledge Assistants

func (*KnowledgeAssistantsAPI) ListKnowledgeAssistantsAll

func (a *KnowledgeAssistantsAPI) ListKnowledgeAssistantsAll(ctx context.Context, request ListKnowledgeAssistantsRequest) ([]KnowledgeAssistant, error)

List Knowledge Assistants

func (*KnowledgeAssistantsAPI) ListKnowledgeSources

func (a *KnowledgeAssistantsAPI) ListKnowledgeSources(ctx context.Context, request ListKnowledgeSourcesRequest) listing.Iterator[KnowledgeSource]

Lists Knowledge Sources under a Knowledge Assistant.

func (*KnowledgeAssistantsAPI) ListKnowledgeSourcesAll

func (a *KnowledgeAssistantsAPI) ListKnowledgeSourcesAll(ctx context.Context, request ListKnowledgeSourcesRequest) ([]KnowledgeSource, error)

Lists Knowledge Sources under a Knowledge Assistant.

func (*KnowledgeAssistantsAPI) SyncKnowledgeSources

func (a *KnowledgeAssistantsAPI) SyncKnowledgeSources(ctx context.Context, request SyncKnowledgeSourcesRequest) error

func (*KnowledgeAssistantsAPI) UpdateKnowledgeAssistant

func (a *KnowledgeAssistantsAPI) UpdateKnowledgeAssistant(ctx context.Context, request UpdateKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

func (*KnowledgeAssistantsAPI) UpdateKnowledgeSource

func (a *KnowledgeAssistantsAPI) UpdateKnowledgeSource(ctx context.Context, request UpdateKnowledgeSourceRequest) (*KnowledgeSource, error)

type KnowledgeAssistantsInterface

type KnowledgeAssistantsInterface interface {

	// Creates a Knowledge Assistant.
	CreateKnowledgeAssistant(ctx context.Context, request CreateKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

	// Creates a Knowledge Source under a Knowledge Assistant.
	CreateKnowledgeSource(ctx context.Context, request CreateKnowledgeSourceRequest) (*KnowledgeSource, error)

	// Deletes a Knowledge Assistant.
	DeleteKnowledgeAssistant(ctx context.Context, request DeleteKnowledgeAssistantRequest) error

	// Deletes a Knowledge Source.
	DeleteKnowledgeSource(ctx context.Context, request DeleteKnowledgeSourceRequest) error

	// Gets a Knowledge Assistant.
	GetKnowledgeAssistant(ctx context.Context, request GetKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

	// Gets a Knowledge Source.
	GetKnowledgeSource(ctx context.Context, request GetKnowledgeSourceRequest) (*KnowledgeSource, error)

	// List Knowledge Assistants
	//
	// This method is generated by Databricks SDK Code Generator.
	ListKnowledgeAssistants(ctx context.Context, request ListKnowledgeAssistantsRequest) listing.Iterator[KnowledgeAssistant]

	// List Knowledge Assistants
	//
	// This method is generated by Databricks SDK Code Generator.
	ListKnowledgeAssistantsAll(ctx context.Context, request ListKnowledgeAssistantsRequest) ([]KnowledgeAssistant, error)

	// Lists Knowledge Sources under a Knowledge Assistant.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListKnowledgeSources(ctx context.Context, request ListKnowledgeSourcesRequest) listing.Iterator[KnowledgeSource]

	// Lists Knowledge Sources under a Knowledge Assistant.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListKnowledgeSourcesAll(ctx context.Context, request ListKnowledgeSourcesRequest) ([]KnowledgeSource, error)

	// Sync all non-index Knowledge Sources for a Knowledge Assistant (index sources
	// do not require sync)
	SyncKnowledgeSources(ctx context.Context, request SyncKnowledgeSourcesRequest) error

	// Updates a Knowledge Assistant.
	UpdateKnowledgeAssistant(ctx context.Context, request UpdateKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

	// Updates a Knowledge Source.
	UpdateKnowledgeSource(ctx context.Context, request UpdateKnowledgeSourceRequest) (*KnowledgeSource, error)
}

type KnowledgeAssistantsService deprecated

type KnowledgeAssistantsService interface {

	// Creates a Knowledge Assistant.
	CreateKnowledgeAssistant(ctx context.Context, request CreateKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

	// Creates a Knowledge Source under a Knowledge Assistant.
	CreateKnowledgeSource(ctx context.Context, request CreateKnowledgeSourceRequest) (*KnowledgeSource, error)

	// Deletes a Knowledge Assistant.
	DeleteKnowledgeAssistant(ctx context.Context, request DeleteKnowledgeAssistantRequest) error

	// Deletes a Knowledge Source.
	DeleteKnowledgeSource(ctx context.Context, request DeleteKnowledgeSourceRequest) error

	// Gets a Knowledge Assistant.
	GetKnowledgeAssistant(ctx context.Context, request GetKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

	// Gets a Knowledge Source.
	GetKnowledgeSource(ctx context.Context, request GetKnowledgeSourceRequest) (*KnowledgeSource, error)

	// List Knowledge Assistants
	ListKnowledgeAssistants(ctx context.Context, request ListKnowledgeAssistantsRequest) (*ListKnowledgeAssistantsResponse, error)

	// Lists Knowledge Sources under a Knowledge Assistant.
	ListKnowledgeSources(ctx context.Context, request ListKnowledgeSourcesRequest) (*ListKnowledgeSourcesResponse, error)

	// Sync all non-index Knowledge Sources for a Knowledge Assistant (index
	// sources do not require sync)
	SyncKnowledgeSources(ctx context.Context, request SyncKnowledgeSourcesRequest) error

	// Updates a Knowledge Assistant.
	UpdateKnowledgeAssistant(ctx context.Context, request UpdateKnowledgeAssistantRequest) (*KnowledgeAssistant, error)

	// Updates a Knowledge Source.
	UpdateKnowledgeSource(ctx context.Context, request UpdateKnowledgeSourceRequest) (*KnowledgeSource, error)
}

Manage Knowledge Assistants and related resources.

Deprecated: Do not use this interface, it will be removed in a future version of the SDK.

type KnowledgeSource

type KnowledgeSource struct {
	// Timestamp when this knowledge source was created.
	CreateTime *time.Time `json:"create_time,omitempty"`
	// Description of the knowledge source. Required when creating a Knowledge
	// Source. When updating a Knowledge Source, optional unless included in
	// update_mask.
	Description string `json:"description"`
	// 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.
	DisplayName string `json:"display_name"`

	FileTable *FileTableSpec `json:"file_table,omitempty"`

	Files *FilesSpec `json:"files,omitempty"`

	Id string `json:"id,omitempty"`

	Index *IndexSpec `json:"index,omitempty"`
	// Timestamp representing the cutoff before which content in this knowledge
	// source is being ingested.
	KnowledgeCutoffTime *time.Time `json:"knowledge_cutoff_time,omitempty"`
	// Full resource name:
	// knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id}
	Name string `json:"name,omitempty"`
	// 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.
	SourceType string `json:"source_type"`

	State KnowledgeSourceState `json:"state,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

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.

func (KnowledgeSource) MarshalJSON

func (s KnowledgeSource) MarshalJSON() ([]byte, error)

func (*KnowledgeSource) UnmarshalJSON

func (s *KnowledgeSource) UnmarshalJSON(b []byte) error

type KnowledgeSourceState

type KnowledgeSourceState string
const KnowledgeSourceStateFailedUpdate KnowledgeSourceState = `FAILED_UPDATE`
const KnowledgeSourceStateUpdated KnowledgeSourceState = `UPDATED`
const KnowledgeSourceStateUpdating KnowledgeSourceState = `UPDATING`

func (*KnowledgeSourceState) Set

func (f *KnowledgeSourceState) Set(v string) error

Set raw string value and validate it against allowed values

func (*KnowledgeSourceState) String

func (f *KnowledgeSourceState) String() string

String representation for fmt.Print

func (*KnowledgeSourceState) Type

func (f *KnowledgeSourceState) Type() string

Type always returns KnowledgeSourceState to satisfy [pflag.Value] interface

func (*KnowledgeSourceState) Values

Values returns all possible values for KnowledgeSourceState.

There is no guarantee on the order of the values in the slice.

type ListKnowledgeAssistantsRequest

type ListKnowledgeAssistantsRequest struct {
	// The 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.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// A page token, received from a previous `ListKnowledgeAssistants` call.
	// Provide this to retrieve the subsequent page. If unspecified, the first
	// page will be returned.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListKnowledgeAssistantsRequest) MarshalJSON

func (s ListKnowledgeAssistantsRequest) MarshalJSON() ([]byte, error)

func (*ListKnowledgeAssistantsRequest) UnmarshalJSON

func (s *ListKnowledgeAssistantsRequest) UnmarshalJSON(b []byte) error

type ListKnowledgeAssistantsResponse

type ListKnowledgeAssistantsResponse struct {
	KnowledgeAssistants []KnowledgeAssistant `json:"knowledge_assistants,omitempty"`
	// A token that can be sent as `page_token` to retrieve the next page. If
	// this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

A list of Knowledge Assistants.

func (ListKnowledgeAssistantsResponse) MarshalJSON

func (s ListKnowledgeAssistantsResponse) MarshalJSON() ([]byte, error)

func (*ListKnowledgeAssistantsResponse) UnmarshalJSON

func (s *ListKnowledgeAssistantsResponse) UnmarshalJSON(b []byte) error

type ListKnowledgeSourcesRequest

type ListKnowledgeSourcesRequest struct {
	PageSize int `json:"-" url:"page_size,omitempty"`

	PageToken string `json:"-" url:"page_token,omitempty"`
	// Parent resource to list from. Format:
	// knowledge-assistants/{knowledge_assistant_id}
	Parent string `json:"-" url:"-"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListKnowledgeSourcesRequest) MarshalJSON

func (s ListKnowledgeSourcesRequest) MarshalJSON() ([]byte, error)

func (*ListKnowledgeSourcesRequest) UnmarshalJSON

func (s *ListKnowledgeSourcesRequest) UnmarshalJSON(b []byte) error

type ListKnowledgeSourcesResponse

type ListKnowledgeSourcesResponse struct {
	KnowledgeSources []KnowledgeSource `json:"knowledge_sources,omitempty"`

	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListKnowledgeSourcesResponse) MarshalJSON

func (s ListKnowledgeSourcesResponse) MarshalJSON() ([]byte, error)

func (*ListKnowledgeSourcesResponse) UnmarshalJSON

func (s *ListKnowledgeSourcesResponse) UnmarshalJSON(b []byte) error

type SyncKnowledgeSourcesRequest

type SyncKnowledgeSourcesRequest struct {
	// The resource name of the Knowledge Assistant. Format:
	// knowledge-assistants/{knowledge_assistant_id}
	Name string `json:"-" url:"-"`
}

type UpdateKnowledgeAssistantRequest

type UpdateKnowledgeAssistantRequest struct {
	// The Knowledge Assistant update payload. Only fields listed in update_mask
	// are updated. REQUIRED annotations on Knowledge Assistant fields describe
	// create-time requirements and do not mean all those fields are required
	// for update.
	KnowledgeAssistant KnowledgeAssistant `json:"knowledge_assistant"`
	// The resource name of the Knowledge Assistant. Format:
	// knowledge-assistants/{knowledge_assistant_id}
	Name string `json:"-" url:"-"`
	// Comma-delimited list of fields to update on the Knowledge Assistant.
	// Allowed values: `display_name`, `description`, `instructions`. Examples:
	// - `display_name` - `description,instructions`
	UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"`
}

type UpdateKnowledgeSourceRequest

type UpdateKnowledgeSourceRequest struct {
	// The Knowledge Source update payload. Only fields listed in update_mask
	// are updated. REQUIRED annotations on Knowledge Source fields describe
	// create-time requirements and do not mean all those fields are required
	// for update.
	KnowledgeSource KnowledgeSource `json:"knowledge_source"`
	// The resource name of the Knowledge Source to update. Format:
	// knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id}
	Name string `json:"-" url:"-"`
	// Comma-delimited list of fields to update on the Knowledge Source. Allowed
	// values: `display_name`, `description`. Examples: - `display_name` -
	// `display_name,description`
	UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL