Documentation
¶
Overview ¶
Package mock is a deterministic, dependency-free Embedder used for integration tests, the dev-loop, and CI before the real ONNX adapter lands. It uses the classic **feature-hashing trick**: tokens are hashed into dim buckets, counted, then L2-normalized.
Properties:
- same text → same vector (deterministic)
- similar texts → similar vectors (shared tokens dominate)
- no vocab, no model file, no download
Not appropriate for production retrieval — but it lets `ckv build → ckv query` work end-to-end so the rest of the pipeline can be wired and tested independently of the (heavyweight) ONNX path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Embedder ¶
type Embedder struct {
// contains filtered or unexported fields
}
Embedder is the in-process feature-hashing mock.
func New ¶
New constructs an Embedder with a custom dim/name. Pass dim ≤ 0 for the default. The name is what gets stamped in the manifest.
func (*Embedder) Embed ¶
Embed produces one vector per input string. Pure-Go and synchronous; the context is honored only via early-exit on Done.
func (*Embedder) Identity ¶
func (e *Embedder) Identity() types.EmbeddingIdentity
Identity reports the mock embedding space. Vectors are L2-normalized feature hashes (see package doc); pooling is not applicable.