vectorsearch

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

These APIs allow you to manage Vector Search Endpoints, Vector Search Indexes, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnInfo

type ColumnInfo struct {
	// Name of the column.
	Name string `json:"name,omitempty"`

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

func (ColumnInfo) MarshalJSON

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

func (*ColumnInfo) UnmarshalJSON

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

type CreateEndpoint

type CreateEndpoint struct {
	// Type of endpoint.
	EndpointType EndpointType `json:"endpoint_type"`
	// Name of endpoint
	Name string `json:"name"`
}

type CreateVectorIndexRequest

type CreateVectorIndexRequest struct {
	// Specification for Delta Sync Index. Required if `index_type` is
	// `DELTA_SYNC`.
	DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecRequest `json:"delta_sync_index_spec,omitempty"`
	// Specification for Direct Vector Access Index. Required if `index_type` is
	// `DIRECT_ACCESS`.
	DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"`
	// Name of the endpoint to be used for serving the index
	EndpointName string `json:"endpoint_name"`
	// There are 2 types of Vector Search indexes:
	//
	// - `DELTA_SYNC`: An index that automatically syncs with a source Delta
	// Table, automatically and incrementally updating the index as the
	// underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index
	// that supports direct read and write of vectors and metadata through our
	// REST and SDK APIs. With this model, the user manages index updates.
	IndexType VectorIndexType `json:"index_type"`
	// Name of the index
	Name string `json:"name"`
	// Primary key of the index
	PrimaryKey string `json:"primary_key"`
}

type CreateVectorIndexResponse

type CreateVectorIndexResponse struct {
	VectorIndex *VectorIndex `json:"vector_index,omitempty"`
}

type DeleteDataResult

type DeleteDataResult struct {
	// List of primary keys for rows that failed to process.
	FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"`
	// Count of successfully processed rows.
	SuccessRowCount int64 `json:"success_row_count,omitempty"`

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

Result of the upsert or delete operation.

func (DeleteDataResult) MarshalJSON

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

func (*DeleteDataResult) UnmarshalJSON

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

type DeleteDataStatus

type DeleteDataStatus string

Status of the delete operation.

const DeleteDataStatusFailure DeleteDataStatus = `FAILURE`
const DeleteDataStatusPartialSuccess DeleteDataStatus = `PARTIAL_SUCCESS`
const DeleteDataStatusSuccess DeleteDataStatus = `SUCCESS`

func (*DeleteDataStatus) Set

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

Set raw string value and validate it against allowed values

func (*DeleteDataStatus) String

func (f *DeleteDataStatus) String() string

String representation for fmt.Print

func (*DeleteDataStatus) Type

func (f *DeleteDataStatus) Type() string

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

type DeleteDataVectorIndexRequest

type DeleteDataVectorIndexRequest struct {
	// Name of the vector index where data is to be deleted. Must be a Direct
	// Vector Access Index.
	IndexName string `json:"-" url:"-"`
	// List of primary keys for the data to be deleted.
	PrimaryKeys []string `json:"primary_keys"`
}

Request payload for deleting data from a vector index.

type DeleteDataVectorIndexResponse

type DeleteDataVectorIndexResponse struct {
	// Result of the upsert or delete operation.
	Result *DeleteDataResult `json:"result,omitempty"`
	// Status of the delete operation.
	Status DeleteDataStatus `json:"status,omitempty"`
}

Response to a delete data vector index request.

type DeleteEndpointRequest

type DeleteEndpointRequest struct {
	// Name of the endpoint
	EndpointName string `json:"-" url:"-"`
}

Delete an endpoint

type DeleteEndpointResponse added in v0.34.0

type DeleteEndpointResponse struct {
}

type DeleteIndexRequest

type DeleteIndexRequest struct {
	// Name of the index
	IndexName string `json:"-" url:"-"`
}

Delete an index

type DeleteIndexResponse added in v0.34.0

type DeleteIndexResponse struct {
}

type DeltaSyncVectorIndexSpecRequest

type DeltaSyncVectorIndexSpecRequest struct {
	// The columns that contain the embedding source.
	EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"`
	// The columns that contain the embedding vectors. The format should be
	// array[double].
	EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"`
	// [Optional] Automatically sync the vector index contents and computed
	// embeddings to the specified Delta table. The only supported table name is
	// the index name with the suffix `_writeback_table`.
	EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"`
	// Pipeline execution mode.
	//
	// - `TRIGGERED`: If the pipeline uses the triggered execution mode, the
	// system stops processing after successfully refreshing the source table in
	// the pipeline once, ensuring the table is updated based on the data
	// available when the update started. - `CONTINUOUS`: If the pipeline uses
	// continuous execution, the pipeline processes new data as it arrives in
	// the source table to keep vector index fresh.
	PipelineType PipelineType `json:"pipeline_type,omitempty"`
	// The name of the source table.
	SourceTable string `json:"source_table,omitempty"`

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

func (DeltaSyncVectorIndexSpecRequest) MarshalJSON

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

func (*DeltaSyncVectorIndexSpecRequest) UnmarshalJSON

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

type DeltaSyncVectorIndexSpecResponse

type DeltaSyncVectorIndexSpecResponse struct {
	// The columns that contain the embedding source.
	EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"`
	// The columns that contain the embedding vectors.
	EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"`
	// [Optional] Name of the Delta table to sync the vector index contents and
	// computed embeddings to.
	EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"`
	// The ID of the pipeline that is used to sync the index.
	PipelineId string `json:"pipeline_id,omitempty"`
	// Pipeline execution mode.
	//
	// - `TRIGGERED`: If the pipeline uses the triggered execution mode, the
	// system stops processing after successfully refreshing the source table in
	// the pipeline once, ensuring the table is updated based on the data
	// available when the update started. - `CONTINUOUS`: If the pipeline uses
	// continuous execution, the pipeline processes new data as it arrives in
	// the source table to keep vector index fresh.
	PipelineType PipelineType `json:"pipeline_type,omitempty"`
	// The name of the source table.
	SourceTable string `json:"source_table,omitempty"`

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

func (DeltaSyncVectorIndexSpecResponse) MarshalJSON

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

func (*DeltaSyncVectorIndexSpecResponse) UnmarshalJSON

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

type DirectAccessVectorIndexSpec

type DirectAccessVectorIndexSpec struct {
	// Contains the optional model endpoint to use during query time.
	EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"`

	EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"`
	// The schema of the index in JSON format.
	//
	// Supported types are `integer`, `long`, `float`, `double`, `boolean`,
	// `string`, `date`, `timestamp`.
	//
	// Supported types for vector column: `array<float>`, `array<double>`,`.
	SchemaJson string `json:"schema_json,omitempty"`

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

func (DirectAccessVectorIndexSpec) MarshalJSON

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

func (*DirectAccessVectorIndexSpec) UnmarshalJSON

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

type EmbeddingSourceColumn

type EmbeddingSourceColumn struct {
	// Name of the embedding model endpoint
	EmbeddingModelEndpointName string `json:"embedding_model_endpoint_name,omitempty"`
	// Name of the column
	Name string `json:"name,omitempty"`

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

func (EmbeddingSourceColumn) MarshalJSON

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

func (*EmbeddingSourceColumn) UnmarshalJSON

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

type EmbeddingVectorColumn

type EmbeddingVectorColumn struct {
	// Dimension of the embedding vector
	EmbeddingDimension int `json:"embedding_dimension,omitempty"`
	// Name of the column
	Name string `json:"name,omitempty"`

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

func (EmbeddingVectorColumn) MarshalJSON

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

func (*EmbeddingVectorColumn) UnmarshalJSON

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

type EndpointInfo

type EndpointInfo struct {
	// Timestamp of endpoint creation
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// Creator of the endpoint
	Creator string `json:"creator,omitempty"`
	// Current status of the endpoint
	EndpointStatus *EndpointStatus `json:"endpoint_status,omitempty"`
	// Type of endpoint.
	EndpointType EndpointType `json:"endpoint_type,omitempty"`
	// Unique identifier of the endpoint
	Id string `json:"id,omitempty"`
	// Timestamp of last update to the endpoint
	LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
	// User who last updated the endpoint
	LastUpdatedUser string `json:"last_updated_user,omitempty"`
	// Name of endpoint
	Name string `json:"name,omitempty"`
	// Number of indexes on the endpoint
	NumIndexes int `json:"num_indexes,omitempty"`

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

func (EndpointInfo) MarshalJSON

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

func (*EndpointInfo) UnmarshalJSON

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

type EndpointStatus

type EndpointStatus struct {
	// Additional status message
	Message string `json:"message,omitempty"`
	// Current state of the endpoint
	State EndpointStatusState `json:"state,omitempty"`

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

Status information of an endpoint

func (EndpointStatus) MarshalJSON

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

func (*EndpointStatus) UnmarshalJSON

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

type EndpointStatusState

type EndpointStatusState string

Current state of the endpoint

const EndpointStatusStateOffline EndpointStatusState = `OFFLINE`
const EndpointStatusStateOnline EndpointStatusState = `ONLINE`
const EndpointStatusStateProvisioning EndpointStatusState = `PROVISIONING`

func (*EndpointStatusState) Set

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

Set raw string value and validate it against allowed values

func (*EndpointStatusState) String

func (f *EndpointStatusState) String() string

String representation for fmt.Print

func (*EndpointStatusState) Type

func (f *EndpointStatusState) Type() string

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

type EndpointType

type EndpointType string

Type of endpoint.

const EndpointTypeStandard EndpointType = `STANDARD`

func (*EndpointType) Set

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

Set raw string value and validate it against allowed values

func (*EndpointType) String

func (f *EndpointType) String() string

String representation for fmt.Print

func (*EndpointType) Type

func (f *EndpointType) Type() string

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

type GetEndpointRequest

type GetEndpointRequest struct {
	// Name of the endpoint
	EndpointName string `json:"-" url:"-"`
}

Get an endpoint

type GetIndexRequest

type GetIndexRequest struct {
	// Name of the index
	IndexName string `json:"-" url:"-"`
}

Get an index

type ListEndpointResponse

type ListEndpointResponse struct {
	// An array of Endpoint objects
	Endpoints []EndpointInfo `json:"endpoints,omitempty"`
	// A token that can be used to get the next page of results. If not present,
	// there are no more results to show.
	NextPageToken string `json:"next_page_token,omitempty"`

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

func (ListEndpointResponse) MarshalJSON

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

func (*ListEndpointResponse) UnmarshalJSON

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

type ListEndpointsRequest

type ListEndpointsRequest struct {
	// Token for pagination
	PageToken string `json:"-" url:"page_token,omitempty"`

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

List all endpoints

func (ListEndpointsRequest) MarshalJSON

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

func (*ListEndpointsRequest) UnmarshalJSON

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

type ListIndexesRequest

type ListIndexesRequest struct {
	// Name of the endpoint
	EndpointName string `json:"-" url:"endpoint_name"`
	// Token for pagination
	PageToken string `json:"-" url:"page_token,omitempty"`

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

List indexes

func (ListIndexesRequest) MarshalJSON

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

func (*ListIndexesRequest) UnmarshalJSON

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

type ListValue added in v0.41.0

type ListValue struct {
	Values []Value `json:"values,omitempty"`
}

type ListVectorIndexesResponse

type ListVectorIndexesResponse struct {
	// A token that can be used to get the next page of results. If not present,
	// there are no more results to show.
	NextPageToken string `json:"next_page_token,omitempty"`

	VectorIndexes []MiniVectorIndex `json:"vector_indexes,omitempty"`

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

func (ListVectorIndexesResponse) MarshalJSON

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

func (*ListVectorIndexesResponse) UnmarshalJSON

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

type MapStringValueEntry added in v0.41.0

type MapStringValueEntry struct {
	// Column name.
	Key string `json:"key,omitempty"`
	// Column value, nullable.
	Value *Value `json:"value,omitempty"`

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

Key-value pair.

func (MapStringValueEntry) MarshalJSON added in v0.41.0

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

func (*MapStringValueEntry) UnmarshalJSON added in v0.41.0

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

type MiniVectorIndex

type MiniVectorIndex struct {
	// The user who created the index.
	Creator string `json:"creator,omitempty"`
	// Name of the endpoint associated with the index
	EndpointName string `json:"endpoint_name,omitempty"`
	// There are 2 types of Vector Search indexes:
	//
	// - `DELTA_SYNC`: An index that automatically syncs with a source Delta
	// Table, automatically and incrementally updating the index as the
	// underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index
	// that supports direct read and write of vectors and metadata through our
	// REST and SDK APIs. With this model, the user manages index updates.
	IndexType VectorIndexType `json:"index_type,omitempty"`
	// Name of the index
	Name string `json:"name,omitempty"`
	// Primary key of the index
	PrimaryKey string `json:"primary_key,omitempty"`

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

func (MiniVectorIndex) MarshalJSON

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

func (*MiniVectorIndex) UnmarshalJSON

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

type PipelineType

type PipelineType string

Pipeline execution mode.

- `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing after successfully refreshing the source table in the pipeline once, ensuring the table is updated based on the data available when the update started. - `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it arrives in the source table to keep vector index fresh.

const PipelineTypeContinuous PipelineType = `CONTINUOUS`

If the pipeline uses continuous execution, the pipeline processes new data as it arrives in the source table to keep vector index fresh.

const PipelineTypeTriggered PipelineType = `TRIGGERED`

If the pipeline uses the triggered execution mode, the system stops processing after successfully refreshing the source table in the pipeline once, ensuring the table is updated based on the data available when the update started.

func (*PipelineType) Set

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

Set raw string value and validate it against allowed values

func (*PipelineType) String

func (f *PipelineType) String() string

String representation for fmt.Print

func (*PipelineType) Type

func (f *PipelineType) Type() string

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

type QueryVectorIndexRequest

type QueryVectorIndexRequest struct {
	// List of column names to include in the response.
	Columns []string `json:"columns"`
	// JSON string representing query filters.
	//
	// Example filters: - `{"id <": 5}`: Filter for id less than 5. - `{"id >":
	// 5}`: Filter for id greater than 5. - `{"id <=": 5}`: Filter for id less
	// than equal to 5. - `{"id >=": 5}`: Filter for id greater than equal to 5.
	// - `{"id": 5}`: Filter for id equal to 5.
	FiltersJson string `json:"filters_json,omitempty"`
	// Name of the vector index to query.
	IndexName string `json:"-" url:"-"`
	// Number of results to return. Defaults to 10.
	NumResults int `json:"num_results,omitempty"`
	// Query text. Required for Delta Sync Index using model endpoint.
	QueryText string `json:"query_text,omitempty"`
	// Query vector. Required for Direct Vector Access Index and Delta Sync
	// Index using self-managed vectors.
	QueryVector []float64 `json:"query_vector,omitempty"`
	// Threshold for the approximate nearest neighbor search. Defaults to 0.0.
	ScoreThreshold float64 `json:"score_threshold,omitempty"`

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

func (QueryVectorIndexRequest) MarshalJSON

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

func (*QueryVectorIndexRequest) UnmarshalJSON

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

type QueryVectorIndexResponse

type QueryVectorIndexResponse struct {
	// Metadata about the result set.
	Manifest *ResultManifest `json:"manifest,omitempty"`
	// Data returned in the query result.
	Result *ResultData `json:"result,omitempty"`
}

type ResultData

type ResultData struct {
	// Data rows returned in the query.
	DataArray [][]string `json:"data_array,omitempty"`
	// Number of rows in the result set.
	RowCount int `json:"row_count,omitempty"`

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

Data returned in the query result.

func (ResultData) MarshalJSON

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

func (*ResultData) UnmarshalJSON

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

type ResultManifest

type ResultManifest struct {
	// Number of columns in the result set.
	ColumnCount int `json:"column_count,omitempty"`
	// Information about each column in the result set.
	Columns []ColumnInfo `json:"columns,omitempty"`

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

Metadata about the result set.

func (ResultManifest) MarshalJSON

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

func (*ResultManifest) UnmarshalJSON

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

type ScanVectorIndexRequest added in v0.41.0

type ScanVectorIndexRequest struct {
	// Name of the vector index to scan.
	IndexName string `json:"-" url:"-"`
	// Primary key of the last entry returned in the previous scan.
	LastPrimaryKey string `json:"last_primary_key,omitempty"`
	// Number of results to return. Defaults to 10.
	NumResults int `json:"num_results,omitempty"`

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

Request payload for scanning data from a vector index.

func (ScanVectorIndexRequest) MarshalJSON added in v0.41.0

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

func (*ScanVectorIndexRequest) UnmarshalJSON added in v0.41.0

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

type ScanVectorIndexResponse added in v0.41.0

type ScanVectorIndexResponse struct {
	// List of data entries
	Data []Struct `json:"data,omitempty"`
	// Primary key of the last entry.
	LastPrimaryKey string `json:"last_primary_key,omitempty"`

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

Response to a scan vector index request.

func (ScanVectorIndexResponse) MarshalJSON added in v0.41.0

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

func (*ScanVectorIndexResponse) UnmarshalJSON added in v0.41.0

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

type Struct added in v0.41.0

type Struct struct {
	// Data entry, corresponding to a row in a vector index.
	Fields []MapStringValueEntry `json:"fields,omitempty"`
}

type SyncIndexRequest

type SyncIndexRequest struct {
	// Name of the vector index to synchronize. Must be a Delta Sync Index.
	IndexName string `json:"-" url:"-"`
}

Synchronize an index

type SyncIndexResponse added in v0.34.0

type SyncIndexResponse struct {
}

type UpsertDataResult

type UpsertDataResult struct {
	// List of primary keys for rows that failed to process.
	FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"`
	// Count of successfully processed rows.
	SuccessRowCount int64 `json:"success_row_count,omitempty"`

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

Result of the upsert or delete operation.

func (UpsertDataResult) MarshalJSON

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

func (*UpsertDataResult) UnmarshalJSON

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

type UpsertDataStatus

type UpsertDataStatus string

Status of the upsert operation.

const UpsertDataStatusFailure UpsertDataStatus = `FAILURE`
const UpsertDataStatusPartialSuccess UpsertDataStatus = `PARTIAL_SUCCESS`
const UpsertDataStatusSuccess UpsertDataStatus = `SUCCESS`

func (*UpsertDataStatus) Set

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

Set raw string value and validate it against allowed values

func (*UpsertDataStatus) String

func (f *UpsertDataStatus) String() string

String representation for fmt.Print

func (*UpsertDataStatus) Type

func (f *UpsertDataStatus) Type() string

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

type UpsertDataVectorIndexRequest

type UpsertDataVectorIndexRequest struct {
	// Name of the vector index where data is to be upserted. Must be a Direct
	// Vector Access Index.
	IndexName string `json:"-" url:"-"`
	// JSON string representing the data to be upserted.
	InputsJson string `json:"inputs_json"`
}

Request payload for upserting data into a vector index.

type UpsertDataVectorIndexResponse

type UpsertDataVectorIndexResponse struct {
	// Result of the upsert or delete operation.
	Result *UpsertDataResult `json:"result,omitempty"`
	// Status of the upsert operation.
	Status UpsertDataStatus `json:"status,omitempty"`
}

Response to an upsert data vector index request.

type Value added in v0.41.0

type Value struct {
	BoolValue bool `json:"bool_value,omitempty"`

	ListValue *ListValue `json:"list_value,omitempty"`

	NullValue string `json:"null_value,omitempty"`

	NumberValue float64 `json:"number_value,omitempty"`

	StringValue string `json:"string_value,omitempty"`

	StructValue *Struct `json:"struct_value,omitempty"`

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

func (Value) MarshalJSON added in v0.41.0

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

func (*Value) UnmarshalJSON added in v0.41.0

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

type VectorIndex

type VectorIndex struct {
	// The user who created the index.
	Creator string `json:"creator,omitempty"`

	DeltaSyncIndexSpec *DeltaSyncVectorIndexSpecResponse `json:"delta_sync_index_spec,omitempty"`

	DirectAccessIndexSpec *DirectAccessVectorIndexSpec `json:"direct_access_index_spec,omitempty"`
	// Name of the endpoint associated with the index
	EndpointName string `json:"endpoint_name,omitempty"`
	// There are 2 types of Vector Search indexes:
	//
	// - `DELTA_SYNC`: An index that automatically syncs with a source Delta
	// Table, automatically and incrementally updating the index as the
	// underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index
	// that supports direct read and write of vectors and metadata through our
	// REST and SDK APIs. With this model, the user manages index updates.
	IndexType VectorIndexType `json:"index_type,omitempty"`
	// Name of the index
	Name string `json:"name,omitempty"`
	// Primary key of the index
	PrimaryKey string `json:"primary_key,omitempty"`

	Status *VectorIndexStatus `json:"status,omitempty"`

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

func (VectorIndex) MarshalJSON

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

func (*VectorIndex) UnmarshalJSON

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

type VectorIndexStatus

type VectorIndexStatus struct {
	// Index API Url to be used to perform operations on the index
	IndexUrl string `json:"index_url,omitempty"`
	// Number of rows indexed
	IndexedRowCount int64 `json:"indexed_row_count,omitempty"`
	// Message associated with the index status
	Message string `json:"message,omitempty"`
	// Whether the index is ready for search
	Ready bool `json:"ready,omitempty"`

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

func (VectorIndexStatus) MarshalJSON

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

func (*VectorIndexStatus) UnmarshalJSON

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

type VectorIndexType

type VectorIndexType string

There are 2 types of Vector Search indexes:

- `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates.

const VectorIndexTypeDeltaSync VectorIndexType = `DELTA_SYNC`

An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes.

const VectorIndexTypeDirectAccess VectorIndexType = `DIRECT_ACCESS`

An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates.

func (*VectorIndexType) Set

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

Set raw string value and validate it against allowed values

func (*VectorIndexType) String

func (f *VectorIndexType) String() string

String representation for fmt.Print

func (*VectorIndexType) Type

func (f *VectorIndexType) Type() string

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

type VectorSearchEndpointsAPI

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

**Endpoint**: Represents the compute resources to host vector search indexes.

func NewVectorSearchEndpoints

func NewVectorSearchEndpoints(client *client.DatabricksClient) *VectorSearchEndpointsAPI

func (*VectorSearchEndpointsAPI) CreateEndpoint

Create an endpoint.

Create a new endpoint.

func (*VectorSearchEndpointsAPI) CreateEndpointAndWait deprecated

func (a *VectorSearchEndpointsAPI) CreateEndpointAndWait(ctx context.Context, createEndpoint CreateEndpoint, options ...retries.Option[EndpointInfo]) (*EndpointInfo, error)

Calls VectorSearchEndpointsAPI.CreateEndpoint and waits to reach ONLINE state

You can override the default timeout of 20 minutes by calling adding retries.Timeout[EndpointInfo](60*time.Minute) functional option.

Deprecated: use VectorSearchEndpointsAPI.CreateEndpoint.Get() or VectorSearchEndpointsAPI.WaitGetEndpointVectorSearchEndpointOnline

func (*VectorSearchEndpointsAPI) DeleteEndpoint

func (a *VectorSearchEndpointsAPI) DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error

Delete an endpoint.

func (*VectorSearchEndpointsAPI) DeleteEndpointByEndpointName

func (a *VectorSearchEndpointsAPI) DeleteEndpointByEndpointName(ctx context.Context, endpointName string) error

Delete an endpoint.

func (*VectorSearchEndpointsAPI) GetEndpoint

Get an endpoint.

func (*VectorSearchEndpointsAPI) GetEndpointByEndpointName

func (a *VectorSearchEndpointsAPI) GetEndpointByEndpointName(ctx context.Context, endpointName string) (*EndpointInfo, error)

Get an endpoint.

func (*VectorSearchEndpointsAPI) Impl

Impl returns low-level VectorSearchEndpoints API implementation Deprecated: use MockVectorSearchEndpointsInterface instead.

func (*VectorSearchEndpointsAPI) ListEndpoints

List all endpoints.

This method is generated by Databricks SDK Code Generator.

func (*VectorSearchEndpointsAPI) ListEndpointsAll

func (a *VectorSearchEndpointsAPI) ListEndpointsAll(ctx context.Context, request ListEndpointsRequest) ([]EndpointInfo, error)

List all endpoints.

This method is generated by Databricks SDK Code Generator.

func (*VectorSearchEndpointsAPI) WaitGetEndpointVectorSearchEndpointOnline

func (a *VectorSearchEndpointsAPI) WaitGetEndpointVectorSearchEndpointOnline(ctx context.Context, endpointName string,
	timeout time.Duration, callback func(*EndpointInfo)) (*EndpointInfo, error)

WaitGetEndpointVectorSearchEndpointOnline repeatedly calls VectorSearchEndpointsAPI.GetEndpoint and waits to reach ONLINE state

func (*VectorSearchEndpointsAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockVectorSearchEndpointsInterface instead.

type VectorSearchEndpointsInterface

type VectorSearchEndpointsInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockVectorSearchEndpointsInterface instead.
	WithImpl(impl VectorSearchEndpointsService) VectorSearchEndpointsInterface

	// Impl returns low-level VectorSearchEndpoints API implementation
	// Deprecated: use MockVectorSearchEndpointsInterface instead.
	Impl() VectorSearchEndpointsService

	// WaitGetEndpointVectorSearchEndpointOnline repeatedly calls [VectorSearchEndpointsAPI.GetEndpoint] and waits to reach ONLINE state
	WaitGetEndpointVectorSearchEndpointOnline(ctx context.Context, endpointName string,
		timeout time.Duration, callback func(*EndpointInfo)) (*EndpointInfo, error)

	// Create an endpoint.
	//
	// Create a new endpoint.
	CreateEndpoint(ctx context.Context, createEndpoint CreateEndpoint) (*WaitGetEndpointVectorSearchEndpointOnline[EndpointInfo], error)

	// Calls [VectorSearchEndpointsAPIInterface.CreateEndpoint] and waits to reach ONLINE state
	//
	// You can override the default timeout of 20 minutes by calling adding
	// retries.Timeout[EndpointInfo](60*time.Minute) functional option.
	//
	// Deprecated: use [VectorSearchEndpointsAPIInterface.CreateEndpoint].Get() or [VectorSearchEndpointsAPIInterface.WaitGetEndpointVectorSearchEndpointOnline]
	CreateEndpointAndWait(ctx context.Context, createEndpoint CreateEndpoint, options ...retries.Option[EndpointInfo]) (*EndpointInfo, error)

	// Delete an endpoint.
	DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error

	// Delete an endpoint.
	DeleteEndpointByEndpointName(ctx context.Context, endpointName string) error

	// Get an endpoint.
	GetEndpoint(ctx context.Context, request GetEndpointRequest) (*EndpointInfo, error)

	// Get an endpoint.
	GetEndpointByEndpointName(ctx context.Context, endpointName string) (*EndpointInfo, error)

	// List all endpoints.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListEndpoints(ctx context.Context, request ListEndpointsRequest) listing.Iterator[EndpointInfo]

	// List all endpoints.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListEndpointsAll(ctx context.Context, request ListEndpointsRequest) ([]EndpointInfo, error)
}

type VectorSearchEndpointsService

type VectorSearchEndpointsService interface {

	// Create an endpoint.
	//
	// Create a new endpoint.
	CreateEndpoint(ctx context.Context, request CreateEndpoint) (*EndpointInfo, error)

	// Delete an endpoint.
	DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error

	// Get an endpoint.
	GetEndpoint(ctx context.Context, request GetEndpointRequest) (*EndpointInfo, error)

	// List all endpoints.
	//
	// Use ListEndpointsAll() to get all EndpointInfo instances, which will iterate over every result page.
	ListEndpoints(ctx context.Context, request ListEndpointsRequest) (*ListEndpointResponse, error)
}

**Endpoint**: Represents the compute resources to host vector search indexes.

type VectorSearchIndexesAPI

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

**Index**: An efficient representation of your embedding vectors that supports real-time and efficient approximate nearest neighbor (ANN) search queries.

There are 2 types of Vector Search indexes: * **Delta Sync Index**: An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes. * **Direct Vector Access Index**: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates.

func NewVectorSearchIndexes

func NewVectorSearchIndexes(client *client.DatabricksClient) *VectorSearchIndexesAPI

func (*VectorSearchIndexesAPI) CreateIndex

Create an index.

Create a new index.

func (*VectorSearchIndexesAPI) DeleteDataVectorIndex

Delete data from index.

Handles the deletion of data from a specified vector index.

func (*VectorSearchIndexesAPI) DeleteIndex

func (a *VectorSearchIndexesAPI) DeleteIndex(ctx context.Context, request DeleteIndexRequest) error

Delete an index.

Delete an index.

func (*VectorSearchIndexesAPI) DeleteIndexByIndexName

func (a *VectorSearchIndexesAPI) DeleteIndexByIndexName(ctx context.Context, indexName string) error

Delete an index.

Delete an index.

func (*VectorSearchIndexesAPI) GetIndex

Get an index.

Get an index.

func (*VectorSearchIndexesAPI) GetIndexByIndexName

func (a *VectorSearchIndexesAPI) GetIndexByIndexName(ctx context.Context, indexName string) (*VectorIndex, error)

Get an index.

Get an index.

func (*VectorSearchIndexesAPI) Impl

Impl returns low-level VectorSearchIndexes API implementation Deprecated: use MockVectorSearchIndexesInterface instead.

func (*VectorSearchIndexesAPI) ListIndexes

List indexes.

List all indexes in the given endpoint.

This method is generated by Databricks SDK Code Generator.

func (*VectorSearchIndexesAPI) ListIndexesAll

func (a *VectorSearchIndexesAPI) ListIndexesAll(ctx context.Context, request ListIndexesRequest) ([]MiniVectorIndex, error)

List indexes.

List all indexes in the given endpoint.

This method is generated by Databricks SDK Code Generator.

func (*VectorSearchIndexesAPI) QueryIndex

Query an index.

Query the specified vector index.

func (*VectorSearchIndexesAPI) ScanIndex added in v0.41.0

Scan an index.

Scan the specified vector index and return the first `num_results` entries after the exclusive `primary_key`.

func (*VectorSearchIndexesAPI) SyncIndex

func (a *VectorSearchIndexesAPI) SyncIndex(ctx context.Context, request SyncIndexRequest) error

Synchronize an index.

Triggers a synchronization process for a specified vector index.

func (*VectorSearchIndexesAPI) UpsertDataVectorIndex

Upsert data into an index.

Handles the upserting of data into a specified vector index.

func (*VectorSearchIndexesAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockVectorSearchIndexesInterface instead.

type VectorSearchIndexesInterface

type VectorSearchIndexesInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockVectorSearchIndexesInterface instead.
	WithImpl(impl VectorSearchIndexesService) VectorSearchIndexesInterface

	// Impl returns low-level VectorSearchIndexes API implementation
	// Deprecated: use MockVectorSearchIndexesInterface instead.
	Impl() VectorSearchIndexesService

	// Create an index.
	//
	// Create a new index.
	CreateIndex(ctx context.Context, request CreateVectorIndexRequest) (*CreateVectorIndexResponse, error)

	// Delete data from index.
	//
	// Handles the deletion of data from a specified vector index.
	DeleteDataVectorIndex(ctx context.Context, request DeleteDataVectorIndexRequest) (*DeleteDataVectorIndexResponse, error)

	// Delete an index.
	//
	// Delete an index.
	DeleteIndex(ctx context.Context, request DeleteIndexRequest) error

	// Delete an index.
	//
	// Delete an index.
	DeleteIndexByIndexName(ctx context.Context, indexName string) error

	// Get an index.
	//
	// Get an index.
	GetIndex(ctx context.Context, request GetIndexRequest) (*VectorIndex, error)

	// Get an index.
	//
	// Get an index.
	GetIndexByIndexName(ctx context.Context, indexName string) (*VectorIndex, error)

	// List indexes.
	//
	// List all indexes in the given endpoint.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListIndexes(ctx context.Context, request ListIndexesRequest) listing.Iterator[MiniVectorIndex]

	// List indexes.
	//
	// List all indexes in the given endpoint.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListIndexesAll(ctx context.Context, request ListIndexesRequest) ([]MiniVectorIndex, error)

	// Query an index.
	//
	// Query the specified vector index.
	QueryIndex(ctx context.Context, request QueryVectorIndexRequest) (*QueryVectorIndexResponse, error)

	// Scan an index.
	//
	// Scan the specified vector index and return the first `num_results` entries
	// after the exclusive `primary_key`.
	ScanIndex(ctx context.Context, request ScanVectorIndexRequest) (*ScanVectorIndexResponse, error)

	// Synchronize an index.
	//
	// Triggers a synchronization process for a specified vector index.
	SyncIndex(ctx context.Context, request SyncIndexRequest) error

	// Upsert data into an index.
	//
	// Handles the upserting of data into a specified vector index.
	UpsertDataVectorIndex(ctx context.Context, request UpsertDataVectorIndexRequest) (*UpsertDataVectorIndexResponse, error)
}

type VectorSearchIndexesService

type VectorSearchIndexesService interface {

	// Create an index.
	//
	// Create a new index.
	CreateIndex(ctx context.Context, request CreateVectorIndexRequest) (*CreateVectorIndexResponse, error)

	// Delete data from index.
	//
	// Handles the deletion of data from a specified vector index.
	DeleteDataVectorIndex(ctx context.Context, request DeleteDataVectorIndexRequest) (*DeleteDataVectorIndexResponse, error)

	// Delete an index.
	//
	// Delete an index.
	DeleteIndex(ctx context.Context, request DeleteIndexRequest) error

	// Get an index.
	//
	// Get an index.
	GetIndex(ctx context.Context, request GetIndexRequest) (*VectorIndex, error)

	// List indexes.
	//
	// List all indexes in the given endpoint.
	//
	// Use ListIndexesAll() to get all MiniVectorIndex instances, which will iterate over every result page.
	ListIndexes(ctx context.Context, request ListIndexesRequest) (*ListVectorIndexesResponse, error)

	// Query an index.
	//
	// Query the specified vector index.
	QueryIndex(ctx context.Context, request QueryVectorIndexRequest) (*QueryVectorIndexResponse, error)

	// Scan an index.
	//
	// Scan the specified vector index and return the first `num_results`
	// entries after the exclusive `primary_key`.
	ScanIndex(ctx context.Context, request ScanVectorIndexRequest) (*ScanVectorIndexResponse, error)

	// Synchronize an index.
	//
	// Triggers a synchronization process for a specified vector index.
	SyncIndex(ctx context.Context, request SyncIndexRequest) error

	// Upsert data into an index.
	//
	// Handles the upserting of data into a specified vector index.
	UpsertDataVectorIndex(ctx context.Context, request UpsertDataVectorIndexRequest) (*UpsertDataVectorIndexResponse, error)
}

**Index**: An efficient representation of your embedding vectors that supports real-time and efficient approximate nearest neighbor (ANN) search queries.

There are 2 types of Vector Search indexes: * **Delta Sync Index**: An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes. * **Direct Vector Access Index**: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates.

type WaitGetEndpointVectorSearchEndpointOnline

type WaitGetEndpointVectorSearchEndpointOnline[R any] struct {
	Response     *R
	EndpointName string `json:"endpoint_name"`
	Poll         func(time.Duration, func(*EndpointInfo)) (*EndpointInfo, error)
	// contains filtered or unexported fields
}

WaitGetEndpointVectorSearchEndpointOnline is a wrapper that calls VectorSearchEndpointsAPI.WaitGetEndpointVectorSearchEndpointOnline and waits to reach ONLINE state.

func (*WaitGetEndpointVectorSearchEndpointOnline[R]) Get

Get the EndpointInfo with the default timeout of 20 minutes.

func (*WaitGetEndpointVectorSearchEndpointOnline[R]) GetWithTimeout

func (w *WaitGetEndpointVectorSearchEndpointOnline[R]) GetWithTimeout(timeout time.Duration) (*EndpointInfo, error)

Get the EndpointInfo with custom timeout.

func (*WaitGetEndpointVectorSearchEndpointOnline[R]) OnProgress

OnProgress invokes a callback every time it polls for the status update.

Jump to

Keyboard shortcuts

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