embeddings

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is 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)
	GetDimension(ctx context.Context) (int, error)
}

type EmbedderClient

type EmbedderClient interface {
	CreateEmbedding(ctx context.Context, texts []string) ([][]float32, error)
	GetDimension(ctx context.Context) (int, error)
}

type EmbedderImpl

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

func NewEmbedder

func NewEmbedder(client EmbedderClient, opts ...Option) (*EmbedderImpl, error)

func (*EmbedderImpl) EmbedDocuments

func (e *EmbedderImpl) EmbedDocuments(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