get_client#
- langchain_aws.utilities.redis.get_client(redis_url: str, **kwargs: Any) RedisType [source]#
Get a redis client from the connection url given. This helper accepts urls for Redis server (TCP with/without TLS or UnixSocket) as well as Redis Sentinel connections.
Before creating a connection the existence of the database driver is checked and ValueError raised otherwise.
To use, you should have the
redis
python package installed.Example
from langchain_community.utilities.redis import get_client redis_client = get_client( redis_url="redis://username:password@localhost:6379" index_name="my-index", embedding_function=embeddings.embed_query, )
- Parameters:
redis_url (str) –
kwargs (Any) –
- Return type:
RedisType