chromem

package
v0.4.10-gateway.4 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const VsChromemEmbeddingParallelThread = "VS_CHROMEM_EMBEDDING_PARALLEL_THREAD"

VsChromemEmbeddingParallelThread can be set as an environment variable to control the number of parallel API calls to create embedding for documents. Default is 100

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func New

func New(db *chromem.DB, embeddingFunc chromem.EmbeddingFunc) *Store

New creates a new Chromem vector store.

func (*Store) AddDocuments

func (s *Store) AddDocuments(ctx context.Context, docs []vs.Document, collection string) ([]string, error)

func (*Store) CreateCollection

func (s *Store) CreateCollection(_ context.Context, name string) error

func (*Store) ExportCollectionsToFile added in v0.1.7

func (s *Store) ExportCollectionsToFile(ctx context.Context, path string, collections ...string) error

func (*Store) ImportCollectionsFromFile added in v0.1.7

func (s *Store) ImportCollectionsFromFile(ctx context.Context, path string, collections ...string) error

func (*Store) RemoveCollection

func (s *Store) RemoveCollection(_ context.Context, collection string) error

func (*Store) RemoveDocument

func (s *Store) RemoveDocument(ctx context.Context, documentID string, collection string, where map[string]string, whereDocument []chromem.WhereDocument) error

func (*Store) SimilaritySearch

func (s *Store) SimilaritySearch(ctx context.Context, query string, numDocuments int, collection string, where map[string]string, whereDocument []chromem.WhereDocument) ([]vs.Document, error)

Jump to

Keyboard shortcuts

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