opengpts icon indicating copy to clipboard operation
opengpts copied to clipboard

how do I set the password for Redis

Open HappyWHoo opened this issue 8 months ago • 3 comments

If I use Redis cloud as a vector database, how do I set the password for Redis when the application starts? Because it started with an error message, prompt: redis. exceptions. AuthenticationError: Authentication required

HappyWHoo avatar Nov 26 '23 14:11 HappyWHoo

How are you presently trying to connect?

chasemcdo avatar Nov 29 '23 17:11 chasemcdo

got this too how to set redis?

dominicdev avatar Dec 15 '23 02:12 dominicdev

Try using this snippet when using RedisChatMessageHistory

message_history = RedisChatMessageHistory(
    url="redis://:<PASSWORD>@<PUBLIC-ENDPOINT>:<PORT>", ttl=600, session_id="my-session"
)

memory = ConversationBufferWindowMemory(
    k=5, memory_key="chat_history", chat_memory=message_history, input_key="question"
)

memory.load_memory_variables({"question": "about langchain"})

# output
# -----
# {'chat_history': ''}

rafka-imandaputra avatar Feb 03 '24 07:02 rafka-imandaputra