embeddings

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyText = errors.New("text cannot be empty")

Functions

This section is empty.

Types

type Embedder

type Embedder interface {
	EmbedDocuments(ctx context.Context, texts []string) ([][]float32, error)
	EmbedQuery(ctx context.Context, text string) ([]float32, error)
	EmbedQueries(ctx context.Context, texts []string) ([][]float32, error)
	GetDimension(ctx context.Context) (int, error)
}

func NewEmbedder

func NewEmbedder(client Embedder, opts ...Option) (Embedder, error)

type EmbedderImpl

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

func (*EmbedderImpl) EmbedDocuments

func (e *EmbedderImpl) EmbedDocuments(ctx context.Context, texts []string) ([][]float32, error)

func (*EmbedderImpl) EmbedQueries added in v0.7.0

func (e *EmbedderImpl) EmbedQueries(ctx context.Context, texts []string) ([][]float32, error)

func (*EmbedderImpl) EmbedQuery

func (e *EmbedderImpl) EmbedQuery(ctx context.Context, text string) ([]float32, error)

func (*EmbedderImpl) GetDimension

func (e *EmbedderImpl) GetDimension(ctx context.Context) (int, error)

type Option

type Option func(*options)

func WithBatchSize

func WithBatchSize(size int) Option

func WithDocumentPrefix added in v0.11.0

func WithDocumentPrefix(prefix string) Option

func WithQueryPrefix added in v0.11.0

func WithQueryPrefix(prefix string) Option

func WithStripNewLines

func WithStripNewLines(strip bool) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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