/
yakobsonsa
/
bi_agent
Обзор
Документация
Войти
/
yakobsonsa
/
bi_agent
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/interfaces/cache.py
19 строк
681 B
Yakobsonsa
vers 2.0
02 фев 2026, 00:06
02 фев 2026, 00:06
72f33ab
Код
Авторство
О чём код?
"""Cache interface (ports).""" from typing import Protocol, Optional, Dict, Any class ICache(Protocol): """Protocol for cache access (responses + context).""" async def get_response(self, key: str) -> Optional[Dict[str, Any]]: """Get cached response payload by key.""" async def set_response(self, key: str, payload: Dict[str, Any], ttl_seconds: int) -> None: """Cache response payload with TTL.""" async def get_context(self, key: str) -> Optional[str]: """Get cached conversation context by key.""" async def set_context(self, key: str, context: str, ttl_seconds: int) -> None: """Cache conversation context with TTL."""