2424from .optimizely import Optimizely
2525from .odp .lru_cache import LRUCache
2626from .cmab .cmab_client import DefaultCmabClient , CmabRetryConfig
27- from .cmab .cmab_service import DefaultCmabService , DEFAULT_CMAB_CACHE_TIMEOUT , DEFAULT_CMAB_CACHE_SIZE
27+ from .cmab .cmab_service import DefaultCmabService , CmabCacheValue , DEFAULT_CMAB_CACHE_TIMEOUT , DEFAULT_CMAB_CACHE_SIZE
2828
2929if TYPE_CHECKING :
3030 # prevent circular dependenacy by skipping import at runtime
@@ -41,7 +41,7 @@ class OptimizelyFactory:
4141 blocking_timeout : Optional [int ] = None
4242 cmab_cache_size : Optional [int ] = None
4343 cmab_cache_ttl : Optional [int ] = None
44- cmab_custom_cache : Optional [LRUCache ] = None
44+ cmab_custom_cache : Optional [LRUCache [ str , CmabCacheValue ] ] = None
4545
4646 @staticmethod
4747 def set_batch_size (batch_size : int ) -> int :
@@ -118,7 +118,7 @@ def set_cmab_cache_ttl(cache_ttl: int, logger: Optional[optimizely_logger.Logger
118118 return OptimizelyFactory .cmab_cache_ttl
119119
120120 @staticmethod
121- def set_cmab_custom_cache (custom_cache : LRUCache ) -> LRUCache :
121+ def set_cmab_custom_cache (custom_cache : LRUCache [ str , CmabCacheValue ] ) -> LRUCache :
122122 """ Convenience method for setting custom CMAB cache.
123123 Args:
124124 custom_cache: Cache implementation with lookup, save, remove, and reset methods.
0 commit comments