unique-user-memory 2026.30.0.dev1__tar.gz → 2026.30.0.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/PKG-INFO +2 -2
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/pyproject.toml +2 -2
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/unique_user_memory/tests/test_user_memory.py +4 -2
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/unique_user_memory/user_memory_postprocessor.py +10 -4
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/README.md +0 -0
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/unique_user_memory/__init__.py +0 -0
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/unique_user_memory/config.py +0 -0
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/unique_user_memory/user_memory.py +0 -0
- {unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/unique_user_memory/user_memory_prompts.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: unique-user-memory
|
|
3
|
-
Version: 2026.30.0.
|
|
3
|
+
Version: 2026.30.0.dev2
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Fabian Schläpfer
|
|
6
6
|
Author-email: Fabian Schläpfer <fabian@unique.ch>
|
|
@@ -8,7 +8,7 @@ License: Proprietary
|
|
|
8
8
|
Requires-Dist: jinja2>=3.1.6
|
|
9
9
|
Requires-Dist: pydantic>=2.8.2
|
|
10
10
|
Requires-Dist: unique-sdk>=2026.30.0.dev9,<2026.30.0rc0
|
|
11
|
-
Requires-Dist: unique-toolkit>=2026.30.0.
|
|
11
|
+
Requires-Dist: unique-toolkit>=2026.30.0.dev22,<2026.30.0rc0
|
|
12
12
|
Requires-Python: >=3.12, <4
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "unique_user_memory"
|
|
3
|
-
version = "2026.30.0.
|
|
3
|
+
version = "2026.30.0.dev2"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Fabian Schläpfer", email = "fabian@unique.ch" },
|
|
@@ -12,7 +12,7 @@ dependencies = [
|
|
|
12
12
|
"jinja2>=3.1.6",
|
|
13
13
|
"pydantic>=2.8.2",
|
|
14
14
|
"unique-sdk>=2026.30.0.dev9,<2026.30.0rc0",
|
|
15
|
-
"unique-toolkit>=2026.30.0.
|
|
15
|
+
"unique-toolkit>=2026.30.0.dev22,<2026.30.0rc0",
|
|
16
16
|
]
|
|
17
17
|
|
|
18
18
|
[dependency-groups]
|
|
@@ -949,8 +949,9 @@ async def test_user_memory_postprocessor_logs_success_when_upload_succeeds(
|
|
|
949
949
|
chat_service=chat_service,
|
|
950
950
|
)
|
|
951
951
|
|
|
952
|
-
await postprocessor.run(loop_response)
|
|
952
|
+
updated = await postprocessor.run(loop_response)
|
|
953
953
|
|
|
954
|
+
assert updated is True
|
|
954
955
|
upload.assert_awaited_once_with(
|
|
955
956
|
scope_id="scope_1",
|
|
956
957
|
content=updated_memory,
|
|
@@ -993,8 +994,9 @@ async def test_user_memory_postprocessor_does_not_log_success_when_upload_fails(
|
|
|
993
994
|
chat_service=chat_service,
|
|
994
995
|
)
|
|
995
996
|
|
|
996
|
-
await postprocessor.run(loop_response)
|
|
997
|
+
updated = await postprocessor.run(loop_response)
|
|
997
998
|
|
|
999
|
+
assert updated is False
|
|
998
1000
|
assert all(
|
|
999
1001
|
call.args != ("[user-memory] memory updated and uploaded successfully",)
|
|
1000
1002
|
for call in logger.info.call_args_list
|
|
@@ -50,12 +50,17 @@ class UserMemoryPostprocessor(Postprocessor):
|
|
|
50
50
|
self._new_memory: str | None = None
|
|
51
51
|
self._chat_service: ChatService = chat_service
|
|
52
52
|
|
|
53
|
-
async def run(self, loop_response: LanguageModelStreamResponse) ->
|
|
53
|
+
async def run(self, loop_response: LanguageModelStreamResponse) -> bool:
|
|
54
|
+
"""Consolidate and upload user memory for this turn.
|
|
55
|
+
|
|
56
|
+
Returns True if the memory profile changed and was uploaded, False
|
|
57
|
+
otherwise (no user/company, NOOP consolidation, or failed upload).
|
|
58
|
+
"""
|
|
54
59
|
self._logger.info("[user-memory] running postprocessor")
|
|
55
60
|
user_id = self._event.user_id
|
|
56
61
|
company_id = self._event.company_id
|
|
57
62
|
if not user_id or not company_id:
|
|
58
|
-
return
|
|
63
|
+
return False
|
|
59
64
|
|
|
60
65
|
on_update_start: Callable[[], Awaitable[None]] = noop_update_callback
|
|
61
66
|
on_update_end: Callable[[], Awaitable[None]] = noop_update_callback
|
|
@@ -98,7 +103,7 @@ class UserMemoryPostprocessor(Postprocessor):
|
|
|
98
103
|
|
|
99
104
|
if self._new_memory == self._state.text:
|
|
100
105
|
self._logger.debug("[user-memory] consolidation NOOP - skipping upload")
|
|
101
|
-
return
|
|
106
|
+
return False
|
|
102
107
|
|
|
103
108
|
uploaded = await upload_user_memory(
|
|
104
109
|
scope_id=self._state.scope_id,
|
|
@@ -109,9 +114,10 @@ class UserMemoryPostprocessor(Postprocessor):
|
|
|
109
114
|
)
|
|
110
115
|
if not uploaded:
|
|
111
116
|
self._logger.warning("[user-memory] memory update was not uploaded")
|
|
112
|
-
return
|
|
117
|
+
return False
|
|
113
118
|
|
|
114
119
|
self._logger.info("[user-memory] memory updated and uploaded successfully")
|
|
120
|
+
return True
|
|
115
121
|
|
|
116
122
|
async def _set_message_content(
|
|
117
123
|
self,
|
|
File without changes
|
|
File without changes
|
{unique_user_memory-2026.30.0.dev1 → unique_user_memory-2026.30.0.dev2}/unique_user_memory/config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|