chromemgo

package
v0.3.71 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountDocuments

func CountDocuments(docs ...interface{}) (response int)

func MapDocuments

func MapDocuments(callback func(index int, document *chromem.Document) (*chromem.Document, error), docs ...interface{}) (response []chromem.Document, err error)

func ParseDocument

func ParseDocument(doc interface{}) (response *chromem.Document, err error)

func ValidateDocument

func ValidateDocument(doc *chromem.Document) (err error)

Types

type ChromemDB

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

func NewChromemDB

func NewChromemDB(args ...interface{}) (instance *ChromemDB, err error)

func (*ChromemDB) AddToCollection

func (instance *ChromemDB) AddToCollection(collName string, writeMode string, docs ...interface{}) (err error)

func (*ChromemDB) Close

func (instance *ChromemDB) Close()

func (*ChromemDB) DeleteCollection

func (instance *ChromemDB) DeleteCollection(name string) (err error)

func (*ChromemDB) GetCollection

func (instance *ChromemDB) GetCollection(name string, params ...interface{}) (response vectordb_commons.IVectorDBCollection, err error)

func (*ChromemDB) GetOrCreateCollection

func (instance *ChromemDB) GetOrCreateCollection(name string, params ...interface{}) (response vectordb_commons.IVectorDBCollection, err error)

func (*ChromemDB) Load

func (instance *ChromemDB) Load(filename string, writeMode string) (err error)

func (*ChromemDB) Open

func (instance *ChromemDB) Open() (err error)

func (*ChromemDB) Options

func (instance *ChromemDB) Options() *ChromemDBOptions

func (*ChromemDB) SchemaAddCollectionSources

func (instance *ChromemDB) SchemaAddCollectionSources(name string, source ...string) []string

func (*ChromemDB) SchemaGetCollectionHash

func (instance *ChromemDB) SchemaGetCollectionHash(collName string) string

func (*ChromemDB) SchemaGetCollectionSources

func (instance *ChromemDB) SchemaGetCollectionSources(name string) []string

func (*ChromemDB) SchemaGetCollections

func (instance *ChromemDB) SchemaGetCollections() []string

func (*ChromemDB) SchemaRemoveCollectionSources

func (instance *ChromemDB) SchemaRemoveCollectionSources(name string, source ...string) []string

SchemaRemoveCollectionSources removes specified sources from the collection schema and returns the updated source list.

func (*ChromemDB) String

func (instance *ChromemDB) String() string

type ChromemDBCollection

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

func (*ChromemDBCollection) Count

func (instance *ChromemDBCollection) Count() (response int)

func (*ChromemDBCollection) Delete

func (instance *ChromemDBCollection) Delete(ctx context.Context, params ...interface{}) (err error)

func (*ChromemDBCollection) DeleteById

func (instance *ChromemDBCollection) DeleteById(ctx context.Context, id string) (err error)

func (*ChromemDBCollection) GetById

func (instance *ChromemDBCollection) GetById(ctx context.Context, id string) (response *vectordb_commons.DBResult, err error)

func (*ChromemDBCollection) InsertDocument

func (instance *ChromemDBCollection) InsertDocument(ctx context.Context, doc interface{}) (err error)

func (*ChromemDBCollection) InsertDocuments

func (instance *ChromemDBCollection) InsertDocuments(ctx context.Context, docs ...interface{}) (err error)

func (*ChromemDBCollection) Map

func (instance *ChromemDBCollection) Map() map[string]interface{}

func (*ChromemDBCollection) Query

func (instance *ChromemDBCollection) Query(ctx context.Context, params ...interface{}) (response []*vectordb_commons.DBResult, err error)

func (*ChromemDBCollection) String

func (instance *ChromemDBCollection) String() string

func (*ChromemDBCollection) UpdateDocument

func (instance *ChromemDBCollection) UpdateDocument(ctx context.Context, doc interface{}) (err error)

func (*ChromemDBCollection) UpdateDocuments

func (instance *ChromemDBCollection) UpdateDocuments(ctx context.Context, docs ...interface{}) (err error)

type ChromemDBOptions

type ChromemDBOptions struct {
	Name              string `json:"name"`
	Path              string `json:"path"`
	Compress          bool   `json:"compress"`
	LLMEmbeddingModel string `json:"llm-embedding-model"`
	LLMDriver         string `json:"llm-driver"`
	LLMBaseUrl        string `json:"llm-base-url"`
}

func (*ChromemDBOptions) Map

func (instance *ChromemDBOptions) Map() (response map[string]interface{})

func (*ChromemDBOptions) String

func (instance *ChromemDBOptions) String() string

type ChromemDBSchema

type ChromemDBSchema struct {
	Name               string              `json:"name"`
	Path               string              `json:"path"`
	CollectionHashes   map[string]string   `json:"collections"`         // name , hash
	CollectionContents map[string][]string `json:"collections-content"` // name, list of loaded files
	// contains filtered or unexported fields
}

func NewChromemDBSchema

func NewChromemDBSchema(name, path string) (instance *ChromemDBSchema, err error)

func (*ChromemDBSchema) CollectionAdd

func (instance *ChromemDBSchema) CollectionAdd(collection string)

func (*ChromemDBSchema) CollectionAddContent

func (instance *ChromemDBSchema) CollectionAddContent(collection string, toAdd ...string)

func (*ChromemDBSchema) CollectionGetContent

func (instance *ChromemDBSchema) CollectionGetContent(collection string) (response []string)

func (*ChromemDBSchema) CollectionGetHash

func (instance *ChromemDBSchema) CollectionGetHash(collection string) string

func (*ChromemDBSchema) CollectionRemove

func (instance *ChromemDBSchema) CollectionRemove(collection string)

func (*ChromemDBSchema) CollectionRemoveContent

func (instance *ChromemDBSchema) CollectionRemoveContent(collection string, toRemove ...string)

func (*ChromemDBSchema) CollectionSetHash

func (instance *ChromemDBSchema) CollectionSetHash(collection string, data ...any)

func (*ChromemDBSchema) Collections

func (instance *ChromemDBSchema) Collections() (response []string)

func (*ChromemDBSchema) Map

func (instance *ChromemDBSchema) Map() (response map[string]interface{})

func (*ChromemDBSchema) String

func (instance *ChromemDBSchema) String() string

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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