embed

package
v0.18.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 13 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

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