fix: replace hardcoded tokendb path
This commit is contained in:
parent
29ee360082
commit
0b64a84e96
3 changed files with 13 additions and 4 deletions
|
|
@ -1,4 +1,6 @@
|
|||
"""Unit tests for cache.LLMCache in exact-match mode (no sentence-transformers needed)."""
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
import orjson
|
||||
|
|
@ -13,6 +15,8 @@ from cache import (
|
|||
openai_nonstream_to_sse,
|
||||
)
|
||||
|
||||
_CACHE_DB_PATH = str(Path(tempfile.gettempdir()) / "nomyo_test_cache.db")
|
||||
|
||||
|
||||
def _exact_cfg(backend: str = "memory") -> SimpleNamespace:
|
||||
"""Config for exact-match mode — similarity=1.0 avoids embedding deps."""
|
||||
|
|
@ -22,7 +26,7 @@ def _exact_cfg(backend: str = "memory") -> SimpleNamespace:
|
|||
cache_similarity=1.0,
|
||||
cache_history_weight=0.3,
|
||||
cache_ttl=300,
|
||||
cache_db_path="/tmp/test_cache.db",
|
||||
cache_db_path=_CACHE_DB_PATH,
|
||||
cache_redis_url="redis://localhost:6379",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue