Redis Linker
Redis Linker Class Documentation
Overview
Redis DB?
Usage
LINKER_TYPE="redisdb"
REDIS_HOST="your redis host url"
REDIS_PORT="your redis port number"
REDIS_DB_NAME="your redis db name"
REDIS_PW="your redis password"from RAGchain.utils.linker.redis_linker import RedisLinker
# Create an instance of the RedisLinker class
linker = RedisLinker()
# Check the connection to the Redis database
if linker.connection_check():
print("Connected to Redis database")
# Put JSON data into the Redis database
linker.put_json("1234", {"name": "John", "age": 30})
# Get JSON data from the Redis database
data = linker.get_json(["1234"])
print(data)
# Flush the Redis database
linker.flush_db()Last updated