store

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthSettings added in v0.5.0

type AuthSettings struct {
	BasicAuthUser string `json:"basicAuthUser"`
}

type GrafanaVectorAPISettings added in v0.5.0

type GrafanaVectorAPISettings struct {
	URL           string `json:"url"`
	AuthType      string `json:"authType"`
	BasicAuthUser string `json:"basicAuthUser"`
}

type ReadVectorStore

type ReadVectorStore interface {
	CollectionExists(ctx context.Context, collection string) (bool, error)
	Search(ctx context.Context, collection string, vector []float32, topK uint64, filter map[string]interface{}) ([]SearchResult, error)
	Health(ctx context.Context) error
}

func NewReadVectorStore

func NewReadVectorStore(s Settings, secrets map[string]string) (ReadVectorStore, context.CancelFunc, error)

type SearchResult

type SearchResult struct {
	Payload map[string]any `json:"payload"`
	Score   float64        `json:"score"`
}

type Settings

type Settings struct {
	Type VectorStoreType `json:"type"`

	GrafanaVectorAPI GrafanaVectorAPISettings `json:"grafanaVectorAPI"`

	Qdrant qdrantSettings `json:"qdrant"`
}

type VectorStore

type VectorStore interface {
	ReadVectorStore
	WriteVectorStore
}

func NewVectorStore

func NewVectorStore(s Settings) (VectorStore, error)

type VectorStoreAuthType added in v0.5.0

type VectorStoreAuthType string
const (
	VectorStoreAuthTypeBasicAuth VectorStoreAuthType = "basic-auth"
)

type VectorStoreType

type VectorStoreType string
const (
	VectorStoreTypeQdrant           VectorStoreType = "qdrant"
	VectorStoreTypeGrafanaVectorAPI VectorStoreType = "grafana/vectorapi"
)

type WriteVectorStore

type WriteVectorStore interface {
	Collections(ctx context.Context) ([]string, error)
	CreateCollection(ctx context.Context, collection string, size uint64) error
	PointExists(ctx context.Context, collection string, id uint64) (bool, error)
	UpsertColumnar(ctx context.Context, collection string, ids []uint64, embeddings [][]float32, payloadJSONs []string) error
}

Jump to

Keyboard shortcuts

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