Spaces:
Build error
Build error
UPDATE: chat history retention
Browse files- functions.py +3 -3
functions.py
CHANGED
|
@@ -159,9 +159,9 @@ def format_docs(docs: str):
|
|
| 159 |
|
| 160 |
|
| 161 |
def get_session_history(session_id: str) -> BaseChatMessageHistory:
|
| 162 |
-
if session_id not in
|
| 163 |
-
|
| 164 |
-
return
|
| 165 |
|
| 166 |
|
| 167 |
def trimMessages(chain_input):
|
|
|
|
| 159 |
|
| 160 |
|
| 161 |
def get_session_history(session_id: str) -> BaseChatMessageHistory:
|
| 162 |
+
if session_id not in chatHistoryStore:
|
| 163 |
+
chatHistoryStore[session_id] = ChatMessageHistory()
|
| 164 |
+
return chatHistoryStore[session_id]
|
| 165 |
|
| 166 |
|
| 167 |
def trimMessages(chain_input):
|