Spaces:
Sleeping
Sleeping
File size: 517 Bytes
09da05c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | """Caching abstraction for low-latency persona responses."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any, Dict, Optional
@dataclass
class CacheClient:
"""A naive in-memory cache placeholder. Replace with Redis/Memcached."""
_entries: Dict[str, Any] = field(default_factory=dict)
def get(self, key: str) -> Optional[Any]:
return self._entries.get(key)
def set(self, key: str, value: Any) -> None:
self._entries[key] = value
|