Skip to content

Commit

Permalink
fix: use correct redis cache url
Browse files Browse the repository at this point in the history
  • Loading branch information
NagariaHussain committed Apr 25, 2023
1 parent 86e3444 commit 596d2ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doppio_bot/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 596d2ce

Please sign in to comment.