Skip to content

Commit 910b799

Browse files
authored
Feat/chat history (#187)
* fix:get chat history in the fun mos.search() and mos.chat() * fix: get chat history in the unittest
1 parent 64cc9af commit 910b799

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/memos/mem_os/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def chat(self, query: str, user_id: str | None = None, base_prompt: str | None =
289289
info={
290290
"user_id": target_user_id,
291291
"session_id": self.session_id,
292-
"chat_history": chat_history,
292+
"chat_history": chat_history.chat_history,
293293
},
294294
)
295295
memories_all.extend(memories)
@@ -590,7 +590,7 @@ def search(
590590
info={
591591
"user_id": target_user_id,
592592
"session_id": self.session_id,
593-
"chat_history": chat_history,
593+
"chat_history": chat_history.chat_history,
594594
},
595595
)
596596
result["text_mem"].append({"cube_id": mem_cube_id, "memories": memories})

tests/mem_os/test_memos_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def test_chat_with_memories(
592592
info={
593593
"user_id": mos.user_id,
594594
"session_id": mos.session_id,
595-
"chat_history": mos.chat_history_manager[mos.user_id],
595+
"chat_history": mos.chat_history_manager[mos.user_id].chat_history,
596596
},
597597
)
598598

0 commit comments

Comments
 (0)