From 596d2cec368eebb33a370d09df86c063d9462ed3 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 25 Apr 2023 12:13:56 +0530 Subject: [PATCH] fix: use correct redis cache url --- doppio_bot/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doppio_bot/api.py b/doppio_bot/api.py index de39319..605aa69 100644 --- a/doppio_bot/api.py +++ b/doppio_bot/api.py @@ -36,7 +36,10 @@ def get_chatbot_response(session_id: str, prompt_message: str) -> str: frappe.throw("Please set `openai_api_key` in site config") llm = OpenAI(temperature=0, openai_api_key=opeai_api_key) - message_history = RedisChatMessageHistory(session_id=session_id) + message_history = RedisChatMessageHistory( + session_id=session_id, + url=frappe.conf.get("redis_cache") or "redis://localhost:6379/0", + ) memory = ConversationBufferMemory(memory_key="history", chat_memory=message_history) conversation_chain = ConversationChain(llm=llm, memory=memory, prompt=prompt_template)