evermemos 0.3.8__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 +13 -13
- evermemos/resources/v1/memories/conversation_meta.py +82 -40
- evermemos/resources/v1/memories/memories.py +133 -228
- evermemos/resources/v1/{stats → status}/__init__.py +13 -13
- evermemos/resources/v1/{stats → status}/request.py +6 -6
- evermemos/resources/v1/{stats/stats.py → status/status.py} +27 -27
- evermemos/resources/v1/v1.py +19 -19
- evermemos/types/v1/__init__.py +2 -4
- evermemos/types/v1/memories/conversation_meta_create_params.py +90 -19
- evermemos/types/v1/memories/conversation_meta_create_response.py +60 -17
- evermemos/types/v1/memories/conversation_meta_get_response.py +60 -17
- evermemos/types/v1/memories/conversation_meta_update_params.py +68 -9
- evermemos/types/v1/memories/conversation_meta_update_response.py +0 -5
- evermemos/types/v1/{memory_create_params.py → memory_add_params.py} +2 -2
- evermemos/types/v1/{memory_create_response.py → memory_add_response.py} +2 -2
- evermemos/types/v1/memory_delete_params.py +6 -0
- evermemos/types/v1/memory_delete_response.py +0 -5
- evermemos/types/v1/memory_get_response.py +7 -10
- evermemos/types/v1/memory_search_response.py +5 -18
- evermemos/types/v1/{stats → status}/request_get_params.py +1 -1
- evermemos/types/v1/{stats → status}/request_get_response.py +0 -5
- {evermemos-0.3.8.dist-info → evermemos-0.3.10.dist-info}/METADATA +24 -27
- {evermemos-0.3.8.dist-info → evermemos-0.3.10.dist-info}/RECORD +30 -32
- evermemos/types/v1/global_user_profile/__init__.py +0 -3
- evermemos/types/v1/memory_load_params.py +0 -83
- evermemos/types/v1/memory_load_response.py +0 -26
- /evermemos/types/v1/{stats → status}/__init__.py +0 -0
- {evermemos-0.3.8.dist-info → evermemos-0.3.10.dist-info}/WHEEL +0 -0
- {evermemos-0.3.8.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,13 +8,13 @@ from .v1 import (
|
|
|
8
8
|
V1ResourceWithStreamingResponse,
|
|
9
9
|
AsyncV1ResourceWithStreamingResponse,
|
|
10
10
|
)
|
|
11
|
-
from .
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
from .status import (
|
|
12
|
+
StatusResource,
|
|
13
|
+
AsyncStatusResource,
|
|
14
|
+
StatusResourceWithRawResponse,
|
|
15
|
+
AsyncStatusResourceWithRawResponse,
|
|
16
|
+
StatusResourceWithStreamingResponse,
|
|
17
|
+
AsyncStatusResourceWithStreamingResponse,
|
|
18
18
|
)
|
|
19
19
|
from .memories import (
|
|
20
20
|
MemoriesResource,
|
|
@@ -32,12 +32,12 @@ __all__ = [
|
|
|
32
32
|
"AsyncMemoriesResourceWithRawResponse",
|
|
33
33
|
"MemoriesResourceWithStreamingResponse",
|
|
34
34
|
"AsyncMemoriesResourceWithStreamingResponse",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
35
|
+
"StatusResource",
|
|
36
|
+
"AsyncStatusResource",
|
|
37
|
+
"StatusResourceWithRawResponse",
|
|
38
|
+
"AsyncStatusResourceWithRawResponse",
|
|
39
|
+
"StatusResourceWithStreamingResponse",
|
|
40
|
+
"AsyncStatusResourceWithStreamingResponse",
|
|
41
41
|
"V1Resource",
|
|
42
42
|
"AsyncV1Resource",
|
|
43
43
|
"V1ResourceWithRawResponse",
|
|
@@ -49,12 +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,
|
|
56
53
|
description: Optional[str] | Omit = omit,
|
|
57
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,
|
|
58
59
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
59
60
|
user_details: Optional[Dict[str, conversation_meta_create_params.UserDetails]] | Omit = omit,
|
|
60
61
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -71,24 +72,36 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
71
72
|
Args:
|
|
72
73
|
created_at: Conversation creation time (ISO 8601 format)
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
default_timezone: Default timezone
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
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:
|
|
78
95
|
|
|
79
96
|
- group_chat: work/group chat scenario, suitable for group conversations such as
|
|
80
97
|
multi-person collaboration and project discussions
|
|
81
98
|
- assistant: assistant scenario, suitable for one-on-one AI assistant
|
|
82
99
|
conversations
|
|
83
100
|
|
|
84
|
-
scene_desc: Scene description object
|
|
101
|
+
scene_desc: Scene description object. **Required for global config (group_id=null), not
|
|
102
|
+
allowed for group config (group_id provided).**
|
|
85
103
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
description: Conversation description
|
|
89
|
-
|
|
90
|
-
group_id: Group unique identifier. When null/not provided, represents default settings for
|
|
91
|
-
this scene.
|
|
104
|
+
Can include fields like description, type, etc.
|
|
92
105
|
|
|
93
106
|
tags: Tag list
|
|
94
107
|
|
|
@@ -107,12 +120,13 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
107
120
|
body=maybe_transform(
|
|
108
121
|
{
|
|
109
122
|
"created_at": created_at,
|
|
110
|
-
"name": name,
|
|
111
|
-
"scene": scene,
|
|
112
|
-
"scene_desc": scene_desc,
|
|
113
123
|
"default_timezone": default_timezone,
|
|
114
124
|
"description": description,
|
|
115
125
|
"group_id": group_id,
|
|
126
|
+
"llm_custom_setting": llm_custom_setting,
|
|
127
|
+
"name": name,
|
|
128
|
+
"scene": scene,
|
|
129
|
+
"scene_desc": scene_desc,
|
|
116
130
|
"tags": tags,
|
|
117
131
|
"user_details": user_details,
|
|
118
132
|
},
|
|
@@ -130,6 +144,7 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
130
144
|
default_timezone: Optional[str] | Omit = omit,
|
|
131
145
|
description: Optional[str] | Omit = omit,
|
|
132
146
|
group_id: Optional[str] | Omit = omit,
|
|
147
|
+
llm_custom_setting: Optional[conversation_meta_update_params.LlmCustomSetting] | Omit = omit,
|
|
133
148
|
name: Optional[str] | Omit = omit,
|
|
134
149
|
scene_desc: Optional[Dict[str, object]] | Omit = omit,
|
|
135
150
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
@@ -147,13 +162,18 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
147
162
|
Args:
|
|
148
163
|
default_timezone: New default timezone
|
|
149
164
|
|
|
150
|
-
description: New
|
|
165
|
+
description: New description
|
|
166
|
+
|
|
167
|
+
group_id: Group ID to update. When null, updates the global (default) config.
|
|
151
168
|
|
|
152
|
-
|
|
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).**
|
|
153
171
|
|
|
154
|
-
name: New conversation name
|
|
172
|
+
name: New group/conversation name. **Only allowed for group config (group_id
|
|
173
|
+
provided). Not allowed for global config.**
|
|
155
174
|
|
|
156
|
-
scene_desc: New scene description
|
|
175
|
+
scene_desc: New scene description. **Only allowed for global config (group_id=null). Not
|
|
176
|
+
allowed for group config (inherited from global config).**
|
|
157
177
|
|
|
158
178
|
tags: New tag list
|
|
159
179
|
|
|
@@ -174,6 +194,7 @@ class ConversationMetaResource(SyncAPIResource):
|
|
|
174
194
|
"default_timezone": default_timezone,
|
|
175
195
|
"description": description,
|
|
176
196
|
"group_id": group_id,
|
|
197
|
+
"llm_custom_setting": llm_custom_setting,
|
|
177
198
|
"name": name,
|
|
178
199
|
"scene_desc": scene_desc,
|
|
179
200
|
"tags": tags,
|
|
@@ -231,12 +252,13 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
231
252
|
self,
|
|
232
253
|
*,
|
|
233
254
|
created_at: str,
|
|
234
|
-
name: str,
|
|
235
|
-
scene: str,
|
|
236
|
-
scene_desc: Dict[str, object],
|
|
237
255
|
default_timezone: Optional[str] | Omit = omit,
|
|
238
256
|
description: Optional[str] | Omit = omit,
|
|
239
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,
|
|
240
262
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
241
263
|
user_details: Optional[Dict[str, conversation_meta_create_params.UserDetails]] | Omit = omit,
|
|
242
264
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -253,24 +275,36 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
253
275
|
Args:
|
|
254
276
|
created_at: Conversation creation time (ISO 8601 format)
|
|
255
277
|
|
|
256
|
-
|
|
278
|
+
default_timezone: Default timezone
|
|
257
279
|
|
|
258
|
-
|
|
259
|
-
|
|
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:
|
|
260
298
|
|
|
261
299
|
- group_chat: work/group chat scenario, suitable for group conversations such as
|
|
262
300
|
multi-person collaboration and project discussions
|
|
263
301
|
- assistant: assistant scenario, suitable for one-on-one AI assistant
|
|
264
302
|
conversations
|
|
265
303
|
|
|
266
|
-
scene_desc: Scene description object
|
|
304
|
+
scene_desc: Scene description object. **Required for global config (group_id=null), not
|
|
305
|
+
allowed for group config (group_id provided).**
|
|
267
306
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
description: Conversation description
|
|
271
|
-
|
|
272
|
-
group_id: Group unique identifier. When null/not provided, represents default settings for
|
|
273
|
-
this scene.
|
|
307
|
+
Can include fields like description, type, etc.
|
|
274
308
|
|
|
275
309
|
tags: Tag list
|
|
276
310
|
|
|
@@ -289,12 +323,13 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
289
323
|
body=await async_maybe_transform(
|
|
290
324
|
{
|
|
291
325
|
"created_at": created_at,
|
|
292
|
-
"name": name,
|
|
293
|
-
"scene": scene,
|
|
294
|
-
"scene_desc": scene_desc,
|
|
295
326
|
"default_timezone": default_timezone,
|
|
296
327
|
"description": description,
|
|
297
328
|
"group_id": group_id,
|
|
329
|
+
"llm_custom_setting": llm_custom_setting,
|
|
330
|
+
"name": name,
|
|
331
|
+
"scene": scene,
|
|
332
|
+
"scene_desc": scene_desc,
|
|
298
333
|
"tags": tags,
|
|
299
334
|
"user_details": user_details,
|
|
300
335
|
},
|
|
@@ -312,6 +347,7 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
312
347
|
default_timezone: Optional[str] | Omit = omit,
|
|
313
348
|
description: Optional[str] | Omit = omit,
|
|
314
349
|
group_id: Optional[str] | Omit = omit,
|
|
350
|
+
llm_custom_setting: Optional[conversation_meta_update_params.LlmCustomSetting] | Omit = omit,
|
|
315
351
|
name: Optional[str] | Omit = omit,
|
|
316
352
|
scene_desc: Optional[Dict[str, object]] | Omit = omit,
|
|
317
353
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
@@ -329,13 +365,18 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
329
365
|
Args:
|
|
330
366
|
default_timezone: New default timezone
|
|
331
367
|
|
|
332
|
-
description: New
|
|
368
|
+
description: New description
|
|
369
|
+
|
|
370
|
+
group_id: Group ID to update. When null, updates the global (default) config.
|
|
333
371
|
|
|
334
|
-
|
|
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).**
|
|
335
374
|
|
|
336
|
-
name: New conversation name
|
|
375
|
+
name: New group/conversation name. **Only allowed for group config (group_id
|
|
376
|
+
provided). Not allowed for global config.**
|
|
337
377
|
|
|
338
|
-
scene_desc: New scene description
|
|
378
|
+
scene_desc: New scene description. **Only allowed for global config (group_id=null). Not
|
|
379
|
+
allowed for group config (inherited from global config).**
|
|
339
380
|
|
|
340
381
|
tags: New tag list
|
|
341
382
|
|
|
@@ -356,6 +397,7 @@ class AsyncConversationMetaResource(AsyncAPIResource):
|
|
|
356
397
|
"default_timezone": default_timezone,
|
|
357
398
|
"description": description,
|
|
358
399
|
"group_id": group_id,
|
|
400
|
+
"llm_custom_setting": llm_custom_setting,
|
|
359
401
|
"name": name,
|
|
360
402
|
"scene_desc": scene_desc,
|
|
361
403
|
"tags": tags,
|