diff --git a/litellm/caching/valkey_semantic_cache.py b/litellm/caching/valkey_semantic_cache.py index 4f6e1b9564f..0feb1d13634 100644 --- a/litellm/caching/valkey_semantic_cache.py +++ b/litellm/caching/valkey_semantic_cache.py @@ -24,6 +24,7 @@ from typing import Any, Final from redis import Redis from redis.asyncio import Redis as AsyncRedis from redis.commands.search.field import TagField, VectorField + try: # redis-py >= 5 (module renamed to snake_case) from redis.commands.search.index_definition import IndexDefinition, IndexType except ModuleNotFoundError: # redis-py 4.x (last version with camelCase name)