Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes and error handling in Redis - Vectorstore #4932

Merged
merged 7 commits into from
May 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions langchain/vectorstores/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -126,7 +127,7 @@ def __init__(
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
Expand Down Expand Up @@ -358,7 +359,7 @@ def _similarity_search_with_relevance_scores(

@classmethod
def from_texts_return_keys(
cls: Type[Redis],
cls,
texts: List[str],
embedding: Embeddings,
metadatas: Optional[List[dict]] = None,
Expand Down