embedder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package embedder defines the Embedder interface for converting text into float32 embedding vectors.

This package contains only the interface. Concrete implementations live in sub-packages (e.g. embedder/openaicompat) and are constructed in cmd/codamigo. Keeping implementations in sub-packages prevents provider- specific HTTP logic from leaking into library consumers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder interface {
	Embed(ctx context.Context, text string) ([]float32, error)
	EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)
	// EmbedBatchPartial embeds texts in sub-batches with per-text failure
	// isolation. Returned slices satisfy:
	//   - len(vectors) == len(errs) == len(texts)
	//   - vectors[i] is nil iff errs[i] != nil
	// Callers should also inspect ctx.Err() to distinguish caller
	// cancellation from per-sub-batch failure.
	EmbedBatchPartial(ctx context.Context, texts []string) ([][]float32, []error)
}

Embedder converts text into float32 embedding vectors.

Directories

Path Synopsis
Package openaicompat provides an OpenAI-compatible embedding API client that implements [embedder.Embedder].
Package openaicompat provides an OpenAI-compatible embedding API client that implements [embedder.Embedder].

Jump to

Keyboard shortcuts

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