Skip to content

Commit 7dc386a

Browse files
committed
fix: test
1 parent ddb3524 commit 7dc386a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/memos/mem_os/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ def search(
563563
Returns:
564564
MemoryResult: A dictionary containing the search results.
565565
"""
566-
target_user_id = user_id if user_id is not None else self.user_ids
566+
target_user_id = user_id if user_id is not None else self.user_id
567567

568568
self._validate_user_exists(target_user_id)
569569
# Get all cubes accessible by the target user

tests/mem_reader/test_simple_structure.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def test_init(self):
4343
def test_process_chat_data(self):
4444
"""Test processing chat data into memory items."""
4545
scene_data_info = [
46-
"user: Hello",
47-
"assistant: Hi there",
48-
"user: How are you?",
46+
{"role": "user", "content": "Hello"},
47+
{"role": "assistant", "content": "Hi there"},
48+
{"role": "user", "content": "How are you?"},
4949
]
5050
info = {"user_id": "user1", "session_id": "session1"}
5151

@@ -115,7 +115,14 @@ def test_get_scene_data_info_with_chat(self):
115115

116116
self.assertIsInstance(result, list)
117117
self.assertEqual(len(result), 1)
118-
self.assertEqual(result[0][0], "user: [3 May 2025]: I'm feeling a bit down today.")
118+
self.assertEqual(
119+
result[0][0],
120+
{
121+
"role": "user",
122+
"chat_time": "3 May 2025",
123+
"content": "I'm feeling a bit down today.",
124+
},
125+
)
119126

120127
@patch("memos.mem_reader.simple_struct.ParserFactory")
121128
def test_get_scene_data_info_with_doc(self, mock_parser_factory):

0 commit comments

Comments
 (0)