mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-24 21:38:09 +02:00
refactor(embedding-cache): rename index cache to embedding cache
The cached payload is the indexing pipeline's embeddings (markdown is chunked then embedded), so "embedding cache" names the expensive output directly and removes the "index" ambiguity (DB index vs vector index vs indexing phase). Renames the service, settings, eligibility, eviction task, metrics, config flags (INDEX_CACHE_* -> EMBEDDING_CACHE_*), object prefix, and the table (index_cache_embedding_sets -> embedding_cache_sets) with its constraint and indexes. Migration 161 renamed accordingly.
This commit is contained in:
parent
8cf578d965
commit
91d947ff79
18 changed files with 93 additions and 89 deletions
|
|
@ -1,28 +1,28 @@
|
|||
from app.indexing_pipeline.cache.eligibility import is_index_cacheable
|
||||
from app.indexing_pipeline.cache.eligibility import is_embedding_cacheable
|
||||
|
||||
|
||||
def test_disabled_cache_is_never_cacheable():
|
||||
assert not is_index_cacheable(
|
||||
assert not is_embedding_cacheable(
|
||||
cache_enabled=False, embedding_model="m", embedding_dim=384
|
||||
)
|
||||
|
||||
|
||||
def test_missing_model_is_not_cacheable():
|
||||
assert not is_index_cacheable(
|
||||
assert not is_embedding_cacheable(
|
||||
cache_enabled=True, embedding_model=None, embedding_dim=384
|
||||
)
|
||||
|
||||
|
||||
def test_missing_dimension_is_not_cacheable():
|
||||
assert not is_index_cacheable(
|
||||
assert not is_embedding_cacheable(
|
||||
cache_enabled=True, embedding_model="m", embedding_dim=None
|
||||
)
|
||||
assert not is_index_cacheable(
|
||||
assert not is_embedding_cacheable(
|
||||
cache_enabled=True, embedding_model="m", embedding_dim=0
|
||||
)
|
||||
|
||||
|
||||
def test_enabled_with_model_and_dim_is_cacheable():
|
||||
assert is_index_cacheable(
|
||||
assert is_embedding_cacheable(
|
||||
cache_enabled=True, embedding_model="m", embedding_dim=384
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue