evermemos 0.3.9__py3-none-any.whl → 0.3.10__py3-none-any.whl
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.
- evermemos/_base_client.py +5 -2
- evermemos/_compat.py +3 -3
- evermemos/_utils/_json.py +35 -0
- evermemos/_version.py +1 -1
- evermemos/resources/v1/__init__.py +14 -0
- evermemos/resources/v1/memories/conversation_meta.py +138 -10
- evermemos/resources/v1/memories/memories.py +165 -182
- evermemos/resources/v1/status/__init__.py +33 -0
- evermemos/resources/v1/status/request.py +175 -0
- evermemos/resources/v1/status/status.py +102 -0
- evermemos/resources/v1/v1.py +32 -0
- evermemos/types/v1/__init__.py +2 -4
- evermemos/types/v1/memories/conversation_meta_create_params.py +112 -6
- evermemos/types/v1/memories/conversation_meta_create_response.py +74 -6
- evermemos/types/v1/memories/conversation_meta_get_response.py +74 -6
- evermemos/types/v1/memories/conversation_meta_update_params.py +85 -2
- evermemos/types/v1/memories/conversation_meta_update_response.py +11 -0
- evermemos/types/v1/memory_add_params.py +60 -0
- evermemos/types/v1/{memory_create_response.py → memory_add_response.py} +2 -2
- evermemos/types/v1/memory_delete_params.py +9 -0
- evermemos/types/v1/memory_delete_response.py +7 -0
- evermemos/types/v1/memory_get_response.py +12 -5
- evermemos/types/v1/memory_search_response.py +5 -0
- evermemos/types/v1/status/__init__.py +6 -0
- evermemos/types/v1/status/request_get_params.py +13 -0
- evermemos/types/v1/status/request_get_response.py +21 -0
- {evermemos-0.3.9.dist-info → evermemos-0.3.10.dist-info}/METADATA +24 -26
- {evermemos-0.3.9.dist-info → evermemos-0.3.10.dist-info}/RECORD +30 -27
- evermemos/types/v1/global_user_profile/__init__.py +0 -3
- evermemos/types/v1/memory_create_params.py +0 -32
- evermemos/types/v1/memory_load_params.py +0 -56
- evermemos/types/v1/memory_load_response.py +0 -19
- evermemos/types/v1/stats/__init__.py +0 -3
- {evermemos-0.3.9.dist-info → evermemos-0.3.10.dist-info}/WHEEL +0 -0
- {evermemos-0.3.9.dist-info → evermemos-0.3.10.dist-info}/licenses/LICENSE +0 -0
evermemos/_base_client.py
CHANGED
|
@@ -86,6 +86,7 @@ from ._exceptions import (
|
|
|
86
86
|
APIConnectionError,
|
|
87
87
|
APIResponseValidationError,
|
|
88
88
|
)
|
|
89
|
+
from ._utils._json import openapi_dumps
|
|
89
90
|
|
|
90
91
|
log: logging.Logger = logging.getLogger(__name__)
|
|
91
92
|
|
|
@@ -554,8 +555,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
554
555
|
kwargs["content"] = options.content
|
|
555
556
|
elif isinstance(json_data, bytes):
|
|
556
557
|
kwargs["content"] = json_data
|
|
557
|
-
|
|
558
|
-
|
|
558
|
+
elif not files:
|
|
559
|
+
# Don't set content when JSON is sent as multipart/form-data,
|
|
560
|
+
# since httpx's content param overrides other body arguments
|
|
561
|
+
kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
|
|
559
562
|
kwargs["files"] = files
|
|
560
563
|
else:
|
|
561
564
|
headers.pop("Content-Type", None)
|
evermemos/_compat.py
CHANGED
|
@@ -139,6 +139,7 @@ def model_dump(
|
|
|
139
139
|
exclude_defaults: bool = False,
|
|
140
140
|
warnings: bool = True,
|
|
141
141
|
mode: Literal["json", "python"] = "python",
|
|
142
|
+
by_alias: bool | None = None,
|
|
142
143
|
) -> dict[str, Any]:
|
|
143
144
|
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
|
|
144
145
|
return model.model_dump(
|
|
@@ -148,13 +149,12 @@ def model_dump(
|
|
|
148
149
|
exclude_defaults=exclude_defaults,
|
|
149
150
|
# warnings are not supported in Pydantic v1
|
|
150
151
|
warnings=True if PYDANTIC_V1 else warnings,
|
|
152
|
+
by_alias=by_alias,
|
|
151
153
|
)
|
|
152
154
|
return cast(
|
|
153
155
|
"dict[str, Any]",
|
|
154
156
|
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
|
155
|
-
exclude=exclude,
|
|
156
|
-
exclude_unset=exclude_unset,
|
|
157
|
-
exclude_defaults=exclude_defaults,
|
|
157
|
+
exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
|
|
158
158
|
),
|
|
159
159
|
)
|
|
160
160
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing_extensions import override
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
from .._compat import model_dump
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def openapi_dumps(obj: Any) -> bytes:
|
|
12
|
+
"""
|
|
13
|
+
Serialize an object to UTF-8 encoded JSON bytes.
|
|
14
|
+
|
|
15
|
+
Extends the standard json.dumps with support for additional types
|
|
16
|
+
commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
|
|
17
|
+
"""
|
|
18
|
+
return json.dumps(
|
|
19
|
+
obj,
|
|
20
|
+
cls=_CustomEncoder,
|
|
21
|
+
# Uses the same defaults as httpx's JSON serialization
|
|
22
|
+
ensure_ascii=False,
|
|
23
|
+
separators=(",", ":"),
|
|
24
|
+
allow_nan=False,
|
|
25
|
+
).encode()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _CustomEncoder(json.JSONEncoder):
|
|
29
|
+
@override
|
|
30
|
+
def default(self, o: Any) -> Any:
|
|
31
|
+
if isinstance(o, datetime):
|
|
32
|
+
return o.isoformat()
|
|
33
|
+
if isinstance(o, pydantic.BaseModel):
|
|
34
|
+
return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
|
|
35
|
+
return super().default(o)
|
evermemos/_version.py
CHANGED
|
@@ -8,6 +8,14 @@ from .v1 import (
|
|
|
8
8
|
V1ResourceWithStreamingResponse,
|
|
9
9
|
AsyncV1ResourceWithStreamingResponse,
|
|
10
10
|
)
|
|
11
|
+
from .status import (
|
|
12
|
+
StatusResource,
|
|
13
|
+
AsyncStatusResource,
|
|
14
|
+
StatusResourceWithRawResponse,
|
|
15
|
+
AsyncStatusResourceWithRawResponse,
|
|
16
|
+
StatusResourceWithStreamingResponse,
|
|
17
|
+
AsyncStatusResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
11
19
|
from .memories import (
|
|
12
20
|
MemoriesResource,
|
|
13
21
|
AsyncMemoriesResource,
|
|
@@ -24,6 +32,12 @@ __all__ = [
|
|
|
24
32
|
"AsyncMemoriesResourceWithRawResponse",
|
|
25
33
|
"MemoriesResourceWithStreamingResponse",
|
|
26
34
|
"AsyncMemoriesResourceWithStreamingResponse",
|
|
35
|
+
"StatusResource",
|
|
36
|
+
"AsyncStatusResource",
|
|
37
|
+
"StatusResourceWithRawResponse",
|
|
38
|
+
"AsyncStatusResourceWithRawResponse",
|
|
39
|
+
"StatusResourceWithStreamingResponse",
|
|
40
|
+
"AsyncStatusResourceWithStreamingResponse",
|
|
27
41
|
"V1Resource",
|
|
28
42
|
"AsyncV1Resource",
|
|
29
43
|
"V1ResourceWithRawResponse",
|
|
@@ -49,11 +49,13 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
49
49
|
self,
|
|
50
50
|
*,
|
|
51
51
|
created_at: str,
|
|
52
|
-
name: str,
|
|
53
|
-
scene: str,
|
|
54
|
-
scene_desc: Dict[str, object],
|
|
55
52
|
default_timezone: Optional[str] | Omit = omit,
|
|
53
|
+
description: Optional[str] | Omit = omit,
|
|
56
54
|
group_id: Optional[str] | Omit = omit,
|
|
55
|
+
llm_custom_setting: Optional[conversation_meta_create_params.LlmCustomSetting] | Omit = omit,
|
|
56
|
+
name: Optional[str] | Omit = omit,
|
|
57
|
+
scene: Optional[str] | Omit = omit,
|
|
58
|
+
scene_desc: Optional[Dict[str, object]] | Omit = omit,
|
|
57
59
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
58
60
|
user_details: Optional[Dict[str, conversation_meta_create_params.UserDetails]] | Omit = omit,
|
|
59
61
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -68,6 +70,43 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
68
70
|
etc.
|
|
69
71
|
|
|
70
72
|
Args:
|
|
73
|
+
created_at: Conversation creation time (ISO 8601 format)
|
|
74
|
+
|
|
75
|
+
default_timezone: Default timezone
|
|
76
|
+
|
|
77
|
+
description: Conversation description
|
|
78
|
+
|
|
79
|
+
group_id: Group unique identifier. When null/not provided, represents default settings for
|
|
80
|
+
this scene.
|
|
81
|
+
|
|
82
|
+
llm_custom_setting: LLM custom settings for algorithm control. **Only for global config
|
|
83
|
+
(group_id=null), not allowed for group config (group_id provided).**
|
|
84
|
+
|
|
85
|
+
Allows configuring different LLM providers/models for different tasks like
|
|
86
|
+
boundary detection and memory extraction.
|
|
87
|
+
|
|
88
|
+
name: Group/conversation name. **Required for group config (group_id provided), not
|
|
89
|
+
allowed for global config (group_id=null).**
|
|
90
|
+
|
|
91
|
+
scene: Scene identifier. **Required for global config (group_id=null), not allowed for
|
|
92
|
+
group config (group_id provided).**
|
|
93
|
+
|
|
94
|
+
Enum values from ScenarioType:
|
|
95
|
+
|
|
96
|
+
- group_chat: work/group chat scenario, suitable for group conversations such as
|
|
97
|
+
multi-person collaboration and project discussions
|
|
98
|
+
- assistant: assistant scenario, suitable for one-on-one AI assistant
|
|
99
|
+
conversations
|
|
100
|
+
|
|
101
|
+
scene_desc: Scene description object. **Required for global config (group_id=null), not
|
|
102
|
+
allowed for group config (group_id provided).**
|
|
103
|
+
|
|
104
|
+
Can include fields like description, type, etc.
|
|
105
|
+
|
|
106
|
+
tags: Tag list
|
|
107
|
+
|
|
108
|
+
user_details: Participant details, key is user ID, value is user detail object
|
|
109
|
+
|
|
71
110
|
extra_headers: Send extra headers
|
|
72
111
|
|
|
73
112
|
extra_query: Add additional query parameters to the request
|
|
@@ -81,11 +120,13 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
81
120
|
body=maybe_transform(
|
|
82
121
|
{
|
|
83
122
|
"created_at": created_at,
|
|
123
|
+
"default_timezone": default_timezone,
|
|
124
|
+
"description": description,
|
|
125
|
+
"group_id": group_id,
|
|
126
|
+
"llm_custom_setting": llm_custom_setting,
|
|
84
127
|
"name": name,
|
|
85
128
|
"scene": scene,
|
|
86
129
|
"scene_desc": scene_desc,
|
|
87
|
-
"default_timezone": default_timezone,
|
|
88
|
-
"group_id": group_id,
|
|
89
130
|
"tags": tags,
|
|
90
131
|
"user_details": user_details,
|
|
91
132
|
},
|
|
@@ -101,7 +142,9 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
101
142
|
self,
|
|
102
143
|
*,
|
|
103
144
|
default_timezone: Optional[str] | Omit = omit,
|
|
145
|
+
description: Optional[str] | Omit = omit,
|
|
104
146
|
group_id: Optional[str] | Omit = omit,
|
|
147
|
+
llm_custom_setting: Optional[conversation_meta_update_params.LlmCustomSetting] | Omit = omit,
|
|
105
148
|
name: Optional[str] | Omit = omit,
|
|
106
149
|
scene_desc: Optional[Dict[str, object]] | Omit = omit,
|
|
107
150
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
@@ -117,6 +160,25 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
117
160
|
Partially update conversation metadata, only updating provided fields
|
|
118
161
|
|
|
119
162
|
Args:
|
|
163
|
+
default_timezone: New default timezone
|
|
164
|
+
|
|
165
|
+
description: New description
|
|
166
|
+
|
|
167
|
+
group_id: Group ID to update. When null, updates the global (default) config.
|
|
168
|
+
|
|
169
|
+
llm_custom_setting: New LLM custom settings. **Only allowed for global config (group_id=null). Not
|
|
170
|
+
allowed for group config (inherited from global config).**
|
|
171
|
+
|
|
172
|
+
name: New group/conversation name. **Only allowed for group config (group_id
|
|
173
|
+
provided). Not allowed for global config.**
|
|
174
|
+
|
|
175
|
+
scene_desc: New scene description. **Only allowed for global config (group_id=null). Not
|
|
176
|
+
allowed for group config (inherited from global config).**
|
|
177
|
+
|
|
178
|
+
tags: New tag list
|
|
179
|
+
|
|
180
|
+
user_details: New user details (will completely replace existing user_details)
|
|
181
|
+
|
|
120
182
|
extra_headers: Send extra headers
|
|
121
183
|
|
|
122
184
|
extra_query: Add additional query parameters to the request
|
|
@@ -130,7 +192,9 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
130
192
|
body=maybe_transform(
|
|
131
193
|
{
|
|
132
194
|
"default_timezone": default_timezone,
|
|
195
|
+
"description": description,
|
|
133
196
|
"group_id": group_id,
|
|
197
|
+
"llm_custom_setting": llm_custom_setting,
|
|
134
198
|
"name": name,
|
|
135
199
|
"scene_desc": scene_desc,
|
|
136
200
|
"tags": tags,
|
|
@@ -188,11 +252,13 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
188
252
|
self,
|
|
189
253
|
*,
|
|
190
254
|
created_at: str,
|
|
191
|
-
name: str,
|
|
192
|
-
scene: str,
|
|
193
|
-
scene_desc: Dict[str, object],
|
|
194
255
|
default_timezone: Optional[str] | Omit = omit,
|
|
256
|
+
description: Optional[str] | Omit = omit,
|
|
195
257
|
group_id: Optional[str] | Omit = omit,
|
|
258
|
+
llm_custom_setting: Optional[conversation_meta_create_params.LlmCustomSetting] | Omit = omit,
|
|
259
|
+
name: Optional[str] | Omit = omit,
|
|
260
|
+
scene: Optional[str] | Omit = omit,
|
|
261
|
+
scene_desc: Optional[Dict[str, object]] | Omit = omit,
|
|
196
262
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
197
263
|
user_details: Optional[Dict[str, conversation_meta_create_params.UserDetails]] | Omit = omit,
|
|
198
264
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -207,6 +273,43 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
207
273
|
etc.
|
|
208
274
|
|
|
209
275
|
Args:
|
|
276
|
+
created_at: Conversation creation time (ISO 8601 format)
|
|
277
|
+
|
|
278
|
+
default_timezone: Default timezone
|
|
279
|
+
|
|
280
|
+
description: Conversation description
|
|
281
|
+
|
|
282
|
+
group_id: Group unique identifier. When null/not provided, represents default settings for
|
|
283
|
+
this scene.
|
|
284
|
+
|
|
285
|
+
llm_custom_setting: LLM custom settings for algorithm control. **Only for global config
|
|
286
|
+
(group_id=null), not allowed for group config (group_id provided).**
|
|
287
|
+
|
|
288
|
+
Allows configuring different LLM providers/models for different tasks like
|
|
289
|
+
boundary detection and memory extraction.
|
|
290
|
+
|
|
291
|
+
name: Group/conversation name. **Required for group config (group_id provided), not
|
|
292
|
+
allowed for global config (group_id=null).**
|
|
293
|
+
|
|
294
|
+
scene: Scene identifier. **Required for global config (group_id=null), not allowed for
|
|
295
|
+
group config (group_id provided).**
|
|
296
|
+
|
|
297
|
+
Enum values from ScenarioType:
|
|
298
|
+
|
|
299
|
+
- group_chat: work/group chat scenario, suitable for group conversations such as
|
|
300
|
+
multi-person collaboration and project discussions
|
|
301
|
+
- assistant: assistant scenario, suitable for one-on-one AI assistant
|
|
302
|
+
conversations
|
|
303
|
+
|
|
304
|
+
scene_desc: Scene description object. **Required for global config (group_id=null), not
|
|
305
|
+
allowed for group config (group_id provided).**
|
|
306
|
+
|
|
307
|
+
Can include fields like description, type, etc.
|
|
308
|
+
|
|
309
|
+
tags: Tag list
|
|
310
|
+
|
|
311
|
+
user_details: Participant details, key is user ID, value is user detail object
|
|
312
|
+
|
|
210
313
|
extra_headers: Send extra headers
|
|
211
314
|
|
|
212
315
|
extra_query: Add additional query parameters to the request
|
|
@@ -220,11 +323,13 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
220
323
|
body=await async_maybe_transform(
|
|
221
324
|
{
|
|
222
325
|
"created_at": created_at,
|
|
326
|
+
"default_timezone": default_timezone,
|
|
327
|
+
"description": description,
|
|
328
|
+
"group_id": group_id,
|
|
329
|
+
"llm_custom_setting": llm_custom_setting,
|
|
223
330
|
"name": name,
|
|
224
331
|
"scene": scene,
|
|
225
332
|
"scene_desc": scene_desc,
|
|
226
|
-
"default_timezone": default_timezone,
|
|
227
|
-
"group_id": group_id,
|
|
228
333
|
"tags": tags,
|
|
229
334
|
"user_details": user_details,
|
|
230
335
|
},
|
|
@@ -240,7 +345,9 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
240
345
|
self,
|
|
241
346
|
*,
|
|
242
347
|
default_timezone: Optional[str] | Omit = omit,
|
|
348
|
+
description: Optional[str] | Omit = omit,
|
|
243
349
|
group_id: Optional[str] | Omit = omit,
|
|
350
|
+
llm_custom_setting: Optional[conversation_meta_update_params.LlmCustomSetting] | Omit = omit,
|
|
244
351
|
name: Optional[str] | Omit = omit,
|
|
245
352
|
scene_desc: Optional[Dict[str, object]] | Omit = omit,
|
|
246
353
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
@@ -256,6 +363,25 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
256
363
|
Partially update conversation metadata, only updating provided fields
|
|
257
364
|
|
|
258
365
|
Args:
|
|
366
|
+
default_timezone: New default timezone
|
|
367
|
+
|
|
368
|
+
description: New description
|
|
369
|
+
|
|
370
|
+
group_id: Group ID to update. When null, updates the global (default) config.
|
|
371
|
+
|
|
372
|
+
llm_custom_setting: New LLM custom settings. **Only allowed for global config (group_id=null). Not
|
|
373
|
+
allowed for group config (inherited from global config).**
|
|
374
|
+
|
|
375
|
+
name: New group/conversation name. **Only allowed for group config (group_id
|
|
376
|
+
provided). Not allowed for global config.**
|
|
377
|
+
|
|
378
|
+
scene_desc: New scene description. **Only allowed for global config (group_id=null). Not
|
|
379
|
+
allowed for group config (inherited from global config).**
|
|
380
|
+
|
|
381
|
+
tags: New tag list
|
|
382
|
+
|
|
383
|
+
user_details: New user details (will completely replace existing user_details)
|
|
384
|
+
|
|
259
385
|
extra_headers: Send extra headers
|
|
260
386
|
|
|
261
387
|
extra_query: Add additional query parameters to the request
|
|
@@ -269,7 +395,9 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
269
395
|
body=await async_maybe_transform(
|
|
270
396
|
{
|
|
271
397
|
"default_timezone": default_timezone,
|
|
398
|
+
"description": description,
|
|
272
399
|
"group_id": group_id,
|
|
400
|
+
"llm_custom_setting": llm_custom_setting,
|
|
273
401
|
"name": name,
|
|
274
402
|
"scene_desc": scene_desc,
|
|
275
403
|
"tags": tags,
|