vectors

package
v0.0.0-...-71c47e0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupLocalInstance

func SetupLocalInstance(ctx context.Context, contextLocation string) (string, testcontainers.Container, func(), error)

Types

type Args

type Args struct {
	Timeout time.Duration
	SearchArgs
}

type SearchArgs

type SearchArgs struct {
	Radius  float32
	Epsilon float32
}

type Store

type Store interface {
	Insert(ctx context.Context, vector Vector) error
	Upsert(ctx context.Context, vector Vector) error
	BatchInsert(ctx context.Context, vectors []Vector) error
	Get(ctx context.Context, id string) (*Vector, error)
	Search(ctx context.Context, query []float32, k int, minK int, args *SearchArgs) ([]VectorSearchResult, error)
	Delete(ctx context.Context, id string) error
}

func New

func New(ctx context.Context, addr string, argsDefault Args) (Store, func() error, error)

type Vector

type Vector struct {
	ID   string
	Data []float32
}

type VectorSearchResult

type VectorSearchResult struct {
	ID       string
	Distance float32
}

Jump to

Keyboard shortcuts

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