defaultef

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package defaultef exposes the legacy default ONNX embedding function package path.

Deprecated: Use github.com/amikos-tech/chroma-go/pkg/embeddings/ort instead.

Index

Constants

View Source
const (
	ChromaCacheDir = ".cache/chroma/"
)

Variables

This section is empty.

Functions

func EnsureDefaultEmbeddingFunctionModel

func EnsureDefaultEmbeddingFunctionModel() error

func EnsureOnnxRuntimeSharedLibrary

func EnsureOnnxRuntimeSharedLibrary() error

Types

type Config added in v0.3.0

type Config struct {
	LibOnnxRuntimeVersion string
	LibCacheDir           string
	OnnxCacheDir          string
	OnnxLibPath           string

	OnnxModelsCachePath          string
	OnnxModelCachePath           string
	OnnxModelPath                string
	OnnxModelTokenizerConfigPath string
}

Config holds all computed configuration paths for ONNX Runtime

type DefaultEmbeddingFunction

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

func NewDefaultEmbeddingFunction deprecated

func NewDefaultEmbeddingFunction(opts ...Option) (*DefaultEmbeddingFunction, func() error, error)

Deprecated: Use github.com/amikos-tech/chroma-go/pkg/embeddings/ort.NewDefaultEmbeddingFunction instead.

func NewDefaultEmbeddingFunctionFromConfig deprecated added in v0.3.0

func NewDefaultEmbeddingFunctionFromConfig(_ embeddings.EmbeddingFunctionConfig) (*DefaultEmbeddingFunction, error)

NewDefaultEmbeddingFunctionFromConfig creates a default embedding function from a config map. The returned EmbeddingFunction implements Closeable; callers should type-assert and call Close() when done to release ONNX runtime and tokenizer resources.

Deprecated: Use github.com/amikos-tech/chroma-go/pkg/embeddings/ort.NewDefaultEmbeddingFunctionFromConfig instead.

func (*DefaultEmbeddingFunction) Close

func (e *DefaultEmbeddingFunction) Close() error

func (*DefaultEmbeddingFunction) DefaultSpace added in v0.3.0

func (*DefaultEmbeddingFunction) EmbedDocuments

func (e *DefaultEmbeddingFunction) EmbedDocuments(_ context.Context, documents []string) ([]embeddings.Embedding, error)

func (*DefaultEmbeddingFunction) EmbedQuery

func (*DefaultEmbeddingFunction) GetConfig added in v0.3.0

func (*DefaultEmbeddingFunction) Name added in v0.3.0

func (e *DefaultEmbeddingFunction) Name() string

func (*DefaultEmbeddingFunction) SupportedSpaces added in v0.3.0

func (e *DefaultEmbeddingFunction) SupportedSpaces() []embeddings.DistanceMetric

type Option

type Option func(p *DefaultEmbeddingFunction) error

Option mutates the embedding function during construction while initLock is held. Implementations must not call Close(), which would try to reacquire initLock and deadlock.

Jump to

Keyboard shortcuts

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