index

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder added in v0.1.4

type Embedder interface {
	Embed(ctx context.Context, text string) ([]float32, error)
}

type Index

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

func New

func New(path string, embedder Embedder) (*Index, error)

func (*Index) Delete

func (i *Index) Delete(ctx context.Context, ids ...string) error

func (*Index) Index

func (i *Index) Index(ctx context.Context, documents ...index.Document) error

func (*Index) List

func (i *Index) List(ctx context.Context, options *index.ListOptions) (*index.Page[index.Document], error)

func (*Index) Query added in v0.1.4

func (i *Index) Query(ctx context.Context, query string, options *index.QueryOptions) ([]index.Result, error)

type RecordModel

type RecordModel struct {
	gorm.Model

	Text   string
	Vector datatypes.JSONSlice[float32]

	Metadata datatypes.JSONMap
}

Jump to

Keyboard shortcuts

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