embedder

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 7 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 {
	// Embed returns a vector embedding for the given text.
	Embed(ctx context.Context, text string) ([]float32, error)

	// EmbedBatch returns vector embeddings for multiple texts.
	EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)

	// Dimension returns the embedding vector dimension.
	Dimension() int
}

Embedder generates vector embeddings from text.

type OllamaEmbedder

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

OllamaEmbedder implements Embedder using the Ollama HTTP API.

func NewOllamaEmbedder

func NewOllamaEmbedder(baseURL, model string, dimension int, logger *slog.Logger) *OllamaEmbedder

NewOllamaEmbedder creates a new Ollama-based embedder.

func (*OllamaEmbedder) Dimension

func (o *OllamaEmbedder) Dimension() int

func (*OllamaEmbedder) Embed

func (o *OllamaEmbedder) Embed(ctx context.Context, text string) ([]float32, error)

func (*OllamaEmbedder) EmbedBatch

func (o *OllamaEmbedder) EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)

Jump to

Keyboard shortcuts

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