Skip to content

The agent engineering platform.

Bug fixes and error handling in Redis - Vectorstore (#4932)

Adheeban Manoharan616e9a93e08f
diff --git a/langchain/vectorstores/redis.py b/langchain/vectorstores/redis.py
index 4a10b08ab9..9c4ec0c415 100644
--- a/langchain/vectorstores/redis.py
+++ b/langchain/vectorstores/redis.py
@@ -56,8 +56,9 @@ def _check_redis_module_exist(client: RedisType, required_modules: List[dict]) -
return
# otherwise raise error
error_message = (
- "You must add the RediSearch (>= 2.4) module from Redis Stack. "
- "Please refer to Redis Stack docs: https://redis.io/docs/stack/"
+ "Redis cannot be used as a vector database without RediSearch >=2.4"
+ "Please head to https://redis.io/docs/stack/search/quick_start/"
+ "to know more about installing the RediSearch module within Redis Stack."
)
logging.error(error_message)
raise ValueError(error_message)
@@ -126,7 +127,7 @@ class Redis(VectorStore):
except ImportError:
raise ValueError(
"Could not import redis python package. "
- "Please install it with `pip install redis`."
+ "Please install it with `pip install redis>=4.1.0`."
)
self.embedding_function = embedding_function
@@ -358,7 +359,7 @@ class Redis(VectorStore):
@classmethod
def from_texts_return_keys(
- cls: Type[Redis],
+ cls,
texts: List[str],
embedding: Embeddings,
metadatas: Optional[List[dict]] = None,