embeddings

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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; D-204). 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

View Source
const DefaultDriver = internal.DefaultDriver

DefaultDriver is the driver name Open resolves when the config names none.

Variables

View Source
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.

View Source
var Cosine = internal.Cosine

Cosine returns the cosine similarity of two vectors — the shared ranking primitive for retrieval over embedded corpora.

View Source
var HasIdentity = internal.HasIdentity

HasIdentity reports whether ctx carries a Harbor identity (the embedding edge fails closed without one).

Open resolves the configured embeddings driver and opens it.

View Source
var RegisteredDrivers = internal.RegisteredDrivers

RegisteredDrivers lists the seated embeddings driver names (blank-import sdk/drivers/prod to seat the production set).

View Source
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.

type Deps

type Deps = internal.Deps

Deps carries the (currently empty) runtime dependencies.

type Embedder

type Embedder = internal.Embedder

Embedder is the identity-mandatory embedding client interface.

Jump to

Keyboard shortcuts

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