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]. |
Click to show internal directories.
Click to hide internal directories.