letta-client 0.1.292__py3-none-any.whl → 0.1.294__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.
Potentially problematic release.
This version of letta-client might be problematic. Click here for more details.
- letta_client/agents/passages/client.py +39 -178
- letta_client/agents/passages/raw_client.py +38 -218
- letta_client/core/client_wrapper.py +2 -2
- {letta_client-0.1.292.dist-info → letta_client-0.1.294.dist-info}/METADATA +1 -1
- {letta_client-0.1.292.dist-info → letta_client-0.1.294.dist-info}/RECORD +6 -6
- {letta_client-0.1.292.dist-info → letta_client-0.1.294.dist-info}/WHEEL +0 -0
|
@@ -5,7 +5,6 @@ import typing
|
|
|
5
5
|
|
|
6
6
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
7
|
from ...core.request_options import RequestOptions
|
|
8
|
-
from ...types.embedding_config import EmbeddingConfig
|
|
9
8
|
from ...types.passage import Passage
|
|
10
9
|
from .raw_client import AsyncRawPassagesClient, RawPassagesClient
|
|
11
10
|
|
|
@@ -93,7 +92,13 @@ class PassagesClient:
|
|
|
93
92
|
return _response.data
|
|
94
93
|
|
|
95
94
|
def create(
|
|
96
|
-
self,
|
|
95
|
+
self,
|
|
96
|
+
agent_id: str,
|
|
97
|
+
*,
|
|
98
|
+
text: str,
|
|
99
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
100
|
+
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
101
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
97
102
|
) -> typing.List[Passage]:
|
|
98
103
|
"""
|
|
99
104
|
Insert a memory into an agent's archival memory store.
|
|
@@ -105,6 +110,12 @@ class PassagesClient:
|
|
|
105
110
|
text : str
|
|
106
111
|
Text to write to archival memory.
|
|
107
112
|
|
|
113
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
114
|
+
Optional list of tags to attach to the memory.
|
|
115
|
+
|
|
116
|
+
created_at : typing.Optional[dt.datetime]
|
|
117
|
+
Optional timestamp for the memory (defaults to current UTC time).
|
|
118
|
+
|
|
108
119
|
request_options : typing.Optional[RequestOptions]
|
|
109
120
|
Request-specific configuration.
|
|
110
121
|
|
|
@@ -126,7 +137,9 @@ class PassagesClient:
|
|
|
126
137
|
text="text",
|
|
127
138
|
)
|
|
128
139
|
"""
|
|
129
|
-
_response = self._raw_client.create(
|
|
140
|
+
_response = self._raw_client.create(
|
|
141
|
+
agent_id, text=text, tags=tags, created_at=created_at, request_options=request_options
|
|
142
|
+
)
|
|
130
143
|
return _response.data
|
|
131
144
|
|
|
132
145
|
def delete(
|
|
@@ -165,85 +178,20 @@ class PassagesClient:
|
|
|
165
178
|
_response = self._raw_client.delete(agent_id, memory_id, request_options=request_options)
|
|
166
179
|
return _response.data
|
|
167
180
|
|
|
168
|
-
def modify(
|
|
169
|
-
self,
|
|
170
|
-
agent_id: str,
|
|
171
|
-
memory_id: str,
|
|
172
|
-
*,
|
|
173
|
-
id: str,
|
|
174
|
-
created_by_id: typing.Optional[str] = OMIT,
|
|
175
|
-
last_updated_by_id: typing.Optional[str] = OMIT,
|
|
176
|
-
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
177
|
-
updated_at: typing.Optional[dt.datetime] = OMIT,
|
|
178
|
-
is_deleted: typing.Optional[bool] = OMIT,
|
|
179
|
-
archive_id: typing.Optional[str] = OMIT,
|
|
180
|
-
source_id: typing.Optional[str] = OMIT,
|
|
181
|
-
file_id: typing.Optional[str] = OMIT,
|
|
182
|
-
file_name: typing.Optional[str] = OMIT,
|
|
183
|
-
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
184
|
-
text: typing.Optional[str] = OMIT,
|
|
185
|
-
embedding: typing.Optional[typing.Sequence[float]] = OMIT,
|
|
186
|
-
embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
|
|
187
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
188
|
-
) -> typing.List[Passage]:
|
|
181
|
+
def modify(self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
189
182
|
"""
|
|
190
|
-
Modify a memory in the agent's archival memory store.
|
|
191
|
-
|
|
192
183
|
Parameters
|
|
193
184
|
----------
|
|
194
185
|
agent_id : str
|
|
195
186
|
|
|
196
187
|
memory_id : str
|
|
197
188
|
|
|
198
|
-
id : str
|
|
199
|
-
The unique identifier of the passage.
|
|
200
|
-
|
|
201
|
-
created_by_id : typing.Optional[str]
|
|
202
|
-
The id of the user that made this object.
|
|
203
|
-
|
|
204
|
-
last_updated_by_id : typing.Optional[str]
|
|
205
|
-
The id of the user that made this object.
|
|
206
|
-
|
|
207
|
-
created_at : typing.Optional[dt.datetime]
|
|
208
|
-
The timestamp when the object was created.
|
|
209
|
-
|
|
210
|
-
updated_at : typing.Optional[dt.datetime]
|
|
211
|
-
The timestamp when the object was last updated.
|
|
212
|
-
|
|
213
|
-
is_deleted : typing.Optional[bool]
|
|
214
|
-
Whether this passage is deleted or not.
|
|
215
|
-
|
|
216
|
-
archive_id : typing.Optional[str]
|
|
217
|
-
The unique identifier of the archive containing this passage.
|
|
218
|
-
|
|
219
|
-
source_id : typing.Optional[str]
|
|
220
|
-
The data source of the passage.
|
|
221
|
-
|
|
222
|
-
file_id : typing.Optional[str]
|
|
223
|
-
The unique identifier of the file associated with the passage.
|
|
224
|
-
|
|
225
|
-
file_name : typing.Optional[str]
|
|
226
|
-
The name of the file (only for source passages).
|
|
227
|
-
|
|
228
|
-
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
229
|
-
The metadata of the passage.
|
|
230
|
-
|
|
231
|
-
text : typing.Optional[str]
|
|
232
|
-
The text of the passage.
|
|
233
|
-
|
|
234
|
-
embedding : typing.Optional[typing.Sequence[float]]
|
|
235
|
-
The embedding of the passage.
|
|
236
|
-
|
|
237
|
-
embedding_config : typing.Optional[EmbeddingConfig]
|
|
238
|
-
The embedding configuration used by the passage.
|
|
239
|
-
|
|
240
189
|
request_options : typing.Optional[RequestOptions]
|
|
241
190
|
Request-specific configuration.
|
|
242
191
|
|
|
243
192
|
Returns
|
|
244
193
|
-------
|
|
245
|
-
|
|
246
|
-
Successful Response
|
|
194
|
+
None
|
|
247
195
|
|
|
248
196
|
Examples
|
|
249
197
|
--------
|
|
@@ -256,28 +204,9 @@ class PassagesClient:
|
|
|
256
204
|
client.agents.passages.modify(
|
|
257
205
|
agent_id="agent_id",
|
|
258
206
|
memory_id="memory_id",
|
|
259
|
-
id="id",
|
|
260
207
|
)
|
|
261
208
|
"""
|
|
262
|
-
_response = self._raw_client.modify(
|
|
263
|
-
agent_id,
|
|
264
|
-
memory_id,
|
|
265
|
-
id=id,
|
|
266
|
-
created_by_id=created_by_id,
|
|
267
|
-
last_updated_by_id=last_updated_by_id,
|
|
268
|
-
created_at=created_at,
|
|
269
|
-
updated_at=updated_at,
|
|
270
|
-
is_deleted=is_deleted,
|
|
271
|
-
archive_id=archive_id,
|
|
272
|
-
source_id=source_id,
|
|
273
|
-
file_id=file_id,
|
|
274
|
-
file_name=file_name,
|
|
275
|
-
metadata=metadata,
|
|
276
|
-
text=text,
|
|
277
|
-
embedding=embedding,
|
|
278
|
-
embedding_config=embedding_config,
|
|
279
|
-
request_options=request_options,
|
|
280
|
-
)
|
|
209
|
+
_response = self._raw_client.modify(agent_id, memory_id, request_options=request_options)
|
|
281
210
|
return _response.data
|
|
282
211
|
|
|
283
212
|
|
|
@@ -369,7 +298,13 @@ class AsyncPassagesClient:
|
|
|
369
298
|
return _response.data
|
|
370
299
|
|
|
371
300
|
async def create(
|
|
372
|
-
self,
|
|
301
|
+
self,
|
|
302
|
+
agent_id: str,
|
|
303
|
+
*,
|
|
304
|
+
text: str,
|
|
305
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
306
|
+
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
307
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
373
308
|
) -> typing.List[Passage]:
|
|
374
309
|
"""
|
|
375
310
|
Insert a memory into an agent's archival memory store.
|
|
@@ -381,6 +316,12 @@ class AsyncPassagesClient:
|
|
|
381
316
|
text : str
|
|
382
317
|
Text to write to archival memory.
|
|
383
318
|
|
|
319
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
320
|
+
Optional list of tags to attach to the memory.
|
|
321
|
+
|
|
322
|
+
created_at : typing.Optional[dt.datetime]
|
|
323
|
+
Optional timestamp for the memory (defaults to current UTC time).
|
|
324
|
+
|
|
384
325
|
request_options : typing.Optional[RequestOptions]
|
|
385
326
|
Request-specific configuration.
|
|
386
327
|
|
|
@@ -410,7 +351,9 @@ class AsyncPassagesClient:
|
|
|
410
351
|
|
|
411
352
|
asyncio.run(main())
|
|
412
353
|
"""
|
|
413
|
-
_response = await self._raw_client.create(
|
|
354
|
+
_response = await self._raw_client.create(
|
|
355
|
+
agent_id, text=text, tags=tags, created_at=created_at, request_options=request_options
|
|
356
|
+
)
|
|
414
357
|
return _response.data
|
|
415
358
|
|
|
416
359
|
async def delete(
|
|
@@ -458,84 +401,21 @@ class AsyncPassagesClient:
|
|
|
458
401
|
return _response.data
|
|
459
402
|
|
|
460
403
|
async def modify(
|
|
461
|
-
self,
|
|
462
|
-
|
|
463
|
-
memory_id: str,
|
|
464
|
-
*,
|
|
465
|
-
id: str,
|
|
466
|
-
created_by_id: typing.Optional[str] = OMIT,
|
|
467
|
-
last_updated_by_id: typing.Optional[str] = OMIT,
|
|
468
|
-
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
469
|
-
updated_at: typing.Optional[dt.datetime] = OMIT,
|
|
470
|
-
is_deleted: typing.Optional[bool] = OMIT,
|
|
471
|
-
archive_id: typing.Optional[str] = OMIT,
|
|
472
|
-
source_id: typing.Optional[str] = OMIT,
|
|
473
|
-
file_id: typing.Optional[str] = OMIT,
|
|
474
|
-
file_name: typing.Optional[str] = OMIT,
|
|
475
|
-
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
476
|
-
text: typing.Optional[str] = OMIT,
|
|
477
|
-
embedding: typing.Optional[typing.Sequence[float]] = OMIT,
|
|
478
|
-
embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
|
|
479
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
480
|
-
) -> typing.List[Passage]:
|
|
404
|
+
self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
405
|
+
) -> None:
|
|
481
406
|
"""
|
|
482
|
-
Modify a memory in the agent's archival memory store.
|
|
483
|
-
|
|
484
407
|
Parameters
|
|
485
408
|
----------
|
|
486
409
|
agent_id : str
|
|
487
410
|
|
|
488
411
|
memory_id : str
|
|
489
412
|
|
|
490
|
-
id : str
|
|
491
|
-
The unique identifier of the passage.
|
|
492
|
-
|
|
493
|
-
created_by_id : typing.Optional[str]
|
|
494
|
-
The id of the user that made this object.
|
|
495
|
-
|
|
496
|
-
last_updated_by_id : typing.Optional[str]
|
|
497
|
-
The id of the user that made this object.
|
|
498
|
-
|
|
499
|
-
created_at : typing.Optional[dt.datetime]
|
|
500
|
-
The timestamp when the object was created.
|
|
501
|
-
|
|
502
|
-
updated_at : typing.Optional[dt.datetime]
|
|
503
|
-
The timestamp when the object was last updated.
|
|
504
|
-
|
|
505
|
-
is_deleted : typing.Optional[bool]
|
|
506
|
-
Whether this passage is deleted or not.
|
|
507
|
-
|
|
508
|
-
archive_id : typing.Optional[str]
|
|
509
|
-
The unique identifier of the archive containing this passage.
|
|
510
|
-
|
|
511
|
-
source_id : typing.Optional[str]
|
|
512
|
-
The data source of the passage.
|
|
513
|
-
|
|
514
|
-
file_id : typing.Optional[str]
|
|
515
|
-
The unique identifier of the file associated with the passage.
|
|
516
|
-
|
|
517
|
-
file_name : typing.Optional[str]
|
|
518
|
-
The name of the file (only for source passages).
|
|
519
|
-
|
|
520
|
-
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
521
|
-
The metadata of the passage.
|
|
522
|
-
|
|
523
|
-
text : typing.Optional[str]
|
|
524
|
-
The text of the passage.
|
|
525
|
-
|
|
526
|
-
embedding : typing.Optional[typing.Sequence[float]]
|
|
527
|
-
The embedding of the passage.
|
|
528
|
-
|
|
529
|
-
embedding_config : typing.Optional[EmbeddingConfig]
|
|
530
|
-
The embedding configuration used by the passage.
|
|
531
|
-
|
|
532
413
|
request_options : typing.Optional[RequestOptions]
|
|
533
414
|
Request-specific configuration.
|
|
534
415
|
|
|
535
416
|
Returns
|
|
536
417
|
-------
|
|
537
|
-
|
|
538
|
-
Successful Response
|
|
418
|
+
None
|
|
539
419
|
|
|
540
420
|
Examples
|
|
541
421
|
--------
|
|
@@ -553,29 +433,10 @@ class AsyncPassagesClient:
|
|
|
553
433
|
await client.agents.passages.modify(
|
|
554
434
|
agent_id="agent_id",
|
|
555
435
|
memory_id="memory_id",
|
|
556
|
-
id="id",
|
|
557
436
|
)
|
|
558
437
|
|
|
559
438
|
|
|
560
439
|
asyncio.run(main())
|
|
561
440
|
"""
|
|
562
|
-
_response = await self._raw_client.modify(
|
|
563
|
-
agent_id,
|
|
564
|
-
memory_id,
|
|
565
|
-
id=id,
|
|
566
|
-
created_by_id=created_by_id,
|
|
567
|
-
last_updated_by_id=last_updated_by_id,
|
|
568
|
-
created_at=created_at,
|
|
569
|
-
updated_at=updated_at,
|
|
570
|
-
is_deleted=is_deleted,
|
|
571
|
-
archive_id=archive_id,
|
|
572
|
-
source_id=source_id,
|
|
573
|
-
file_id=file_id,
|
|
574
|
-
file_name=file_name,
|
|
575
|
-
metadata=metadata,
|
|
576
|
-
text=text,
|
|
577
|
-
embedding=embedding,
|
|
578
|
-
embedding_config=embedding_config,
|
|
579
|
-
request_options=request_options,
|
|
580
|
-
)
|
|
441
|
+
_response = await self._raw_client.modify(agent_id, memory_id, request_options=request_options)
|
|
581
442
|
return _response.data
|
|
@@ -9,10 +9,8 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
9
9
|
from ...core.http_response import AsyncHttpResponse, HttpResponse
|
|
10
10
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
11
11
|
from ...core.request_options import RequestOptions
|
|
12
|
-
from ...core.serialization import convert_and_respect_annotation_metadata
|
|
13
12
|
from ...core.unchecked_base_model import construct_type
|
|
14
13
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
15
|
-
from ...types.embedding_config import EmbeddingConfig
|
|
16
14
|
from ...types.http_validation_error import HttpValidationError
|
|
17
15
|
from ...types.passage import Passage
|
|
18
16
|
|
|
@@ -104,7 +102,13 @@ class RawPassagesClient:
|
|
|
104
102
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
105
103
|
|
|
106
104
|
def create(
|
|
107
|
-
self,
|
|
105
|
+
self,
|
|
106
|
+
agent_id: str,
|
|
107
|
+
*,
|
|
108
|
+
text: str,
|
|
109
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
110
|
+
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
111
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
108
112
|
) -> HttpResponse[typing.List[Passage]]:
|
|
109
113
|
"""
|
|
110
114
|
Insert a memory into an agent's archival memory store.
|
|
@@ -116,6 +120,12 @@ class RawPassagesClient:
|
|
|
116
120
|
text : str
|
|
117
121
|
Text to write to archival memory.
|
|
118
122
|
|
|
123
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
124
|
+
Optional list of tags to attach to the memory.
|
|
125
|
+
|
|
126
|
+
created_at : typing.Optional[dt.datetime]
|
|
127
|
+
Optional timestamp for the memory (defaults to current UTC time).
|
|
128
|
+
|
|
119
129
|
request_options : typing.Optional[RequestOptions]
|
|
120
130
|
Request-specific configuration.
|
|
121
131
|
|
|
@@ -129,6 +139,8 @@ class RawPassagesClient:
|
|
|
129
139
|
method="POST",
|
|
130
140
|
json={
|
|
131
141
|
"text": text,
|
|
142
|
+
"tags": tags,
|
|
143
|
+
"created_at": created_at,
|
|
132
144
|
},
|
|
133
145
|
headers={
|
|
134
146
|
"content-type": "application/json",
|
|
@@ -216,133 +228,30 @@ class RawPassagesClient:
|
|
|
216
228
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
217
229
|
|
|
218
230
|
def modify(
|
|
219
|
-
self,
|
|
220
|
-
|
|
221
|
-
memory_id: str,
|
|
222
|
-
*,
|
|
223
|
-
id: str,
|
|
224
|
-
created_by_id: typing.Optional[str] = OMIT,
|
|
225
|
-
last_updated_by_id: typing.Optional[str] = OMIT,
|
|
226
|
-
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
227
|
-
updated_at: typing.Optional[dt.datetime] = OMIT,
|
|
228
|
-
is_deleted: typing.Optional[bool] = OMIT,
|
|
229
|
-
archive_id: typing.Optional[str] = OMIT,
|
|
230
|
-
source_id: typing.Optional[str] = OMIT,
|
|
231
|
-
file_id: typing.Optional[str] = OMIT,
|
|
232
|
-
file_name: typing.Optional[str] = OMIT,
|
|
233
|
-
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
234
|
-
text: typing.Optional[str] = OMIT,
|
|
235
|
-
embedding: typing.Optional[typing.Sequence[float]] = OMIT,
|
|
236
|
-
embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
|
|
237
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
238
|
-
) -> HttpResponse[typing.List[Passage]]:
|
|
231
|
+
self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
232
|
+
) -> HttpResponse[None]:
|
|
239
233
|
"""
|
|
240
|
-
Modify a memory in the agent's archival memory store.
|
|
241
|
-
|
|
242
234
|
Parameters
|
|
243
235
|
----------
|
|
244
236
|
agent_id : str
|
|
245
237
|
|
|
246
238
|
memory_id : str
|
|
247
239
|
|
|
248
|
-
id : str
|
|
249
|
-
The unique identifier of the passage.
|
|
250
|
-
|
|
251
|
-
created_by_id : typing.Optional[str]
|
|
252
|
-
The id of the user that made this object.
|
|
253
|
-
|
|
254
|
-
last_updated_by_id : typing.Optional[str]
|
|
255
|
-
The id of the user that made this object.
|
|
256
|
-
|
|
257
|
-
created_at : typing.Optional[dt.datetime]
|
|
258
|
-
The timestamp when the object was created.
|
|
259
|
-
|
|
260
|
-
updated_at : typing.Optional[dt.datetime]
|
|
261
|
-
The timestamp when the object was last updated.
|
|
262
|
-
|
|
263
|
-
is_deleted : typing.Optional[bool]
|
|
264
|
-
Whether this passage is deleted or not.
|
|
265
|
-
|
|
266
|
-
archive_id : typing.Optional[str]
|
|
267
|
-
The unique identifier of the archive containing this passage.
|
|
268
|
-
|
|
269
|
-
source_id : typing.Optional[str]
|
|
270
|
-
The data source of the passage.
|
|
271
|
-
|
|
272
|
-
file_id : typing.Optional[str]
|
|
273
|
-
The unique identifier of the file associated with the passage.
|
|
274
|
-
|
|
275
|
-
file_name : typing.Optional[str]
|
|
276
|
-
The name of the file (only for source passages).
|
|
277
|
-
|
|
278
|
-
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
279
|
-
The metadata of the passage.
|
|
280
|
-
|
|
281
|
-
text : typing.Optional[str]
|
|
282
|
-
The text of the passage.
|
|
283
|
-
|
|
284
|
-
embedding : typing.Optional[typing.Sequence[float]]
|
|
285
|
-
The embedding of the passage.
|
|
286
|
-
|
|
287
|
-
embedding_config : typing.Optional[EmbeddingConfig]
|
|
288
|
-
The embedding configuration used by the passage.
|
|
289
|
-
|
|
290
240
|
request_options : typing.Optional[RequestOptions]
|
|
291
241
|
Request-specific configuration.
|
|
292
242
|
|
|
293
243
|
Returns
|
|
294
244
|
-------
|
|
295
|
-
HttpResponse[
|
|
296
|
-
Successful Response
|
|
245
|
+
HttpResponse[None]
|
|
297
246
|
"""
|
|
298
247
|
_response = self._client_wrapper.httpx_client.request(
|
|
299
248
|
f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory/{jsonable_encoder(memory_id)}",
|
|
300
249
|
method="PATCH",
|
|
301
|
-
json={
|
|
302
|
-
"created_by_id": created_by_id,
|
|
303
|
-
"last_updated_by_id": last_updated_by_id,
|
|
304
|
-
"created_at": created_at,
|
|
305
|
-
"updated_at": updated_at,
|
|
306
|
-
"is_deleted": is_deleted,
|
|
307
|
-
"archive_id": archive_id,
|
|
308
|
-
"source_id": source_id,
|
|
309
|
-
"file_id": file_id,
|
|
310
|
-
"file_name": file_name,
|
|
311
|
-
"metadata_": metadata,
|
|
312
|
-
"text": text,
|
|
313
|
-
"embedding": embedding,
|
|
314
|
-
"embedding_config": convert_and_respect_annotation_metadata(
|
|
315
|
-
object_=embedding_config, annotation=EmbeddingConfig, direction="write"
|
|
316
|
-
),
|
|
317
|
-
"id": id,
|
|
318
|
-
},
|
|
319
|
-
headers={
|
|
320
|
-
"content-type": "application/json",
|
|
321
|
-
},
|
|
322
250
|
request_options=request_options,
|
|
323
|
-
omit=OMIT,
|
|
324
251
|
)
|
|
325
252
|
try:
|
|
326
253
|
if 200 <= _response.status_code < 300:
|
|
327
|
-
|
|
328
|
-
typing.List[Passage],
|
|
329
|
-
construct_type(
|
|
330
|
-
type_=typing.List[Passage], # type: ignore
|
|
331
|
-
object_=_response.json(),
|
|
332
|
-
),
|
|
333
|
-
)
|
|
334
|
-
return HttpResponse(response=_response, data=_data)
|
|
335
|
-
if _response.status_code == 422:
|
|
336
|
-
raise UnprocessableEntityError(
|
|
337
|
-
headers=dict(_response.headers),
|
|
338
|
-
body=typing.cast(
|
|
339
|
-
HttpValidationError,
|
|
340
|
-
construct_type(
|
|
341
|
-
type_=HttpValidationError, # type: ignore
|
|
342
|
-
object_=_response.json(),
|
|
343
|
-
),
|
|
344
|
-
),
|
|
345
|
-
)
|
|
254
|
+
return HttpResponse(response=_response, data=None)
|
|
346
255
|
_response_json = _response.json()
|
|
347
256
|
except JSONDecodeError:
|
|
348
257
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -433,7 +342,13 @@ class AsyncRawPassagesClient:
|
|
|
433
342
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
434
343
|
|
|
435
344
|
async def create(
|
|
436
|
-
self,
|
|
345
|
+
self,
|
|
346
|
+
agent_id: str,
|
|
347
|
+
*,
|
|
348
|
+
text: str,
|
|
349
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
350
|
+
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
351
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
437
352
|
) -> AsyncHttpResponse[typing.List[Passage]]:
|
|
438
353
|
"""
|
|
439
354
|
Insert a memory into an agent's archival memory store.
|
|
@@ -445,6 +360,12 @@ class AsyncRawPassagesClient:
|
|
|
445
360
|
text : str
|
|
446
361
|
Text to write to archival memory.
|
|
447
362
|
|
|
363
|
+
tags : typing.Optional[typing.Sequence[str]]
|
|
364
|
+
Optional list of tags to attach to the memory.
|
|
365
|
+
|
|
366
|
+
created_at : typing.Optional[dt.datetime]
|
|
367
|
+
Optional timestamp for the memory (defaults to current UTC time).
|
|
368
|
+
|
|
448
369
|
request_options : typing.Optional[RequestOptions]
|
|
449
370
|
Request-specific configuration.
|
|
450
371
|
|
|
@@ -458,6 +379,8 @@ class AsyncRawPassagesClient:
|
|
|
458
379
|
method="POST",
|
|
459
380
|
json={
|
|
460
381
|
"text": text,
|
|
382
|
+
"tags": tags,
|
|
383
|
+
"created_at": created_at,
|
|
461
384
|
},
|
|
462
385
|
headers={
|
|
463
386
|
"content-type": "application/json",
|
|
@@ -545,133 +468,30 @@ class AsyncRawPassagesClient:
|
|
|
545
468
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
546
469
|
|
|
547
470
|
async def modify(
|
|
548
|
-
self,
|
|
549
|
-
|
|
550
|
-
memory_id: str,
|
|
551
|
-
*,
|
|
552
|
-
id: str,
|
|
553
|
-
created_by_id: typing.Optional[str] = OMIT,
|
|
554
|
-
last_updated_by_id: typing.Optional[str] = OMIT,
|
|
555
|
-
created_at: typing.Optional[dt.datetime] = OMIT,
|
|
556
|
-
updated_at: typing.Optional[dt.datetime] = OMIT,
|
|
557
|
-
is_deleted: typing.Optional[bool] = OMIT,
|
|
558
|
-
archive_id: typing.Optional[str] = OMIT,
|
|
559
|
-
source_id: typing.Optional[str] = OMIT,
|
|
560
|
-
file_id: typing.Optional[str] = OMIT,
|
|
561
|
-
file_name: typing.Optional[str] = OMIT,
|
|
562
|
-
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
563
|
-
text: typing.Optional[str] = OMIT,
|
|
564
|
-
embedding: typing.Optional[typing.Sequence[float]] = OMIT,
|
|
565
|
-
embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
|
|
566
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
567
|
-
) -> AsyncHttpResponse[typing.List[Passage]]:
|
|
471
|
+
self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
472
|
+
) -> AsyncHttpResponse[None]:
|
|
568
473
|
"""
|
|
569
|
-
Modify a memory in the agent's archival memory store.
|
|
570
|
-
|
|
571
474
|
Parameters
|
|
572
475
|
----------
|
|
573
476
|
agent_id : str
|
|
574
477
|
|
|
575
478
|
memory_id : str
|
|
576
479
|
|
|
577
|
-
id : str
|
|
578
|
-
The unique identifier of the passage.
|
|
579
|
-
|
|
580
|
-
created_by_id : typing.Optional[str]
|
|
581
|
-
The id of the user that made this object.
|
|
582
|
-
|
|
583
|
-
last_updated_by_id : typing.Optional[str]
|
|
584
|
-
The id of the user that made this object.
|
|
585
|
-
|
|
586
|
-
created_at : typing.Optional[dt.datetime]
|
|
587
|
-
The timestamp when the object was created.
|
|
588
|
-
|
|
589
|
-
updated_at : typing.Optional[dt.datetime]
|
|
590
|
-
The timestamp when the object was last updated.
|
|
591
|
-
|
|
592
|
-
is_deleted : typing.Optional[bool]
|
|
593
|
-
Whether this passage is deleted or not.
|
|
594
|
-
|
|
595
|
-
archive_id : typing.Optional[str]
|
|
596
|
-
The unique identifier of the archive containing this passage.
|
|
597
|
-
|
|
598
|
-
source_id : typing.Optional[str]
|
|
599
|
-
The data source of the passage.
|
|
600
|
-
|
|
601
|
-
file_id : typing.Optional[str]
|
|
602
|
-
The unique identifier of the file associated with the passage.
|
|
603
|
-
|
|
604
|
-
file_name : typing.Optional[str]
|
|
605
|
-
The name of the file (only for source passages).
|
|
606
|
-
|
|
607
|
-
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
608
|
-
The metadata of the passage.
|
|
609
|
-
|
|
610
|
-
text : typing.Optional[str]
|
|
611
|
-
The text of the passage.
|
|
612
|
-
|
|
613
|
-
embedding : typing.Optional[typing.Sequence[float]]
|
|
614
|
-
The embedding of the passage.
|
|
615
|
-
|
|
616
|
-
embedding_config : typing.Optional[EmbeddingConfig]
|
|
617
|
-
The embedding configuration used by the passage.
|
|
618
|
-
|
|
619
480
|
request_options : typing.Optional[RequestOptions]
|
|
620
481
|
Request-specific configuration.
|
|
621
482
|
|
|
622
483
|
Returns
|
|
623
484
|
-------
|
|
624
|
-
AsyncHttpResponse[
|
|
625
|
-
Successful Response
|
|
485
|
+
AsyncHttpResponse[None]
|
|
626
486
|
"""
|
|
627
487
|
_response = await self._client_wrapper.httpx_client.request(
|
|
628
488
|
f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory/{jsonable_encoder(memory_id)}",
|
|
629
489
|
method="PATCH",
|
|
630
|
-
json={
|
|
631
|
-
"created_by_id": created_by_id,
|
|
632
|
-
"last_updated_by_id": last_updated_by_id,
|
|
633
|
-
"created_at": created_at,
|
|
634
|
-
"updated_at": updated_at,
|
|
635
|
-
"is_deleted": is_deleted,
|
|
636
|
-
"archive_id": archive_id,
|
|
637
|
-
"source_id": source_id,
|
|
638
|
-
"file_id": file_id,
|
|
639
|
-
"file_name": file_name,
|
|
640
|
-
"metadata_": metadata,
|
|
641
|
-
"text": text,
|
|
642
|
-
"embedding": embedding,
|
|
643
|
-
"embedding_config": convert_and_respect_annotation_metadata(
|
|
644
|
-
object_=embedding_config, annotation=EmbeddingConfig, direction="write"
|
|
645
|
-
),
|
|
646
|
-
"id": id,
|
|
647
|
-
},
|
|
648
|
-
headers={
|
|
649
|
-
"content-type": "application/json",
|
|
650
|
-
},
|
|
651
490
|
request_options=request_options,
|
|
652
|
-
omit=OMIT,
|
|
653
491
|
)
|
|
654
492
|
try:
|
|
655
493
|
if 200 <= _response.status_code < 300:
|
|
656
|
-
|
|
657
|
-
typing.List[Passage],
|
|
658
|
-
construct_type(
|
|
659
|
-
type_=typing.List[Passage], # type: ignore
|
|
660
|
-
object_=_response.json(),
|
|
661
|
-
),
|
|
662
|
-
)
|
|
663
|
-
return AsyncHttpResponse(response=_response, data=_data)
|
|
664
|
-
if _response.status_code == 422:
|
|
665
|
-
raise UnprocessableEntityError(
|
|
666
|
-
headers=dict(_response.headers),
|
|
667
|
-
body=typing.cast(
|
|
668
|
-
HttpValidationError,
|
|
669
|
-
construct_type(
|
|
670
|
-
type_=HttpValidationError, # type: ignore
|
|
671
|
-
object_=_response.json(),
|
|
672
|
-
),
|
|
673
|
-
),
|
|
674
|
-
)
|
|
494
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
675
495
|
_response_json = _response.json()
|
|
676
496
|
except JSONDecodeError:
|
|
677
497
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -24,10 +24,10 @@ class BaseClientWrapper:
|
|
|
24
24
|
|
|
25
25
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
26
26
|
headers: typing.Dict[str, str] = {
|
|
27
|
-
"User-Agent": "letta-client/0.1.
|
|
27
|
+
"User-Agent": "letta-client/0.1.294",
|
|
28
28
|
"X-Fern-Language": "Python",
|
|
29
29
|
"X-Fern-SDK-Name": "letta-client",
|
|
30
|
-
"X-Fern-SDK-Version": "0.1.
|
|
30
|
+
"X-Fern-SDK-Version": "0.1.294",
|
|
31
31
|
**(self.get_custom_headers() or {}),
|
|
32
32
|
}
|
|
33
33
|
if self._project is not None:
|
|
@@ -33,8 +33,8 @@ letta_client/agents/messages/types/messages_modify_request.py,sha256=0NT3pgbqQIt
|
|
|
33
33
|
letta_client/agents/messages/types/messages_modify_response.py,sha256=1ZCFf0V0QSwtTPLp2qP-SMXVtgnRqg551G2ImXdECDo,672
|
|
34
34
|
letta_client/agents/messages/types/messages_preview_raw_payload_request.py,sha256=ncI14H-30FLJujezUyk2yS7Jfqf7TqqhcWejWXQ4pcE,283
|
|
35
35
|
letta_client/agents/passages/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
36
|
-
letta_client/agents/passages/client.py,sha256=
|
|
37
|
-
letta_client/agents/passages/raw_client.py,sha256=
|
|
36
|
+
letta_client/agents/passages/client.py,sha256=AJvkZDBFHBxPxP0acxcZ7ugfv-y32y7wyyJiK-uQch4,11839
|
|
37
|
+
letta_client/agents/passages/raw_client.py,sha256=_LCdUryyZrLYRdZeCmHChcS3nqwUKG4X4369YF3Cops,18644
|
|
38
38
|
letta_client/agents/raw_client.py,sha256=h3USsoctFijFNYUQDi6OdgvpJBtj7a8ekrL58EtsV7A,97954
|
|
39
39
|
letta_client/agents/sources/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
40
40
|
letta_client/agents/sources/client.py,sha256=lCqB6FF9svrwf0oZSFs41WKlMXc-YRhUeb4FZkHbicM,6868
|
|
@@ -89,7 +89,7 @@ letta_client/client_side_access_tokens/types/client_side_access_tokens_list_clie
|
|
|
89
89
|
letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item_access_item.py,sha256=kNHfEWFl7u71Pu8NPqutod0a2NXfvq8il05Hqm0iBB4,284
|
|
90
90
|
letta_client/core/__init__.py,sha256=tpn7rjb6C2UIkYZYIqdrNpI7Yax2jw88sXh2baxaxAI,1715
|
|
91
91
|
letta_client/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
|
|
92
|
-
letta_client/core/client_wrapper.py,sha256=
|
|
92
|
+
letta_client/core/client_wrapper.py,sha256=PYIzCnsWFpZ5yKMSN6sAEE4xucpDZb5OScvwRP5dj0s,2776
|
|
93
93
|
letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
94
94
|
letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
95
95
|
letta_client/core/force_multipart.py,sha256=awxh5MtcRYe74ehY8U76jzv6fYM_w_D3Rur7KQQzSDk,429
|
|
@@ -566,6 +566,6 @@ letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
|
|
|
566
566
|
letta_client/voice/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
567
567
|
letta_client/voice/client.py,sha256=EbIVOQh4HXqU9McATxwga08STk-HUwPEAUr_UHqyKHg,3748
|
|
568
568
|
letta_client/voice/raw_client.py,sha256=KvM_3GXuSf51bubM0RVBnxvlf20qZTFMnaA_BzhXzjQ,5938
|
|
569
|
-
letta_client-0.1.
|
|
570
|
-
letta_client-0.1.
|
|
571
|
-
letta_client-0.1.
|
|
569
|
+
letta_client-0.1.294.dist-info/METADATA,sha256=Z9IihkFoVf42zCIfgdchv1lI3fcd494Zwvgi3ClbHcw,5782
|
|
570
|
+
letta_client-0.1.294.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
571
|
+
letta_client-0.1.294.dist-info/RECORD,,
|
|
File without changes
|