Spaces:
Sleeping
Sleeping
Update chatbot/memory.py
Browse files- chatbot/memory.py +7 -6
chatbot/memory.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
-
from langchain.memory import
|
2 |
from chatbot.llm import gemini_llm
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
1 |
+
from langchain.memory import ConversationSummaryBufferMemory
|
2 |
from chatbot.llm import gemini_llm
|
3 |
|
4 |
+
memory = ConversationSummaryBufferMemory(
|
5 |
+
llm=gemini_llm,
|
6 |
+
memory_key="chat_history", # this key will hold the conversation context
|
7 |
+
max_token_limit=2000, # adjust this limit based on your needs
|
8 |
+
return_messages=True
|
9 |
+
)
|