Documentation
¶
Overview ¶
Package embeddings is the public SDK facade over Harbor's internal/embeddings package — the embedding client that turns text into vectors (RFC §3.6, §6.5). Alias-based re-exports only: no behavior lives here.
The Embedder is a standalone, à-la-carte-usable primitive: open it with a ConfigSnapshot + Deps (blank-import sdk/drivers/prod to seat the production driver), stamp an identity on the context, call Embed, and rank with Cosine — no memory subsystem, no config file, no Protocol. See docs/recipes/embed-and-retrieve.md.
Index ¶
Constants ¶
const DefaultDriver = internal.DefaultDriver
DefaultDriver is the driver name Open resolves when the config names none.
Variables ¶
var ( // ErrInvalidConfig — the snapshot failed validation. ErrInvalidConfig = internal.ErrInvalidConfig // ErrUnknownDriver — the named embeddings driver is not registered. ErrUnknownDriver = internal.ErrUnknownDriver // ErrIdentityMissing — Embed was called without an identity in ctx. ErrIdentityMissing = internal.ErrIdentityMissing // ErrEmptyInput — Embed was called with no (or empty) texts. ErrEmptyInput = internal.ErrEmptyInput // ErrClientClosed — the client has been closed. ErrClientClosed = internal.ErrClientClosed // ErrDimensionMismatch — Cosine was handed vectors of different // lengths (usually embedding-model drift). ErrDimensionMismatch = internal.ErrDimensionMismatch )
Re-exported sentinel errors callers compare via errors.Is.
var Cosine = internal.Cosine
Cosine returns the cosine similarity of two vectors — the shared ranking primitive for retrieval over embedded corpora.
var HasIdentity = internal.HasIdentity
HasIdentity reports whether ctx carries a Harbor identity (the embedding edge fails closed without one).
var Open = internal.Open
Open resolves the configured embeddings driver and opens it.
var RegisteredDrivers = internal.RegisteredDrivers
RegisteredDrivers lists the seated embeddings driver names (blank-import sdk/drivers/prod to seat the production set).
var SnapshotFromConfig = internal.SnapshotFromConfig
SnapshotFromConfig projects the operator config block into the resolved ConfigSnapshot Open consumes.
Functions ¶
This section is empty.
Types ¶
type ConfigSnapshot ¶
type ConfigSnapshot = internal.ConfigSnapshot
ConfigSnapshot is the resolved embeddings configuration.