From dabba51d2b13ff0abca89833c119950f97a1661d Mon Sep 17 00:00:00 2001 From: Abdullah Al Amin Date: Fri, 8 Sep 2023 09:25:14 +0000 Subject: [PATCH] chore: rename method --- ai/question.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ai/question.py b/ai/question.py index 4360e39..1286eea 100644 --- a/ai/question.py +++ b/ai/question.py @@ -22,7 +22,7 @@ def _cleanup_chats(): chatMemories.pop(chat_id) -def _get_chat(chat_id: str)->ConversationBufferMemory: +def _get_chat_memory(chat_id: str)->ConversationBufferMemory: _cleanup_chats() chatMemories.setdefault(chat_id, { @@ -50,7 +50,7 @@ def ask(repo_id: int, chat_id: str, question: str): retriever.search_kwargs["maximal_marginal_relevance"] = True retriever.search_kwargs["k"] = 20 - memory = _get_chat(chat_id) + memory = _get_chat_memory(chat_id) qa = ConversationalRetrievalChain.from_llm( llm=ChatOpenAI(temperature=0),