letta-client 0.1.19__py3-none-any.whl → 0.1.22__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/__init__.py +10 -0
- letta_client/agents/__init__.py +2 -1
- letta_client/agents/archival_memory/client.py +218 -25
- letta_client/agents/client.py +350 -1637
- letta_client/agents/core_memory/client.py +424 -97
- letta_client/agents/memory_variables/client.py +2 -2
- letta_client/agents/messages/__init__.py +2 -2
- letta_client/agents/messages/client.py +29 -14
- letta_client/agents/messages/types/__init__.py +2 -1
- letta_client/agents/messages/types/message_update_content.py +6 -0
- letta_client/blocks/client.py +127 -0
- letta_client/client.py +0 -4
- letta_client/core/client_wrapper.py +1 -1
- letta_client/providers/client.py +6 -6
- letta_client/runs/client.py +30 -18
- letta_client/sources/files/client.py +6 -6
- letta_client/tag/client.py +6 -6
- letta_client/tools/client.py +6 -36
- letta_client/types/__init__.py +10 -0
- letta_client/types/assistant_message.py +2 -1
- letta_client/types/assistant_message_content.py +6 -0
- letta_client/types/llm_config.py +6 -0
- letta_client/types/message.py +3 -2
- letta_client/types/message_create.py +3 -2
- letta_client/types/message_create_content.py +6 -0
- letta_client/types/system_message.py +3 -2
- letta_client/types/system_message_content.py +6 -0
- letta_client/types/text_content.py +23 -0
- letta_client/types/tool_create.py +0 -5
- letta_client/types/user_message.py +3 -2
- letta_client/types/user_message_content.py +6 -0
- {letta_client-0.1.19.dist-info → letta_client-0.1.22.dist-info}/METADATA +2 -2
- {letta_client-0.1.19.dist-info → letta_client-0.1.22.dist-info}/RECORD +34 -28
- {letta_client-0.1.19.dist-info → letta_client-0.1.22.dist-info}/WHEEL +0 -0
letta_client/__init__.py
CHANGED
|
@@ -12,6 +12,7 @@ from .types import (
|
|
|
12
12
|
AppAuthSchemeAuthMode,
|
|
13
13
|
AppModel,
|
|
14
14
|
AssistantMessage,
|
|
15
|
+
AssistantMessageContent,
|
|
15
16
|
AuthRequest,
|
|
16
17
|
AuthResponse,
|
|
17
18
|
AuthSchemeField,
|
|
@@ -48,6 +49,7 @@ from .types import (
|
|
|
48
49
|
Memory,
|
|
49
50
|
Message,
|
|
50
51
|
MessageCreate,
|
|
52
|
+
MessageCreateContent,
|
|
51
53
|
MessageCreateRole,
|
|
52
54
|
MessageRole,
|
|
53
55
|
NotFoundErrorBody,
|
|
@@ -69,7 +71,9 @@ from .types import (
|
|
|
69
71
|
SandboxType,
|
|
70
72
|
Source,
|
|
71
73
|
SystemMessage,
|
|
74
|
+
SystemMessageContent,
|
|
72
75
|
TerminalToolRule,
|
|
76
|
+
TextContent,
|
|
73
77
|
Tool,
|
|
74
78
|
ToolCall,
|
|
75
79
|
ToolCallDelta,
|
|
@@ -84,6 +88,7 @@ from .types import (
|
|
|
84
88
|
User,
|
|
85
89
|
UserCreate,
|
|
86
90
|
UserMessage,
|
|
91
|
+
UserMessageContent,
|
|
87
92
|
UserUpdate,
|
|
88
93
|
ValidationError,
|
|
89
94
|
ValidationErrorLocItem,
|
|
@@ -128,6 +133,7 @@ __all__ = [
|
|
|
128
133
|
"AppAuthSchemeAuthMode",
|
|
129
134
|
"AppModel",
|
|
130
135
|
"AssistantMessage",
|
|
136
|
+
"AssistantMessageContent",
|
|
131
137
|
"AsyncLetta",
|
|
132
138
|
"AuthRequest",
|
|
133
139
|
"AuthResponse",
|
|
@@ -170,6 +176,7 @@ __all__ = [
|
|
|
170
176
|
"Memory",
|
|
171
177
|
"Message",
|
|
172
178
|
"MessageCreate",
|
|
179
|
+
"MessageCreateContent",
|
|
173
180
|
"MessageCreateRole",
|
|
174
181
|
"MessageRole",
|
|
175
182
|
"NotFoundError",
|
|
@@ -192,7 +199,9 @@ __all__ = [
|
|
|
192
199
|
"SandboxType",
|
|
193
200
|
"Source",
|
|
194
201
|
"SystemMessage",
|
|
202
|
+
"SystemMessageContent",
|
|
195
203
|
"TerminalToolRule",
|
|
204
|
+
"TextContent",
|
|
196
205
|
"Tool",
|
|
197
206
|
"ToolCall",
|
|
198
207
|
"ToolCallDelta",
|
|
@@ -209,6 +218,7 @@ __all__ = [
|
|
|
209
218
|
"User",
|
|
210
219
|
"UserCreate",
|
|
211
220
|
"UserMessage",
|
|
221
|
+
"UserMessageContent",
|
|
212
222
|
"UserUpdate",
|
|
213
223
|
"ValidationError",
|
|
214
224
|
"ValidationErrorLocItem",
|
letta_client/agents/__init__.py
CHANGED
|
@@ -15,7 +15,7 @@ from .types import (
|
|
|
15
15
|
)
|
|
16
16
|
from . import archival_memory, context, core_memory, memory_variables, messages, sources, templates, tools
|
|
17
17
|
from .memory_variables import MemoryVariablesListResponse
|
|
18
|
-
from .messages import LettaStreamingResponse, MessagesListResponse
|
|
18
|
+
from .messages import LettaStreamingResponse, MessageUpdateContent, MessagesListResponse
|
|
19
19
|
from .templates import TemplatesMigrateResponse
|
|
20
20
|
|
|
21
21
|
__all__ = [
|
|
@@ -31,6 +31,7 @@ __all__ = [
|
|
|
31
31
|
"CreateAgentRequestToolRulesItem",
|
|
32
32
|
"LettaStreamingResponse",
|
|
33
33
|
"MemoryVariablesListResponse",
|
|
34
|
+
"MessageUpdateContent",
|
|
34
35
|
"MessagesListResponse",
|
|
35
36
|
"TemplatesMigrateResponse",
|
|
36
37
|
"UpdateAgentToolRulesItem",
|
|
@@ -1,30 +1,57 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ...core.client_wrapper import SyncClientWrapper
|
|
4
3
|
import typing
|
|
4
|
+
from ...core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from ...core.request_options import RequestOptions
|
|
6
|
+
from ...types.passage import Passage
|
|
6
7
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
8
|
+
from ...core.unchecked_base_model import construct_type
|
|
9
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
10
|
+
from ...types.http_validation_error import HttpValidationError
|
|
7
11
|
from json.decoder import JSONDecodeError
|
|
8
12
|
from ...core.api_error import ApiError
|
|
9
13
|
from ...core.client_wrapper import AsyncClientWrapper
|
|
10
14
|
|
|
15
|
+
# this is used as the default value for optional parameters
|
|
16
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
17
|
+
|
|
11
18
|
|
|
12
19
|
class ArchivalMemoryClient:
|
|
13
20
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
14
21
|
self._client_wrapper = client_wrapper
|
|
15
22
|
|
|
16
|
-
def list(
|
|
23
|
+
def list(
|
|
24
|
+
self,
|
|
25
|
+
agent_id: str,
|
|
26
|
+
*,
|
|
27
|
+
after: typing.Optional[int] = None,
|
|
28
|
+
before: typing.Optional[int] = None,
|
|
29
|
+
limit: typing.Optional[int] = None,
|
|
30
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
31
|
+
) -> typing.List[Passage]:
|
|
17
32
|
"""
|
|
33
|
+
Retrieve the memories in an agent's archival memory store (paginated query).
|
|
34
|
+
|
|
18
35
|
Parameters
|
|
19
36
|
----------
|
|
20
37
|
agent_id : str
|
|
21
38
|
|
|
39
|
+
after : typing.Optional[int]
|
|
40
|
+
Unique ID of the memory to start the query range at.
|
|
41
|
+
|
|
42
|
+
before : typing.Optional[int]
|
|
43
|
+
Unique ID of the memory to end the query range at.
|
|
44
|
+
|
|
45
|
+
limit : typing.Optional[int]
|
|
46
|
+
How many results to include in the response.
|
|
47
|
+
|
|
22
48
|
request_options : typing.Optional[RequestOptions]
|
|
23
49
|
Request-specific configuration.
|
|
24
50
|
|
|
25
51
|
Returns
|
|
26
52
|
-------
|
|
27
|
-
|
|
53
|
+
typing.List[Passage]
|
|
54
|
+
Successful Response
|
|
28
55
|
|
|
29
56
|
Examples
|
|
30
57
|
--------
|
|
@@ -38,30 +65,59 @@ class ArchivalMemoryClient:
|
|
|
38
65
|
)
|
|
39
66
|
"""
|
|
40
67
|
_response = self._client_wrapper.httpx_client.request(
|
|
41
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
68
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory",
|
|
42
69
|
method="GET",
|
|
70
|
+
params={
|
|
71
|
+
"after": after,
|
|
72
|
+
"before": before,
|
|
73
|
+
"limit": limit,
|
|
74
|
+
},
|
|
43
75
|
request_options=request_options,
|
|
44
76
|
)
|
|
45
77
|
try:
|
|
46
78
|
if 200 <= _response.status_code < 300:
|
|
47
|
-
return
|
|
79
|
+
return typing.cast(
|
|
80
|
+
typing.List[Passage],
|
|
81
|
+
construct_type(
|
|
82
|
+
type_=typing.List[Passage], # type: ignore
|
|
83
|
+
object_=_response.json(),
|
|
84
|
+
),
|
|
85
|
+
)
|
|
86
|
+
if _response.status_code == 422:
|
|
87
|
+
raise UnprocessableEntityError(
|
|
88
|
+
typing.cast(
|
|
89
|
+
HttpValidationError,
|
|
90
|
+
construct_type(
|
|
91
|
+
type_=HttpValidationError, # type: ignore
|
|
92
|
+
object_=_response.json(),
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
)
|
|
48
96
|
_response_json = _response.json()
|
|
49
97
|
except JSONDecodeError:
|
|
50
98
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
51
99
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
52
100
|
|
|
53
|
-
def create(
|
|
101
|
+
def create(
|
|
102
|
+
self, agent_id: str, *, text: str, request_options: typing.Optional[RequestOptions] = None
|
|
103
|
+
) -> typing.List[Passage]:
|
|
54
104
|
"""
|
|
105
|
+
Insert a memory into an agent's archival memory store.
|
|
106
|
+
|
|
55
107
|
Parameters
|
|
56
108
|
----------
|
|
57
109
|
agent_id : str
|
|
58
110
|
|
|
111
|
+
text : str
|
|
112
|
+
Text to write to archival memory.
|
|
113
|
+
|
|
59
114
|
request_options : typing.Optional[RequestOptions]
|
|
60
115
|
Request-specific configuration.
|
|
61
116
|
|
|
62
117
|
Returns
|
|
63
118
|
-------
|
|
64
|
-
|
|
119
|
+
typing.List[Passage]
|
|
120
|
+
Successful Response
|
|
65
121
|
|
|
66
122
|
Examples
|
|
67
123
|
--------
|
|
@@ -72,23 +128,51 @@ class ArchivalMemoryClient:
|
|
|
72
128
|
)
|
|
73
129
|
client.agents.archival_memory.create(
|
|
74
130
|
agent_id="agent_id",
|
|
131
|
+
text="text",
|
|
75
132
|
)
|
|
76
133
|
"""
|
|
77
134
|
_response = self._client_wrapper.httpx_client.request(
|
|
78
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
135
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory",
|
|
79
136
|
method="POST",
|
|
137
|
+
json={
|
|
138
|
+
"text": text,
|
|
139
|
+
},
|
|
140
|
+
headers={
|
|
141
|
+
"content-type": "application/json",
|
|
142
|
+
},
|
|
80
143
|
request_options=request_options,
|
|
144
|
+
omit=OMIT,
|
|
81
145
|
)
|
|
82
146
|
try:
|
|
83
147
|
if 200 <= _response.status_code < 300:
|
|
84
|
-
return
|
|
148
|
+
return typing.cast(
|
|
149
|
+
typing.List[Passage],
|
|
150
|
+
construct_type(
|
|
151
|
+
type_=typing.List[Passage], # type: ignore
|
|
152
|
+
object_=_response.json(),
|
|
153
|
+
),
|
|
154
|
+
)
|
|
155
|
+
if _response.status_code == 422:
|
|
156
|
+
raise UnprocessableEntityError(
|
|
157
|
+
typing.cast(
|
|
158
|
+
HttpValidationError,
|
|
159
|
+
construct_type(
|
|
160
|
+
type_=HttpValidationError, # type: ignore
|
|
161
|
+
object_=_response.json(),
|
|
162
|
+
),
|
|
163
|
+
)
|
|
164
|
+
)
|
|
85
165
|
_response_json = _response.json()
|
|
86
166
|
except JSONDecodeError:
|
|
87
167
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
88
168
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
89
169
|
|
|
90
|
-
def delete(
|
|
170
|
+
def delete(
|
|
171
|
+
self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
172
|
+
) -> typing.Optional[typing.Any]:
|
|
91
173
|
"""
|
|
174
|
+
Delete a memory from an agent's archival memory store.
|
|
175
|
+
|
|
92
176
|
Parameters
|
|
93
177
|
----------
|
|
94
178
|
agent_id : str
|
|
@@ -100,7 +184,8 @@ class ArchivalMemoryClient:
|
|
|
100
184
|
|
|
101
185
|
Returns
|
|
102
186
|
-------
|
|
103
|
-
|
|
187
|
+
typing.Optional[typing.Any]
|
|
188
|
+
Successful Response
|
|
104
189
|
|
|
105
190
|
Examples
|
|
106
191
|
--------
|
|
@@ -115,13 +200,29 @@ class ArchivalMemoryClient:
|
|
|
115
200
|
)
|
|
116
201
|
"""
|
|
117
202
|
_response = self._client_wrapper.httpx_client.request(
|
|
118
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
203
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory/{jsonable_encoder(memory_id)}",
|
|
119
204
|
method="DELETE",
|
|
120
205
|
request_options=request_options,
|
|
121
206
|
)
|
|
122
207
|
try:
|
|
123
208
|
if 200 <= _response.status_code < 300:
|
|
124
|
-
return
|
|
209
|
+
return typing.cast(
|
|
210
|
+
typing.Optional[typing.Any],
|
|
211
|
+
construct_type(
|
|
212
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
213
|
+
object_=_response.json(),
|
|
214
|
+
),
|
|
215
|
+
)
|
|
216
|
+
if _response.status_code == 422:
|
|
217
|
+
raise UnprocessableEntityError(
|
|
218
|
+
typing.cast(
|
|
219
|
+
HttpValidationError,
|
|
220
|
+
construct_type(
|
|
221
|
+
type_=HttpValidationError, # type: ignore
|
|
222
|
+
object_=_response.json(),
|
|
223
|
+
),
|
|
224
|
+
)
|
|
225
|
+
)
|
|
125
226
|
_response_json = _response.json()
|
|
126
227
|
except JSONDecodeError:
|
|
127
228
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -132,18 +233,38 @@ class AsyncArchivalMemoryClient:
|
|
|
132
233
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
133
234
|
self._client_wrapper = client_wrapper
|
|
134
235
|
|
|
135
|
-
async def list(
|
|
236
|
+
async def list(
|
|
237
|
+
self,
|
|
238
|
+
agent_id: str,
|
|
239
|
+
*,
|
|
240
|
+
after: typing.Optional[int] = None,
|
|
241
|
+
before: typing.Optional[int] = None,
|
|
242
|
+
limit: typing.Optional[int] = None,
|
|
243
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
244
|
+
) -> typing.List[Passage]:
|
|
136
245
|
"""
|
|
246
|
+
Retrieve the memories in an agent's archival memory store (paginated query).
|
|
247
|
+
|
|
137
248
|
Parameters
|
|
138
249
|
----------
|
|
139
250
|
agent_id : str
|
|
140
251
|
|
|
252
|
+
after : typing.Optional[int]
|
|
253
|
+
Unique ID of the memory to start the query range at.
|
|
254
|
+
|
|
255
|
+
before : typing.Optional[int]
|
|
256
|
+
Unique ID of the memory to end the query range at.
|
|
257
|
+
|
|
258
|
+
limit : typing.Optional[int]
|
|
259
|
+
How many results to include in the response.
|
|
260
|
+
|
|
141
261
|
request_options : typing.Optional[RequestOptions]
|
|
142
262
|
Request-specific configuration.
|
|
143
263
|
|
|
144
264
|
Returns
|
|
145
265
|
-------
|
|
146
|
-
|
|
266
|
+
typing.List[Passage]
|
|
267
|
+
Successful Response
|
|
147
268
|
|
|
148
269
|
Examples
|
|
149
270
|
--------
|
|
@@ -165,30 +286,59 @@ class AsyncArchivalMemoryClient:
|
|
|
165
286
|
asyncio.run(main())
|
|
166
287
|
"""
|
|
167
288
|
_response = await self._client_wrapper.httpx_client.request(
|
|
168
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
289
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory",
|
|
169
290
|
method="GET",
|
|
291
|
+
params={
|
|
292
|
+
"after": after,
|
|
293
|
+
"before": before,
|
|
294
|
+
"limit": limit,
|
|
295
|
+
},
|
|
170
296
|
request_options=request_options,
|
|
171
297
|
)
|
|
172
298
|
try:
|
|
173
299
|
if 200 <= _response.status_code < 300:
|
|
174
|
-
return
|
|
300
|
+
return typing.cast(
|
|
301
|
+
typing.List[Passage],
|
|
302
|
+
construct_type(
|
|
303
|
+
type_=typing.List[Passage], # type: ignore
|
|
304
|
+
object_=_response.json(),
|
|
305
|
+
),
|
|
306
|
+
)
|
|
307
|
+
if _response.status_code == 422:
|
|
308
|
+
raise UnprocessableEntityError(
|
|
309
|
+
typing.cast(
|
|
310
|
+
HttpValidationError,
|
|
311
|
+
construct_type(
|
|
312
|
+
type_=HttpValidationError, # type: ignore
|
|
313
|
+
object_=_response.json(),
|
|
314
|
+
),
|
|
315
|
+
)
|
|
316
|
+
)
|
|
175
317
|
_response_json = _response.json()
|
|
176
318
|
except JSONDecodeError:
|
|
177
319
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
178
320
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
179
321
|
|
|
180
|
-
async def create(
|
|
322
|
+
async def create(
|
|
323
|
+
self, agent_id: str, *, text: str, request_options: typing.Optional[RequestOptions] = None
|
|
324
|
+
) -> typing.List[Passage]:
|
|
181
325
|
"""
|
|
326
|
+
Insert a memory into an agent's archival memory store.
|
|
327
|
+
|
|
182
328
|
Parameters
|
|
183
329
|
----------
|
|
184
330
|
agent_id : str
|
|
185
331
|
|
|
332
|
+
text : str
|
|
333
|
+
Text to write to archival memory.
|
|
334
|
+
|
|
186
335
|
request_options : typing.Optional[RequestOptions]
|
|
187
336
|
Request-specific configuration.
|
|
188
337
|
|
|
189
338
|
Returns
|
|
190
339
|
-------
|
|
191
|
-
|
|
340
|
+
typing.List[Passage]
|
|
341
|
+
Successful Response
|
|
192
342
|
|
|
193
343
|
Examples
|
|
194
344
|
--------
|
|
@@ -204,19 +354,43 @@ class AsyncArchivalMemoryClient:
|
|
|
204
354
|
async def main() -> None:
|
|
205
355
|
await client.agents.archival_memory.create(
|
|
206
356
|
agent_id="agent_id",
|
|
357
|
+
text="text",
|
|
207
358
|
)
|
|
208
359
|
|
|
209
360
|
|
|
210
361
|
asyncio.run(main())
|
|
211
362
|
"""
|
|
212
363
|
_response = await self._client_wrapper.httpx_client.request(
|
|
213
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
364
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory",
|
|
214
365
|
method="POST",
|
|
366
|
+
json={
|
|
367
|
+
"text": text,
|
|
368
|
+
},
|
|
369
|
+
headers={
|
|
370
|
+
"content-type": "application/json",
|
|
371
|
+
},
|
|
215
372
|
request_options=request_options,
|
|
373
|
+
omit=OMIT,
|
|
216
374
|
)
|
|
217
375
|
try:
|
|
218
376
|
if 200 <= _response.status_code < 300:
|
|
219
|
-
return
|
|
377
|
+
return typing.cast(
|
|
378
|
+
typing.List[Passage],
|
|
379
|
+
construct_type(
|
|
380
|
+
type_=typing.List[Passage], # type: ignore
|
|
381
|
+
object_=_response.json(),
|
|
382
|
+
),
|
|
383
|
+
)
|
|
384
|
+
if _response.status_code == 422:
|
|
385
|
+
raise UnprocessableEntityError(
|
|
386
|
+
typing.cast(
|
|
387
|
+
HttpValidationError,
|
|
388
|
+
construct_type(
|
|
389
|
+
type_=HttpValidationError, # type: ignore
|
|
390
|
+
object_=_response.json(),
|
|
391
|
+
),
|
|
392
|
+
)
|
|
393
|
+
)
|
|
220
394
|
_response_json = _response.json()
|
|
221
395
|
except JSONDecodeError:
|
|
222
396
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -224,8 +398,10 @@ class AsyncArchivalMemoryClient:
|
|
|
224
398
|
|
|
225
399
|
async def delete(
|
|
226
400
|
self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
227
|
-
) ->
|
|
401
|
+
) -> typing.Optional[typing.Any]:
|
|
228
402
|
"""
|
|
403
|
+
Delete a memory from an agent's archival memory store.
|
|
404
|
+
|
|
229
405
|
Parameters
|
|
230
406
|
----------
|
|
231
407
|
agent_id : str
|
|
@@ -237,7 +413,8 @@ class AsyncArchivalMemoryClient:
|
|
|
237
413
|
|
|
238
414
|
Returns
|
|
239
415
|
-------
|
|
240
|
-
|
|
416
|
+
typing.Optional[typing.Any]
|
|
417
|
+
Successful Response
|
|
241
418
|
|
|
242
419
|
Examples
|
|
243
420
|
--------
|
|
@@ -260,13 +437,29 @@ class AsyncArchivalMemoryClient:
|
|
|
260
437
|
asyncio.run(main())
|
|
261
438
|
"""
|
|
262
439
|
_response = await self._client_wrapper.httpx_client.request(
|
|
263
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
440
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory/{jsonable_encoder(memory_id)}",
|
|
264
441
|
method="DELETE",
|
|
265
442
|
request_options=request_options,
|
|
266
443
|
)
|
|
267
444
|
try:
|
|
268
445
|
if 200 <= _response.status_code < 300:
|
|
269
|
-
return
|
|
446
|
+
return typing.cast(
|
|
447
|
+
typing.Optional[typing.Any],
|
|
448
|
+
construct_type(
|
|
449
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
450
|
+
object_=_response.json(),
|
|
451
|
+
),
|
|
452
|
+
)
|
|
453
|
+
if _response.status_code == 422:
|
|
454
|
+
raise UnprocessableEntityError(
|
|
455
|
+
typing.cast(
|
|
456
|
+
HttpValidationError,
|
|
457
|
+
construct_type(
|
|
458
|
+
type_=HttpValidationError, # type: ignore
|
|
459
|
+
object_=_response.json(),
|
|
460
|
+
),
|
|
461
|
+
)
|
|
462
|
+
)
|
|
270
463
|
_response_json = _response.json()
|
|
271
464
|
except JSONDecodeError:
|
|
272
465
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|