Skip to content

A programming framework for agentic AI

Print warning if DiskCache when RedisCache requested (#1921)

Jack Gerritsd447f7f64672
diff --git a/autogen/cache/cache_factory.py b/autogen/cache/cache_factory.py
index af82efd0f..e3c50e9eb 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 @@ class CacheFactory:
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}")