Documentation
¶
Overview ¶
Package embed is the local host's embed.Embedder composition: it resolves model.EmbeddingConfig — a host-private schema that never goes public — into one pkg/llm/embed Embedder (provider adapter, timeout, rate limit), paralleling the chat-runner factory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchSize ¶
func BatchSize(cfg model.EmbeddingConfig) int
BatchSize resolves the number of texts one request carries: cfg.BatchSize when positive, else the provider default. The composition site hands it to embed.Batched, and the CLI indexer buckets its work by it so a bucket is at most one request.
func New ¶
func New(cfg model.EmbeddingConfig) (pkgembed.Embedder, error)
New constructs the per-round-trip embedder from cfg: the provider adapter, which sends one request per Embed, bounded by cfg.Timeout and, for remote providers ("openai"), rate-limited by cfg.RateLimitRPS or a conservative provider default. The caller composes embed.Batched around it with BatchSize(cfg) (20260902-154750-d-tac-o1s), so deadline and limiter apply to each request. Returns an error when Provider is unrecognised or required fields (Model, API key for remote providers) are missing.
Types ¶
This section is empty.