From 335a486e1dc1d2616bd1e7a606d1dafe659b6f55 Mon Sep 17 00:00:00 2001 From: Jack Gerrits Date: Fri, 8 Mar 2024 13:29:57 -0500 Subject: [PATCH] Print warning if DiskCache when RedisCache requested --- autogen/cache/cache_factory.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autogen/cache/cache_factory.py b/autogen/cache/cache_factory.py index af82efd0f2d8..e3c50e9eb2b6 100644 --- a/autogen/cache/cache_factory.py +++ b/autogen/cache/cache_factory.py @@ -1,7 +1,9 @@ -from typing import Optional, Union, Type +from typing import Optional, Union from .abstract_cache_base import AbstractCache from .disk_cache import DiskCache +import logging + class CacheFactory: @staticmethod @@ -45,6 +47,7 @@ def cache_factory( return RedisCache(seed, redis_url) except ImportError: + logging.warning("RedisCache is not available. Creating a DiskCache instance instead.") return DiskCache(f"./{cache_path_root}/{seed}") else: return DiskCache(f"./{cache_path_root}/{seed}")