letta-client 0.1.15__py3-none-any.whl → 0.1.17__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.
- letta_client/__init__.py +14 -34
- letta_client/agents/__init__.py +1 -26
- letta_client/agents/archival_memory/client.py +7 -132
- letta_client/agents/client.py +26 -20
- letta_client/agents/core_memory/client.py +17 -144
- letta_client/agents/memory_variables/client.py +2 -2
- letta_client/agents/messages/__init__.py +0 -14
- letta_client/agents/messages/client.py +4 -4
- letta_client/agents/messages/types/__init__.py +0 -16
- letta_client/agents/messages/types/messages_list_response.py +2 -2
- letta_client/core/client_wrapper.py +1 -1
- letta_client/providers/client.py +74 -74
- letta_client/runs/__init__.py +0 -19
- letta_client/runs/client.py +9 -9
- letta_client/tools/client.py +0 -120
- letta_client/types/__init__.py +16 -20
- letta_client/types/embedding_config_embedding_endpoint_type.py +1 -0
- letta_client/types/{letta_response_messages_item.py → letta_message_union.py} +13 -13
- letta_client/types/letta_response.py +2 -2
- letta_client/types/letta_schemas_message_message.py +5 -0
- letta_client/types/llm_config_model_endpoint_type.py +1 -0
- letta_client/types/tool_type.py +3 -1
- {letta_client-0.1.15.dist-info → letta_client-0.1.17.dist-info}/METADATA +2 -2
- {letta_client-0.1.15.dist-info → letta_client-0.1.17.dist-info}/RECORD +25 -32
- letta_client/agents/messages/types/messages_list_response_item.py +0 -125
- letta_client/agents/recall_memory/__init__.py +0 -2
- letta_client/agents/recall_memory/client.py +0 -147
- letta_client/runs/types/__init__.py +0 -21
- letta_client/runs/types/get_run_messages_response_item.py +0 -125
- letta_client/types/archival_memory_summary.py +0 -22
- letta_client/types/recall_memory_summary.py +0 -22
- {letta_client-0.1.15.dist-info → letta_client-0.1.17.dist-info}/WHEEL +0 -0
letta_client/providers/client.py
CHANGED
|
@@ -156,26 +156,23 @@ class ProvidersClient:
|
|
|
156
156
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
157
157
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
158
158
|
|
|
159
|
-
def
|
|
160
|
-
self, *,
|
|
161
|
-
) ->
|
|
159
|
+
def delete_provider(
|
|
160
|
+
self, *, provider_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
161
|
+
) -> typing.Optional[typing.Any]:
|
|
162
162
|
"""
|
|
163
|
-
|
|
163
|
+
Delete an existing custom provider
|
|
164
164
|
|
|
165
165
|
Parameters
|
|
166
166
|
----------
|
|
167
|
-
|
|
168
|
-
The
|
|
169
|
-
|
|
170
|
-
api_key : str
|
|
171
|
-
API key used for requests to the provider.
|
|
167
|
+
provider_id : str
|
|
168
|
+
The provider_id key to be deleted.
|
|
172
169
|
|
|
173
170
|
request_options : typing.Optional[RequestOptions]
|
|
174
171
|
Request-specific configuration.
|
|
175
172
|
|
|
176
173
|
Returns
|
|
177
174
|
-------
|
|
178
|
-
|
|
175
|
+
typing.Optional[typing.Any]
|
|
179
176
|
Successful Response
|
|
180
177
|
|
|
181
178
|
Examples
|
|
@@ -185,30 +182,24 @@ class ProvidersClient:
|
|
|
185
182
|
client = Letta(
|
|
186
183
|
token="YOUR_TOKEN",
|
|
187
184
|
)
|
|
188
|
-
client.providers.
|
|
189
|
-
|
|
190
|
-
api_key="api_key",
|
|
185
|
+
client.providers.delete_provider(
|
|
186
|
+
provider_id="provider_id",
|
|
191
187
|
)
|
|
192
188
|
"""
|
|
193
189
|
_response = self._client_wrapper.httpx_client.request(
|
|
194
190
|
"v1/providers/",
|
|
195
|
-
method="
|
|
196
|
-
|
|
197
|
-
"
|
|
198
|
-
"api_key": api_key,
|
|
199
|
-
},
|
|
200
|
-
headers={
|
|
201
|
-
"content-type": "application/json",
|
|
191
|
+
method="DELETE",
|
|
192
|
+
params={
|
|
193
|
+
"provider_id": provider_id,
|
|
202
194
|
},
|
|
203
195
|
request_options=request_options,
|
|
204
|
-
omit=OMIT,
|
|
205
196
|
)
|
|
206
197
|
try:
|
|
207
198
|
if 200 <= _response.status_code < 300:
|
|
208
199
|
return typing.cast(
|
|
209
|
-
|
|
200
|
+
typing.Optional[typing.Any],
|
|
210
201
|
construct_type(
|
|
211
|
-
type_=
|
|
202
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
212
203
|
object_=_response.json(),
|
|
213
204
|
),
|
|
214
205
|
)
|
|
@@ -227,23 +218,26 @@ class ProvidersClient:
|
|
|
227
218
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
228
219
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
229
220
|
|
|
230
|
-
def
|
|
231
|
-
self, *,
|
|
232
|
-
) ->
|
|
221
|
+
def update_provider(
|
|
222
|
+
self, *, id: str, api_key: str, request_options: typing.Optional[RequestOptions] = None
|
|
223
|
+
) -> Provider:
|
|
233
224
|
"""
|
|
234
|
-
|
|
225
|
+
Update an existing custom provider
|
|
235
226
|
|
|
236
227
|
Parameters
|
|
237
228
|
----------
|
|
238
|
-
|
|
239
|
-
The
|
|
229
|
+
id : str
|
|
230
|
+
The id of the provider to update.
|
|
231
|
+
|
|
232
|
+
api_key : str
|
|
233
|
+
API key used for requests to the provider.
|
|
240
234
|
|
|
241
235
|
request_options : typing.Optional[RequestOptions]
|
|
242
236
|
Request-specific configuration.
|
|
243
237
|
|
|
244
238
|
Returns
|
|
245
239
|
-------
|
|
246
|
-
|
|
240
|
+
Provider
|
|
247
241
|
Successful Response
|
|
248
242
|
|
|
249
243
|
Examples
|
|
@@ -253,24 +247,30 @@ class ProvidersClient:
|
|
|
253
247
|
client = Letta(
|
|
254
248
|
token="YOUR_TOKEN",
|
|
255
249
|
)
|
|
256
|
-
client.providers.
|
|
257
|
-
|
|
250
|
+
client.providers.update_provider(
|
|
251
|
+
id="id",
|
|
252
|
+
api_key="api_key",
|
|
258
253
|
)
|
|
259
254
|
"""
|
|
260
255
|
_response = self._client_wrapper.httpx_client.request(
|
|
261
256
|
"v1/providers/",
|
|
262
|
-
method="
|
|
263
|
-
|
|
264
|
-
"
|
|
257
|
+
method="PATCH",
|
|
258
|
+
json={
|
|
259
|
+
"id": id,
|
|
260
|
+
"api_key": api_key,
|
|
261
|
+
},
|
|
262
|
+
headers={
|
|
263
|
+
"content-type": "application/json",
|
|
265
264
|
},
|
|
266
265
|
request_options=request_options,
|
|
266
|
+
omit=OMIT,
|
|
267
267
|
)
|
|
268
268
|
try:
|
|
269
269
|
if 200 <= _response.status_code < 300:
|
|
270
270
|
return typing.cast(
|
|
271
|
-
|
|
271
|
+
Provider,
|
|
272
272
|
construct_type(
|
|
273
|
-
type_=
|
|
273
|
+
type_=Provider, # type: ignore
|
|
274
274
|
object_=_response.json(),
|
|
275
275
|
),
|
|
276
276
|
)
|
|
@@ -447,26 +447,23 @@ class AsyncProvidersClient:
|
|
|
447
447
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
448
448
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
449
449
|
|
|
450
|
-
async def
|
|
451
|
-
self, *,
|
|
452
|
-
) ->
|
|
450
|
+
async def delete_provider(
|
|
451
|
+
self, *, provider_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
452
|
+
) -> typing.Optional[typing.Any]:
|
|
453
453
|
"""
|
|
454
|
-
|
|
454
|
+
Delete an existing custom provider
|
|
455
455
|
|
|
456
456
|
Parameters
|
|
457
457
|
----------
|
|
458
|
-
|
|
459
|
-
The
|
|
460
|
-
|
|
461
|
-
api_key : str
|
|
462
|
-
API key used for requests to the provider.
|
|
458
|
+
provider_id : str
|
|
459
|
+
The provider_id key to be deleted.
|
|
463
460
|
|
|
464
461
|
request_options : typing.Optional[RequestOptions]
|
|
465
462
|
Request-specific configuration.
|
|
466
463
|
|
|
467
464
|
Returns
|
|
468
465
|
-------
|
|
469
|
-
|
|
466
|
+
typing.Optional[typing.Any]
|
|
470
467
|
Successful Response
|
|
471
468
|
|
|
472
469
|
Examples
|
|
@@ -481,9 +478,8 @@ class AsyncProvidersClient:
|
|
|
481
478
|
|
|
482
479
|
|
|
483
480
|
async def main() -> None:
|
|
484
|
-
await client.providers.
|
|
485
|
-
|
|
486
|
-
api_key="api_key",
|
|
481
|
+
await client.providers.delete_provider(
|
|
482
|
+
provider_id="provider_id",
|
|
487
483
|
)
|
|
488
484
|
|
|
489
485
|
|
|
@@ -491,23 +487,18 @@ class AsyncProvidersClient:
|
|
|
491
487
|
"""
|
|
492
488
|
_response = await self._client_wrapper.httpx_client.request(
|
|
493
489
|
"v1/providers/",
|
|
494
|
-
method="
|
|
495
|
-
|
|
496
|
-
"
|
|
497
|
-
"api_key": api_key,
|
|
498
|
-
},
|
|
499
|
-
headers={
|
|
500
|
-
"content-type": "application/json",
|
|
490
|
+
method="DELETE",
|
|
491
|
+
params={
|
|
492
|
+
"provider_id": provider_id,
|
|
501
493
|
},
|
|
502
494
|
request_options=request_options,
|
|
503
|
-
omit=OMIT,
|
|
504
495
|
)
|
|
505
496
|
try:
|
|
506
497
|
if 200 <= _response.status_code < 300:
|
|
507
498
|
return typing.cast(
|
|
508
|
-
|
|
499
|
+
typing.Optional[typing.Any],
|
|
509
500
|
construct_type(
|
|
510
|
-
type_=
|
|
501
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
511
502
|
object_=_response.json(),
|
|
512
503
|
),
|
|
513
504
|
)
|
|
@@ -526,23 +517,26 @@ class AsyncProvidersClient:
|
|
|
526
517
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
527
518
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
528
519
|
|
|
529
|
-
async def
|
|
530
|
-
self, *,
|
|
531
|
-
) ->
|
|
520
|
+
async def update_provider(
|
|
521
|
+
self, *, id: str, api_key: str, request_options: typing.Optional[RequestOptions] = None
|
|
522
|
+
) -> Provider:
|
|
532
523
|
"""
|
|
533
|
-
|
|
524
|
+
Update an existing custom provider
|
|
534
525
|
|
|
535
526
|
Parameters
|
|
536
527
|
----------
|
|
537
|
-
|
|
538
|
-
The
|
|
528
|
+
id : str
|
|
529
|
+
The id of the provider to update.
|
|
530
|
+
|
|
531
|
+
api_key : str
|
|
532
|
+
API key used for requests to the provider.
|
|
539
533
|
|
|
540
534
|
request_options : typing.Optional[RequestOptions]
|
|
541
535
|
Request-specific configuration.
|
|
542
536
|
|
|
543
537
|
Returns
|
|
544
538
|
-------
|
|
545
|
-
|
|
539
|
+
Provider
|
|
546
540
|
Successful Response
|
|
547
541
|
|
|
548
542
|
Examples
|
|
@@ -557,8 +551,9 @@ class AsyncProvidersClient:
|
|
|
557
551
|
|
|
558
552
|
|
|
559
553
|
async def main() -> None:
|
|
560
|
-
await client.providers.
|
|
561
|
-
|
|
554
|
+
await client.providers.update_provider(
|
|
555
|
+
id="id",
|
|
556
|
+
api_key="api_key",
|
|
562
557
|
)
|
|
563
558
|
|
|
564
559
|
|
|
@@ -566,18 +561,23 @@ class AsyncProvidersClient:
|
|
|
566
561
|
"""
|
|
567
562
|
_response = await self._client_wrapper.httpx_client.request(
|
|
568
563
|
"v1/providers/",
|
|
569
|
-
method="
|
|
570
|
-
|
|
571
|
-
"
|
|
564
|
+
method="PATCH",
|
|
565
|
+
json={
|
|
566
|
+
"id": id,
|
|
567
|
+
"api_key": api_key,
|
|
568
|
+
},
|
|
569
|
+
headers={
|
|
570
|
+
"content-type": "application/json",
|
|
572
571
|
},
|
|
573
572
|
request_options=request_options,
|
|
573
|
+
omit=OMIT,
|
|
574
574
|
)
|
|
575
575
|
try:
|
|
576
576
|
if 200 <= _response.status_code < 300:
|
|
577
577
|
return typing.cast(
|
|
578
|
-
|
|
578
|
+
Provider,
|
|
579
579
|
construct_type(
|
|
580
|
-
type_=
|
|
580
|
+
type_=Provider, # type: ignore
|
|
581
581
|
object_=_response.json(),
|
|
582
582
|
),
|
|
583
583
|
)
|
letta_client/runs/__init__.py
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from .types import (
|
|
4
|
-
GetRunMessagesResponseItem,
|
|
5
|
-
GetRunMessagesResponseItem_AssistantMessage,
|
|
6
|
-
GetRunMessagesResponseItem_ReasoningMessage,
|
|
7
|
-
GetRunMessagesResponseItem_SystemMessage,
|
|
8
|
-
GetRunMessagesResponseItem_ToolCallMessage,
|
|
9
|
-
GetRunMessagesResponseItem_ToolReturnMessage,
|
|
10
|
-
GetRunMessagesResponseItem_UserMessage,
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
__all__ = [
|
|
14
|
-
"GetRunMessagesResponseItem",
|
|
15
|
-
"GetRunMessagesResponseItem_AssistantMessage",
|
|
16
|
-
"GetRunMessagesResponseItem_ReasoningMessage",
|
|
17
|
-
"GetRunMessagesResponseItem_SystemMessage",
|
|
18
|
-
"GetRunMessagesResponseItem_ToolCallMessage",
|
|
19
|
-
"GetRunMessagesResponseItem_ToolReturnMessage",
|
|
20
|
-
"GetRunMessagesResponseItem_UserMessage",
|
|
21
|
-
]
|
letta_client/runs/client.py
CHANGED
|
@@ -11,7 +11,7 @@ from json.decoder import JSONDecodeError
|
|
|
11
11
|
from ..core.api_error import ApiError
|
|
12
12
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
13
13
|
from ..types.message_role import MessageRole
|
|
14
|
-
from
|
|
14
|
+
from ..types.letta_message_union import LettaMessageUnion
|
|
15
15
|
from ..types.usage_statistics import UsageStatistics
|
|
16
16
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
17
17
|
|
|
@@ -245,7 +245,7 @@ class RunsClient:
|
|
|
245
245
|
ascending: typing.Optional[bool] = None,
|
|
246
246
|
role: typing.Optional[MessageRole] = None,
|
|
247
247
|
request_options: typing.Optional[RequestOptions] = None,
|
|
248
|
-
) -> typing.List[
|
|
248
|
+
) -> typing.List[LettaMessageUnion]:
|
|
249
249
|
"""
|
|
250
250
|
Get messages associated with a run with filtering options.
|
|
251
251
|
|
|
@@ -282,7 +282,7 @@ class RunsClient:
|
|
|
282
282
|
|
|
283
283
|
Returns
|
|
284
284
|
-------
|
|
285
|
-
typing.List[
|
|
285
|
+
typing.List[LettaMessageUnion]
|
|
286
286
|
Successful Response
|
|
287
287
|
|
|
288
288
|
Examples
|
|
@@ -310,9 +310,9 @@ class RunsClient:
|
|
|
310
310
|
try:
|
|
311
311
|
if 200 <= _response.status_code < 300:
|
|
312
312
|
return typing.cast(
|
|
313
|
-
typing.List[
|
|
313
|
+
typing.List[LettaMessageUnion],
|
|
314
314
|
construct_type(
|
|
315
|
-
type_=typing.List[
|
|
315
|
+
type_=typing.List[LettaMessageUnion], # type: ignore
|
|
316
316
|
object_=_response.json(),
|
|
317
317
|
),
|
|
318
318
|
)
|
|
@@ -649,7 +649,7 @@ class AsyncRunsClient:
|
|
|
649
649
|
ascending: typing.Optional[bool] = None,
|
|
650
650
|
role: typing.Optional[MessageRole] = None,
|
|
651
651
|
request_options: typing.Optional[RequestOptions] = None,
|
|
652
|
-
) -> typing.List[
|
|
652
|
+
) -> typing.List[LettaMessageUnion]:
|
|
653
653
|
"""
|
|
654
654
|
Get messages associated with a run with filtering options.
|
|
655
655
|
|
|
@@ -686,7 +686,7 @@ class AsyncRunsClient:
|
|
|
686
686
|
|
|
687
687
|
Returns
|
|
688
688
|
-------
|
|
689
|
-
typing.List[
|
|
689
|
+
typing.List[LettaMessageUnion]
|
|
690
690
|
Successful Response
|
|
691
691
|
|
|
692
692
|
Examples
|
|
@@ -722,9 +722,9 @@ class AsyncRunsClient:
|
|
|
722
722
|
try:
|
|
723
723
|
if 200 <= _response.status_code < 300:
|
|
724
724
|
return typing.cast(
|
|
725
|
-
typing.List[
|
|
725
|
+
typing.List[LettaMessageUnion],
|
|
726
726
|
construct_type(
|
|
727
|
-
type_=typing.List[
|
|
727
|
+
type_=typing.List[LettaMessageUnion], # type: ignore
|
|
728
728
|
object_=_response.json(),
|
|
729
729
|
),
|
|
730
730
|
)
|
letta_client/tools/client.py
CHANGED
|
@@ -239,62 +239,6 @@ class ToolsClient:
|
|
|
239
239
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
240
240
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
241
241
|
|
|
242
|
-
def get_by_name(self, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
243
|
-
"""
|
|
244
|
-
Get a tool ID by name
|
|
245
|
-
|
|
246
|
-
Parameters
|
|
247
|
-
----------
|
|
248
|
-
tool_name : str
|
|
249
|
-
|
|
250
|
-
request_options : typing.Optional[RequestOptions]
|
|
251
|
-
Request-specific configuration.
|
|
252
|
-
|
|
253
|
-
Returns
|
|
254
|
-
-------
|
|
255
|
-
str
|
|
256
|
-
Successful Response
|
|
257
|
-
|
|
258
|
-
Examples
|
|
259
|
-
--------
|
|
260
|
-
from letta_client import Letta
|
|
261
|
-
|
|
262
|
-
client = Letta(
|
|
263
|
-
token="YOUR_TOKEN",
|
|
264
|
-
)
|
|
265
|
-
client.tools.get_by_name(
|
|
266
|
-
tool_name="tool_name",
|
|
267
|
-
)
|
|
268
|
-
"""
|
|
269
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
270
|
-
f"v1/tools/name/{jsonable_encoder(tool_name)}",
|
|
271
|
-
method="GET",
|
|
272
|
-
request_options=request_options,
|
|
273
|
-
)
|
|
274
|
-
try:
|
|
275
|
-
if 200 <= _response.status_code < 300:
|
|
276
|
-
return typing.cast(
|
|
277
|
-
str,
|
|
278
|
-
construct_type(
|
|
279
|
-
type_=str, # type: ignore
|
|
280
|
-
object_=_response.json(),
|
|
281
|
-
),
|
|
282
|
-
)
|
|
283
|
-
if _response.status_code == 422:
|
|
284
|
-
raise UnprocessableEntityError(
|
|
285
|
-
typing.cast(
|
|
286
|
-
HttpValidationError,
|
|
287
|
-
construct_type(
|
|
288
|
-
type_=HttpValidationError, # type: ignore
|
|
289
|
-
object_=_response.json(),
|
|
290
|
-
),
|
|
291
|
-
)
|
|
292
|
-
)
|
|
293
|
-
_response_json = _response.json()
|
|
294
|
-
except JSONDecodeError:
|
|
295
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
296
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
297
|
-
|
|
298
242
|
def list(
|
|
299
243
|
self,
|
|
300
244
|
*,
|
|
@@ -1112,70 +1056,6 @@ class AsyncToolsClient:
|
|
|
1112
1056
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1113
1057
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1114
1058
|
|
|
1115
|
-
async def get_by_name(self, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
1116
|
-
"""
|
|
1117
|
-
Get a tool ID by name
|
|
1118
|
-
|
|
1119
|
-
Parameters
|
|
1120
|
-
----------
|
|
1121
|
-
tool_name : str
|
|
1122
|
-
|
|
1123
|
-
request_options : typing.Optional[RequestOptions]
|
|
1124
|
-
Request-specific configuration.
|
|
1125
|
-
|
|
1126
|
-
Returns
|
|
1127
|
-
-------
|
|
1128
|
-
str
|
|
1129
|
-
Successful Response
|
|
1130
|
-
|
|
1131
|
-
Examples
|
|
1132
|
-
--------
|
|
1133
|
-
import asyncio
|
|
1134
|
-
|
|
1135
|
-
from letta_client import AsyncLetta
|
|
1136
|
-
|
|
1137
|
-
client = AsyncLetta(
|
|
1138
|
-
token="YOUR_TOKEN",
|
|
1139
|
-
)
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
async def main() -> None:
|
|
1143
|
-
await client.tools.get_by_name(
|
|
1144
|
-
tool_name="tool_name",
|
|
1145
|
-
)
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
asyncio.run(main())
|
|
1149
|
-
"""
|
|
1150
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
1151
|
-
f"v1/tools/name/{jsonable_encoder(tool_name)}",
|
|
1152
|
-
method="GET",
|
|
1153
|
-
request_options=request_options,
|
|
1154
|
-
)
|
|
1155
|
-
try:
|
|
1156
|
-
if 200 <= _response.status_code < 300:
|
|
1157
|
-
return typing.cast(
|
|
1158
|
-
str,
|
|
1159
|
-
construct_type(
|
|
1160
|
-
type_=str, # type: ignore
|
|
1161
|
-
object_=_response.json(),
|
|
1162
|
-
),
|
|
1163
|
-
)
|
|
1164
|
-
if _response.status_code == 422:
|
|
1165
|
-
raise UnprocessableEntityError(
|
|
1166
|
-
typing.cast(
|
|
1167
|
-
HttpValidationError,
|
|
1168
|
-
construct_type(
|
|
1169
|
-
type_=HttpValidationError, # type: ignore
|
|
1170
|
-
object_=_response.json(),
|
|
1171
|
-
),
|
|
1172
|
-
)
|
|
1173
|
-
)
|
|
1174
|
-
_response_json = _response.json()
|
|
1175
|
-
except JSONDecodeError:
|
|
1176
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1177
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1178
|
-
|
|
1179
1059
|
async def list(
|
|
1180
1060
|
self,
|
|
1181
1061
|
*,
|
letta_client/types/__init__.py
CHANGED
|
@@ -10,7 +10,6 @@ from .agent_type import AgentType
|
|
|
10
10
|
from .app_auth_scheme import AppAuthScheme
|
|
11
11
|
from .app_auth_scheme_auth_mode import AppAuthSchemeAuthMode
|
|
12
12
|
from .app_model import AppModel
|
|
13
|
-
from .archival_memory_summary import ArchivalMemorySummary
|
|
14
13
|
from .assistant_file import AssistantFile
|
|
15
14
|
from .assistant_message_input import AssistantMessageInput
|
|
16
15
|
from .assistant_message_output import AssistantMessageOutput
|
|
@@ -49,18 +48,18 @@ from .internal_server_error_body import InternalServerErrorBody
|
|
|
49
48
|
from .job import Job
|
|
50
49
|
from .job_status import JobStatus
|
|
51
50
|
from .job_type import JobType
|
|
51
|
+
from .letta_message_union import (
|
|
52
|
+
LettaMessageUnion,
|
|
53
|
+
LettaMessageUnion_AssistantMessage,
|
|
54
|
+
LettaMessageUnion_ReasoningMessage,
|
|
55
|
+
LettaMessageUnion_SystemMessage,
|
|
56
|
+
LettaMessageUnion_ToolCallMessage,
|
|
57
|
+
LettaMessageUnion_ToolReturnMessage,
|
|
58
|
+
LettaMessageUnion_UserMessage,
|
|
59
|
+
)
|
|
52
60
|
from .letta_request import LettaRequest
|
|
53
61
|
from .letta_request_config import LettaRequestConfig
|
|
54
62
|
from .letta_response import LettaResponse
|
|
55
|
-
from .letta_response_messages_item import (
|
|
56
|
-
LettaResponseMessagesItem,
|
|
57
|
-
LettaResponseMessagesItem_AssistantMessage,
|
|
58
|
-
LettaResponseMessagesItem_ReasoningMessage,
|
|
59
|
-
LettaResponseMessagesItem_SystemMessage,
|
|
60
|
-
LettaResponseMessagesItem_ToolCallMessage,
|
|
61
|
-
LettaResponseMessagesItem_ToolReturnMessage,
|
|
62
|
-
LettaResponseMessagesItem_UserMessage,
|
|
63
|
-
)
|
|
64
63
|
from .letta_schemas_letta_message_tool_call import LettaSchemasLettaMessageToolCall
|
|
65
64
|
from .letta_schemas_message_message import LettaSchemasMessageMessage
|
|
66
65
|
from .letta_schemas_openai_chat_completion_request_tool import LettaSchemasOpenaiChatCompletionRequestTool
|
|
@@ -92,7 +91,6 @@ from .organization_create import OrganizationCreate
|
|
|
92
91
|
from .passage import Passage
|
|
93
92
|
from .provider import Provider
|
|
94
93
|
from .reasoning_message import ReasoningMessage
|
|
95
|
-
from .recall_memory_summary import RecallMemorySummary
|
|
96
94
|
from .response_format import ResponseFormat
|
|
97
95
|
from .run import Run
|
|
98
96
|
from .sandbox_config import SandboxConfig
|
|
@@ -141,7 +139,6 @@ __all__ = [
|
|
|
141
139
|
"AppAuthScheme",
|
|
142
140
|
"AppAuthSchemeAuthMode",
|
|
143
141
|
"AppModel",
|
|
144
|
-
"ArchivalMemorySummary",
|
|
145
142
|
"AssistantFile",
|
|
146
143
|
"AssistantMessageInput",
|
|
147
144
|
"AssistantMessageOutput",
|
|
@@ -180,16 +177,16 @@ __all__ = [
|
|
|
180
177
|
"Job",
|
|
181
178
|
"JobStatus",
|
|
182
179
|
"JobType",
|
|
180
|
+
"LettaMessageUnion",
|
|
181
|
+
"LettaMessageUnion_AssistantMessage",
|
|
182
|
+
"LettaMessageUnion_ReasoningMessage",
|
|
183
|
+
"LettaMessageUnion_SystemMessage",
|
|
184
|
+
"LettaMessageUnion_ToolCallMessage",
|
|
185
|
+
"LettaMessageUnion_ToolReturnMessage",
|
|
186
|
+
"LettaMessageUnion_UserMessage",
|
|
183
187
|
"LettaRequest",
|
|
184
188
|
"LettaRequestConfig",
|
|
185
189
|
"LettaResponse",
|
|
186
|
-
"LettaResponseMessagesItem",
|
|
187
|
-
"LettaResponseMessagesItem_AssistantMessage",
|
|
188
|
-
"LettaResponseMessagesItem_ReasoningMessage",
|
|
189
|
-
"LettaResponseMessagesItem_SystemMessage",
|
|
190
|
-
"LettaResponseMessagesItem_ToolCallMessage",
|
|
191
|
-
"LettaResponseMessagesItem_ToolReturnMessage",
|
|
192
|
-
"LettaResponseMessagesItem_UserMessage",
|
|
193
190
|
"LettaSchemasLettaMessageToolCall",
|
|
194
191
|
"LettaSchemasMessageMessage",
|
|
195
192
|
"LettaSchemasOpenaiChatCompletionRequestTool",
|
|
@@ -219,7 +216,6 @@ __all__ = [
|
|
|
219
216
|
"Passage",
|
|
220
217
|
"Provider",
|
|
221
218
|
"ReasoningMessage",
|
|
222
|
-
"RecallMemorySummary",
|
|
223
219
|
"ResponseFormat",
|
|
224
220
|
"Run",
|
|
225
221
|
"SandboxConfig",
|
|
@@ -12,7 +12,7 @@ import typing_extensions
|
|
|
12
12
|
from ..core.unchecked_base_model import UnionMetadata
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class
|
|
15
|
+
class LettaMessageUnion_SystemMessage(UncheckedBaseModel):
|
|
16
16
|
message_type: typing.Literal["system_message"] = "system_message"
|
|
17
17
|
id: str
|
|
18
18
|
date: dt.datetime
|
|
@@ -28,7 +28,7 @@ class LettaResponseMessagesItem_SystemMessage(UncheckedBaseModel):
|
|
|
28
28
|
extra = pydantic.Extra.allow
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
class
|
|
31
|
+
class LettaMessageUnion_UserMessage(UncheckedBaseModel):
|
|
32
32
|
message_type: typing.Literal["user_message"] = "user_message"
|
|
33
33
|
id: str
|
|
34
34
|
date: dt.datetime
|
|
@@ -44,7 +44,7 @@ class LettaResponseMessagesItem_UserMessage(UncheckedBaseModel):
|
|
|
44
44
|
extra = pydantic.Extra.allow
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
class
|
|
47
|
+
class LettaMessageUnion_ReasoningMessage(UncheckedBaseModel):
|
|
48
48
|
message_type: typing.Literal["reasoning_message"] = "reasoning_message"
|
|
49
49
|
id: str
|
|
50
50
|
date: dt.datetime
|
|
@@ -60,7 +60,7 @@ class LettaResponseMessagesItem_ReasoningMessage(UncheckedBaseModel):
|
|
|
60
60
|
extra = pydantic.Extra.allow
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
class
|
|
63
|
+
class LettaMessageUnion_ToolCallMessage(UncheckedBaseModel):
|
|
64
64
|
message_type: typing.Literal["tool_call_message"] = "tool_call_message"
|
|
65
65
|
id: str
|
|
66
66
|
date: dt.datetime
|
|
@@ -76,7 +76,7 @@ class LettaResponseMessagesItem_ToolCallMessage(UncheckedBaseModel):
|
|
|
76
76
|
extra = pydantic.Extra.allow
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
class
|
|
79
|
+
class LettaMessageUnion_ToolReturnMessage(UncheckedBaseModel):
|
|
80
80
|
message_type: typing.Literal["tool_return_message"] = "tool_return_message"
|
|
81
81
|
id: str
|
|
82
82
|
date: dt.datetime
|
|
@@ -96,7 +96,7 @@ class LettaResponseMessagesItem_ToolReturnMessage(UncheckedBaseModel):
|
|
|
96
96
|
extra = pydantic.Extra.allow
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
class
|
|
99
|
+
class LettaMessageUnion_AssistantMessage(UncheckedBaseModel):
|
|
100
100
|
message_type: typing.Literal["assistant_message"] = "assistant_message"
|
|
101
101
|
id: str
|
|
102
102
|
date: dt.datetime
|
|
@@ -112,14 +112,14 @@ class LettaResponseMessagesItem_AssistantMessage(UncheckedBaseModel):
|
|
|
112
112
|
extra = pydantic.Extra.allow
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
LettaMessageUnion = typing_extensions.Annotated[
|
|
116
116
|
typing.Union[
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
LettaMessageUnion_SystemMessage,
|
|
118
|
+
LettaMessageUnion_UserMessage,
|
|
119
|
+
LettaMessageUnion_ReasoningMessage,
|
|
120
|
+
LettaMessageUnion_ToolCallMessage,
|
|
121
|
+
LettaMessageUnion_ToolReturnMessage,
|
|
122
|
+
LettaMessageUnion_AssistantMessage,
|
|
123
123
|
],
|
|
124
124
|
UnionMetadata(discriminant="message_type"),
|
|
125
125
|
]
|