Documentation
¶
Overview ¶
Package mock provides a deterministic llm.Provider implementation for tests. It does NOT require any network, API key, or external process. Callers import it directly (no build tag) — the package lives under internal/ so it cannot leak into the public API surface.
Index ¶
- Constants
- type Provider
- func (p *Provider) BatchCeiling() int
- func (p *Provider) Complete(ctx context.Context, prompt string, _ ...llm.Option) (string, error)
- func (p *Provider) Embed(ctx context.Context, text string) ([]float32, error)
- func (p *Provider) EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)
- func (p *Provider) ModelID() string
- func (p *Provider) Name() string
Constants ¶
const DefaultDims = 128
DefaultDims is the default embedding dimensionality.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
Dims int
}
Provider is a deterministic, in-memory llm.Provider useful for unit and integration tests. It inspects the prompt for known substrings and returns canned, schema-valid JSON; embeddings are derived from a SHA-256 of the input so equal text yields equal vectors.
func (*Provider) BatchCeiling ¶
func (*Provider) Complete ¶
Complete returns a deterministic response chosen by prompt substring. Schema must match what internal/extractor and internal/community expect; see entityPrompt in internal/extractor/entities.go and communityPrompt in internal/community/summarizer.go.
func (*Provider) Embed ¶
Embed returns a Dims-length vector derived from SHA-256(text). Equal text yields equal vectors.