embeddings

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 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 WithStripNewLines

func WithStripNewLines(strip bool) Option

Jump to

Keyboard shortcuts

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