cache.wrapped_embeddings¶
chunktuner.cache.wrapped_embeddings
¶
Wrap an EmbeddingFunction with SQLite caching.
CachedEmbeddingFunction
¶
maybe_cache_embeddings
¶
Wrap a real embedding function with the SQLite cache under cache_dir.
Returns fn unchanged when enabled is False or fn is a
DummyEmbeddingFunction (deterministic and free — caching would only add I/O).
The cache is keyed by fn.profile_name (the embedding model id), so results are
identical with and without the cache.