letta-client 0.1.295__py3-none-any.whl → 0.1.299__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.

Files changed (43) hide show
  1. letta_client/__init__.py +12 -0
  2. letta_client/agents/__init__.py +2 -0
  3. letta_client/agents/client.py +100 -0
  4. letta_client/agents/messages/__init__.py +2 -0
  5. letta_client/agents/messages/client.py +17 -15
  6. letta_client/agents/messages/raw_client.py +23 -21
  7. letta_client/agents/messages/types/__init__.py +2 -0
  8. letta_client/agents/messages/types/letta_async_request_messages_item.py +8 -0
  9. letta_client/agents/messages/types/messages_modify_response.py +4 -0
  10. letta_client/agents/raw_client.py +122 -0
  11. letta_client/agents/tools/client.py +74 -0
  12. letta_client/agents/tools/raw_client.py +60 -0
  13. letta_client/core/client_wrapper.py +2 -2
  14. letta_client/groups/messages/client.py +12 -11
  15. letta_client/groups/messages/raw_client.py +16 -15
  16. letta_client/groups/messages/types/messages_modify_response.py +4 -0
  17. letta_client/templates/client.py +20 -0
  18. letta_client/templates/raw_client.py +20 -0
  19. letta_client/tools/client.py +30 -0
  20. letta_client/tools/raw_client.py +30 -0
  21. letta_client/types/__init__.py +12 -0
  22. letta_client/types/approval_create.py +42 -0
  23. letta_client/types/approval_request_message.py +45 -0
  24. letta_client/types/approval_response_message.py +56 -0
  25. letta_client/types/letta_batch_request.py +2 -2
  26. letta_client/types/letta_batch_request_messages_item.py +8 -0
  27. letta_client/types/letta_message_union.py +4 -0
  28. letta_client/types/letta_request.py +2 -2
  29. letta_client/types/letta_request_messages_item.py +8 -0
  30. letta_client/types/letta_schemas_agent_file_message_schema.py +5 -0
  31. letta_client/types/letta_schemas_agent_file_tool_schema.py +5 -0
  32. letta_client/types/letta_streaming_request.py +3 -3
  33. letta_client/types/letta_streaming_request_messages_item.py +8 -0
  34. letta_client/types/message_create.py +5 -0
  35. letta_client/types/message_role.py +1 -1
  36. letta_client/types/message_type.py +2 -0
  37. letta_client/types/passage.py +5 -0
  38. letta_client/types/stop_reason_type.py +1 -0
  39. letta_client/types/tool.py +5 -0
  40. letta_client/types/tool_create.py +5 -0
  41. {letta_client-0.1.295.dist-info → letta_client-0.1.299.dist-info}/METADATA +1 -1
  42. {letta_client-0.1.295.dist-info → letta_client-0.1.299.dist-info}/RECORD +43 -36
  43. {letta_client-0.1.295.dist-info → letta_client-0.1.299.dist-info}/WHEEL +0 -0
@@ -35,7 +35,9 @@ class RawTemplatesClient:
35
35
  self,
36
36
  *,
37
37
  offset: typing.Optional[str] = None,
38
+ exact: typing.Optional[str] = None,
38
39
  limit: typing.Optional[str] = None,
40
+ version: typing.Optional[str] = None,
39
41
  template_id: typing.Optional[str] = None,
40
42
  name: typing.Optional[str] = None,
41
43
  search: typing.Optional[str] = None,
@@ -51,8 +53,14 @@ class RawTemplatesClient:
51
53
  ----------
52
54
  offset : typing.Optional[str]
53
55
 
56
+ exact : typing.Optional[str]
57
+ Whether to search for an exact name match
58
+
54
59
  limit : typing.Optional[str]
55
60
 
61
+ version : typing.Optional[str]
62
+ Specify the version you want to return, otherwise will return the latest version
63
+
56
64
  template_id : typing.Optional[str]
57
65
 
58
66
  name : typing.Optional[str]
@@ -78,7 +86,9 @@ class RawTemplatesClient:
78
86
  method="GET",
79
87
  params={
80
88
  "offset": offset,
89
+ "exact": exact,
81
90
  "limit": limit,
91
+ "version": version,
82
92
  "template_id": template_id,
83
93
  "name": name,
84
94
  "search": search,
@@ -590,7 +600,9 @@ class AsyncRawTemplatesClient:
590
600
  self,
591
601
  *,
592
602
  offset: typing.Optional[str] = None,
603
+ exact: typing.Optional[str] = None,
593
604
  limit: typing.Optional[str] = None,
605
+ version: typing.Optional[str] = None,
594
606
  template_id: typing.Optional[str] = None,
595
607
  name: typing.Optional[str] = None,
596
608
  search: typing.Optional[str] = None,
@@ -606,8 +618,14 @@ class AsyncRawTemplatesClient:
606
618
  ----------
607
619
  offset : typing.Optional[str]
608
620
 
621
+ exact : typing.Optional[str]
622
+ Whether to search for an exact name match
623
+
609
624
  limit : typing.Optional[str]
610
625
 
626
+ version : typing.Optional[str]
627
+ Specify the version you want to return, otherwise will return the latest version
628
+
611
629
  template_id : typing.Optional[str]
612
630
 
613
631
  name : typing.Optional[str]
@@ -633,7 +651,9 @@ class AsyncRawTemplatesClient:
633
651
  method="GET",
634
652
  params={
635
653
  "offset": offset,
654
+ "exact": exact,
636
655
  "limit": limit,
656
+ "version": version,
637
657
  "template_id": template_id,
638
658
  "name": name,
639
659
  "search": search,
@@ -119,6 +119,7 @@ class ToolsClient:
119
119
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
120
120
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
121
121
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
122
+ default_requires_approval: typing.Optional[bool] = OMIT,
122
123
  request_options: typing.Optional[RequestOptions] = None,
123
124
  ) -> Tool:
124
125
  """
@@ -158,6 +159,9 @@ class ToolsClient:
158
159
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
159
160
  A dictionary of additional metadata for the tool.
160
161
 
162
+ default_requires_approval : typing.Optional[bool]
163
+ Whether or not to require approval before executing this tool.
164
+
161
165
  request_options : typing.Optional[RequestOptions]
162
166
  Request-specific configuration.
163
167
 
@@ -190,6 +194,7 @@ class ToolsClient:
190
194
  pip_requirements=pip_requirements,
191
195
  npm_requirements=npm_requirements,
192
196
  metadata=metadata,
197
+ default_requires_approval=default_requires_approval,
193
198
  request_options=request_options,
194
199
  )
195
200
  return _response.data
@@ -281,6 +286,7 @@ class ToolsClient:
281
286
  return_char_limit: typing.Optional[int] = OMIT,
282
287
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
283
288
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
289
+ default_requires_approval: typing.Optional[bool] = OMIT,
284
290
  request_options: typing.Optional[RequestOptions] = None,
285
291
  ) -> Tool:
286
292
  """
@@ -315,6 +321,9 @@ class ToolsClient:
315
321
  npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
316
322
  Optional list of npm packages required by this tool.
317
323
 
324
+ default_requires_approval : typing.Optional[bool]
325
+ Whether or not to require approval before executing this tool.
326
+
318
327
  request_options : typing.Optional[RequestOptions]
319
328
  Request-specific configuration.
320
329
 
@@ -345,6 +354,7 @@ class ToolsClient:
345
354
  return_char_limit=return_char_limit,
346
355
  pip_requirements=pip_requirements,
347
356
  npm_requirements=npm_requirements,
357
+ default_requires_approval=default_requires_approval,
348
358
  request_options=request_options,
349
359
  )
350
360
  return _response.data
@@ -361,6 +371,7 @@ class ToolsClient:
361
371
  return_char_limit: typing.Optional[int] = OMIT,
362
372
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
363
373
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
374
+ default_requires_approval: typing.Optional[bool] = OMIT,
364
375
  request_options: typing.Optional[RequestOptions] = None,
365
376
  ) -> Tool:
366
377
  """
@@ -395,6 +406,9 @@ class ToolsClient:
395
406
  npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
396
407
  Optional list of npm packages required by this tool.
397
408
 
409
+ default_requires_approval : typing.Optional[bool]
410
+ Whether or not to require approval before executing this tool.
411
+
398
412
  request_options : typing.Optional[RequestOptions]
399
413
  Request-specific configuration.
400
414
 
@@ -425,6 +439,7 @@ class ToolsClient:
425
439
  return_char_limit=return_char_limit,
426
440
  pip_requirements=pip_requirements,
427
441
  npm_requirements=npm_requirements,
442
+ default_requires_approval=default_requires_approval,
428
443
  request_options=request_options,
429
444
  )
430
445
  return _response.data
@@ -1034,6 +1049,7 @@ class AsyncToolsClient:
1034
1049
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
1035
1050
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
1036
1051
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1052
+ default_requires_approval: typing.Optional[bool] = OMIT,
1037
1053
  request_options: typing.Optional[RequestOptions] = None,
1038
1054
  ) -> Tool:
1039
1055
  """
@@ -1073,6 +1089,9 @@ class AsyncToolsClient:
1073
1089
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1074
1090
  A dictionary of additional metadata for the tool.
1075
1091
 
1092
+ default_requires_approval : typing.Optional[bool]
1093
+ Whether or not to require approval before executing this tool.
1094
+
1076
1095
  request_options : typing.Optional[RequestOptions]
1077
1096
  Request-specific configuration.
1078
1097
 
@@ -1113,6 +1132,7 @@ class AsyncToolsClient:
1113
1132
  pip_requirements=pip_requirements,
1114
1133
  npm_requirements=npm_requirements,
1115
1134
  metadata=metadata,
1135
+ default_requires_approval=default_requires_approval,
1116
1136
  request_options=request_options,
1117
1137
  )
1118
1138
  return _response.data
@@ -1220,6 +1240,7 @@ class AsyncToolsClient:
1220
1240
  return_char_limit: typing.Optional[int] = OMIT,
1221
1241
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
1222
1242
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
1243
+ default_requires_approval: typing.Optional[bool] = OMIT,
1223
1244
  request_options: typing.Optional[RequestOptions] = None,
1224
1245
  ) -> Tool:
1225
1246
  """
@@ -1254,6 +1275,9 @@ class AsyncToolsClient:
1254
1275
  npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
1255
1276
  Optional list of npm packages required by this tool.
1256
1277
 
1278
+ default_requires_approval : typing.Optional[bool]
1279
+ Whether or not to require approval before executing this tool.
1280
+
1257
1281
  request_options : typing.Optional[RequestOptions]
1258
1282
  Request-specific configuration.
1259
1283
 
@@ -1292,6 +1316,7 @@ class AsyncToolsClient:
1292
1316
  return_char_limit=return_char_limit,
1293
1317
  pip_requirements=pip_requirements,
1294
1318
  npm_requirements=npm_requirements,
1319
+ default_requires_approval=default_requires_approval,
1295
1320
  request_options=request_options,
1296
1321
  )
1297
1322
  return _response.data
@@ -1308,6 +1333,7 @@ class AsyncToolsClient:
1308
1333
  return_char_limit: typing.Optional[int] = OMIT,
1309
1334
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
1310
1335
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
1336
+ default_requires_approval: typing.Optional[bool] = OMIT,
1311
1337
  request_options: typing.Optional[RequestOptions] = None,
1312
1338
  ) -> Tool:
1313
1339
  """
@@ -1342,6 +1368,9 @@ class AsyncToolsClient:
1342
1368
  npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
1343
1369
  Optional list of npm packages required by this tool.
1344
1370
 
1371
+ default_requires_approval : typing.Optional[bool]
1372
+ Whether or not to require approval before executing this tool.
1373
+
1345
1374
  request_options : typing.Optional[RequestOptions]
1346
1375
  Request-specific configuration.
1347
1376
 
@@ -1380,6 +1409,7 @@ class AsyncToolsClient:
1380
1409
  return_char_limit=return_char_limit,
1381
1410
  pip_requirements=pip_requirements,
1382
1411
  npm_requirements=npm_requirements,
1412
+ default_requires_approval=default_requires_approval,
1383
1413
  request_options=request_options,
1384
1414
  )
1385
1415
  return _response.data
@@ -152,6 +152,7 @@ class RawToolsClient:
152
152
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
153
153
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
154
154
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
155
+ default_requires_approval: typing.Optional[bool] = OMIT,
155
156
  request_options: typing.Optional[RequestOptions] = None,
156
157
  ) -> HttpResponse[Tool]:
157
158
  """
@@ -191,6 +192,9 @@ class RawToolsClient:
191
192
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
192
193
  A dictionary of additional metadata for the tool.
193
194
 
195
+ default_requires_approval : typing.Optional[bool]
196
+ Whether or not to require approval before executing this tool.
197
+
194
198
  request_options : typing.Optional[RequestOptions]
195
199
  Request-specific configuration.
196
200
 
@@ -217,6 +221,7 @@ class RawToolsClient:
217
221
  object_=npm_requirements, annotation=typing.Sequence[NpmRequirement], direction="write"
218
222
  ),
219
223
  "metadata_": metadata,
224
+ "default_requires_approval": default_requires_approval,
220
225
  },
221
226
  headers={
222
227
  "content-type": "application/json",
@@ -381,6 +386,7 @@ class RawToolsClient:
381
386
  return_char_limit: typing.Optional[int] = OMIT,
382
387
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
383
388
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
389
+ default_requires_approval: typing.Optional[bool] = OMIT,
384
390
  request_options: typing.Optional[RequestOptions] = None,
385
391
  ) -> HttpResponse[Tool]:
386
392
  """
@@ -415,6 +421,9 @@ class RawToolsClient:
415
421
  npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
416
422
  Optional list of npm packages required by this tool.
417
423
 
424
+ default_requires_approval : typing.Optional[bool]
425
+ Whether or not to require approval before executing this tool.
426
+
418
427
  request_options : typing.Optional[RequestOptions]
419
428
  Request-specific configuration.
420
429
 
@@ -440,6 +449,7 @@ class RawToolsClient:
440
449
  "npm_requirements": convert_and_respect_annotation_metadata(
441
450
  object_=npm_requirements, annotation=typing.Sequence[NpmRequirement], direction="write"
442
451
  ),
452
+ "default_requires_approval": default_requires_approval,
443
453
  },
444
454
  headers={
445
455
  "content-type": "application/json",
@@ -485,6 +495,7 @@ class RawToolsClient:
485
495
  return_char_limit: typing.Optional[int] = OMIT,
486
496
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
487
497
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
498
+ default_requires_approval: typing.Optional[bool] = OMIT,
488
499
  request_options: typing.Optional[RequestOptions] = None,
489
500
  ) -> HttpResponse[Tool]:
490
501
  """
@@ -519,6 +530,9 @@ class RawToolsClient:
519
530
  npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
520
531
  Optional list of npm packages required by this tool.
521
532
 
533
+ default_requires_approval : typing.Optional[bool]
534
+ Whether or not to require approval before executing this tool.
535
+
522
536
  request_options : typing.Optional[RequestOptions]
523
537
  Request-specific configuration.
524
538
 
@@ -544,6 +558,7 @@ class RawToolsClient:
544
558
  "npm_requirements": convert_and_respect_annotation_metadata(
545
559
  object_=npm_requirements, annotation=typing.Sequence[NpmRequirement], direction="write"
546
560
  ),
561
+ "default_requires_approval": default_requires_approval,
547
562
  },
548
563
  headers={
549
564
  "content-type": "application/json",
@@ -1451,6 +1466,7 @@ class AsyncRawToolsClient:
1451
1466
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
1452
1467
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
1453
1468
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1469
+ default_requires_approval: typing.Optional[bool] = OMIT,
1454
1470
  request_options: typing.Optional[RequestOptions] = None,
1455
1471
  ) -> AsyncHttpResponse[Tool]:
1456
1472
  """
@@ -1490,6 +1506,9 @@ class AsyncRawToolsClient:
1490
1506
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1491
1507
  A dictionary of additional metadata for the tool.
1492
1508
 
1509
+ default_requires_approval : typing.Optional[bool]
1510
+ Whether or not to require approval before executing this tool.
1511
+
1493
1512
  request_options : typing.Optional[RequestOptions]
1494
1513
  Request-specific configuration.
1495
1514
 
@@ -1516,6 +1535,7 @@ class AsyncRawToolsClient:
1516
1535
  object_=npm_requirements, annotation=typing.Sequence[NpmRequirement], direction="write"
1517
1536
  ),
1518
1537
  "metadata_": metadata,
1538
+ "default_requires_approval": default_requires_approval,
1519
1539
  },
1520
1540
  headers={
1521
1541
  "content-type": "application/json",
@@ -1680,6 +1700,7 @@ class AsyncRawToolsClient:
1680
1700
  return_char_limit: typing.Optional[int] = OMIT,
1681
1701
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
1682
1702
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
1703
+ default_requires_approval: typing.Optional[bool] = OMIT,
1683
1704
  request_options: typing.Optional[RequestOptions] = None,
1684
1705
  ) -> AsyncHttpResponse[Tool]:
1685
1706
  """
@@ -1714,6 +1735,9 @@ class AsyncRawToolsClient:
1714
1735
  npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
1715
1736
  Optional list of npm packages required by this tool.
1716
1737
 
1738
+ default_requires_approval : typing.Optional[bool]
1739
+ Whether or not to require approval before executing this tool.
1740
+
1717
1741
  request_options : typing.Optional[RequestOptions]
1718
1742
  Request-specific configuration.
1719
1743
 
@@ -1739,6 +1763,7 @@ class AsyncRawToolsClient:
1739
1763
  "npm_requirements": convert_and_respect_annotation_metadata(
1740
1764
  object_=npm_requirements, annotation=typing.Sequence[NpmRequirement], direction="write"
1741
1765
  ),
1766
+ "default_requires_approval": default_requires_approval,
1742
1767
  },
1743
1768
  headers={
1744
1769
  "content-type": "application/json",
@@ -1784,6 +1809,7 @@ class AsyncRawToolsClient:
1784
1809
  return_char_limit: typing.Optional[int] = OMIT,
1785
1810
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
1786
1811
  npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
1812
+ default_requires_approval: typing.Optional[bool] = OMIT,
1787
1813
  request_options: typing.Optional[RequestOptions] = None,
1788
1814
  ) -> AsyncHttpResponse[Tool]:
1789
1815
  """
@@ -1818,6 +1844,9 @@ class AsyncRawToolsClient:
1818
1844
  npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
1819
1845
  Optional list of npm packages required by this tool.
1820
1846
 
1847
+ default_requires_approval : typing.Optional[bool]
1848
+ Whether or not to require approval before executing this tool.
1849
+
1821
1850
  request_options : typing.Optional[RequestOptions]
1822
1851
  Request-specific configuration.
1823
1852
 
@@ -1843,6 +1872,7 @@ class AsyncRawToolsClient:
1843
1872
  "npm_requirements": convert_and_respect_annotation_metadata(
1844
1873
  object_=npm_requirements, annotation=typing.Sequence[NpmRequirement], direction="write"
1845
1874
  ),
1875
+ "default_requires_approval": default_requires_approval,
1846
1876
  },
1847
1877
  headers={
1848
1878
  "content-type": "application/json",
@@ -15,6 +15,9 @@ from .agent_type import AgentType
15
15
  from .app_auth_scheme import AppAuthScheme
16
16
  from .app_auth_scheme_auth_mode import AppAuthSchemeAuthMode
17
17
  from .app_model import AppModel
18
+ from .approval_create import ApprovalCreate
19
+ from .approval_request_message import ApprovalRequestMessage
20
+ from .approval_response_message import ApprovalResponseMessage
18
21
  from .assistant_message import AssistantMessage
19
22
  from .assistant_message_content import AssistantMessageContent
20
23
  from .audio import Audio
@@ -155,12 +158,14 @@ from .json_schema import JsonSchema
155
158
  from .json_schema_response_format import JsonSchemaResponseFormat
156
159
  from .letta_batch_messages import LettaBatchMessages
157
160
  from .letta_batch_request import LettaBatchRequest
161
+ from .letta_batch_request_messages_item import LettaBatchRequestMessagesItem
158
162
  from .letta_image import LettaImage
159
163
  from .letta_message_content_union import LettaMessageContentUnion
160
164
  from .letta_message_union import LettaMessageUnion
161
165
  from .letta_ping import LettaPing
162
166
  from .letta_request import LettaRequest
163
167
  from .letta_request_config import LettaRequestConfig
168
+ from .letta_request_messages_item import LettaRequestMessagesItem
164
169
  from .letta_response import LettaResponse
165
170
  from .letta_schemas_agent_file_agent_schema import LettaSchemasAgentFileAgentSchema
166
171
  from .letta_schemas_agent_file_agent_schema_response_format import LettaSchemasAgentFileAgentSchemaResponseFormat
@@ -182,6 +187,7 @@ from .letta_serialize_schemas_pydantic_agent_schema_tool_schema import (
182
187
  )
183
188
  from .letta_stop_reason import LettaStopReason
184
189
  from .letta_streaming_request import LettaStreamingRequest
190
+ from .letta_streaming_request_messages_item import LettaStreamingRequestMessagesItem
185
191
  from .letta_usage_statistics import LettaUsageStatistics
186
192
  from .letta_user_message_content_union import LettaUserMessageContentUnion
187
193
  from .llm_config import LlmConfig
@@ -348,6 +354,9 @@ __all__ = [
348
354
  "AppAuthScheme",
349
355
  "AppAuthSchemeAuthMode",
350
356
  "AppModel",
357
+ "ApprovalCreate",
358
+ "ApprovalRequestMessage",
359
+ "ApprovalResponseMessage",
351
360
  "AssistantMessage",
352
361
  "AssistantMessageContent",
353
362
  "Audio",
@@ -488,12 +497,14 @@ __all__ = [
488
497
  "JsonSchemaResponseFormat",
489
498
  "LettaBatchMessages",
490
499
  "LettaBatchRequest",
500
+ "LettaBatchRequestMessagesItem",
491
501
  "LettaImage",
492
502
  "LettaMessageContentUnion",
493
503
  "LettaMessageUnion",
494
504
  "LettaPing",
495
505
  "LettaRequest",
496
506
  "LettaRequestConfig",
507
+ "LettaRequestMessagesItem",
497
508
  "LettaResponse",
498
509
  "LettaSchemasAgentFileAgentSchema",
499
510
  "LettaSchemasAgentFileAgentSchemaResponseFormat",
@@ -507,6 +518,7 @@ __all__ = [
507
518
  "LettaSerializeSchemasPydanticAgentSchemaToolSchema",
508
519
  "LettaStopReason",
509
520
  "LettaStreamingRequest",
521
+ "LettaStreamingRequestMessagesItem",
510
522
  "LettaUsageStatistics",
511
523
  "LettaUserMessageContentUnion",
512
524
  "LlmConfig",
@@ -0,0 +1,42 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ from ..core.unchecked_base_model import UncheckedBaseModel
8
+
9
+
10
+ class ApprovalCreate(UncheckedBaseModel):
11
+ """
12
+ Input to approve or deny a tool call request
13
+ """
14
+
15
+ type: typing.Optional[typing.Literal["approval"]] = pydantic.Field(default=None)
16
+ """
17
+ The message type to be created.
18
+ """
19
+
20
+ approve: bool = pydantic.Field()
21
+ """
22
+ Whether the tool has been approved
23
+ """
24
+
25
+ approval_request_id: str = pydantic.Field()
26
+ """
27
+ The message ID of the approval request
28
+ """
29
+
30
+ reason: typing.Optional[str] = pydantic.Field(default=None)
31
+ """
32
+ An optional explanation for the provided approval status
33
+ """
34
+
35
+ if IS_PYDANTIC_V2:
36
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
37
+ else:
38
+
39
+ class Config:
40
+ frozen = True
41
+ smart_union = True
42
+ extra = pydantic.Extra.allow
@@ -0,0 +1,45 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.unchecked_base_model import UncheckedBaseModel
9
+ from .tool_call import ToolCall
10
+
11
+
12
+ class ApprovalRequestMessage(UncheckedBaseModel):
13
+ """
14
+ A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
15
+
16
+ Args:
17
+ id (str): The ID of the message
18
+ date (datetime): The date the message was created in ISO format
19
+ name (Optional[str]): The name of the sender of the message
20
+ tool_call (ToolCall): The tool call
21
+ """
22
+
23
+ id: str
24
+ date: dt.datetime
25
+ name: typing.Optional[str] = None
26
+ message_type: typing.Literal["approval_request_message"] = "approval_request_message"
27
+ otid: typing.Optional[str] = None
28
+ sender_id: typing.Optional[str] = None
29
+ step_id: typing.Optional[str] = None
30
+ is_err: typing.Optional[bool] = None
31
+ seq_id: typing.Optional[int] = None
32
+ run_id: typing.Optional[str] = None
33
+ tool_call: ToolCall = pydantic.Field()
34
+ """
35
+ The tool call that has been requested by the llm to run
36
+ """
37
+
38
+ if IS_PYDANTIC_V2:
39
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
40
+ else:
41
+
42
+ class Config:
43
+ frozen = True
44
+ smart_union = True
45
+ extra = pydantic.Extra.allow
@@ -0,0 +1,56 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.unchecked_base_model import UncheckedBaseModel
9
+
10
+
11
+ class ApprovalResponseMessage(UncheckedBaseModel):
12
+ """
13
+ A message representing a response form the user indicating whether a tool has been approved to run.
14
+
15
+ Args:
16
+ id (str): The ID of the message
17
+ date (datetime): The date the message was created in ISO format
18
+ name (Optional[str]): The name of the sender of the message
19
+ approve: (bool) Whether the tool has been approved
20
+ approval_request_id: The ID of the approval request
21
+ reason: (Optional[str]) An optional explanation for the provided approval status
22
+ """
23
+
24
+ id: str
25
+ date: dt.datetime
26
+ name: typing.Optional[str] = None
27
+ message_type: typing.Literal["approval_response_message"] = "approval_response_message"
28
+ otid: typing.Optional[str] = None
29
+ sender_id: typing.Optional[str] = None
30
+ step_id: typing.Optional[str] = None
31
+ is_err: typing.Optional[bool] = None
32
+ seq_id: typing.Optional[int] = None
33
+ run_id: typing.Optional[str] = None
34
+ approve: bool = pydantic.Field()
35
+ """
36
+ Whether the tool has been approved
37
+ """
38
+
39
+ approval_request_id: str = pydantic.Field()
40
+ """
41
+ The message ID of the approval request
42
+ """
43
+
44
+ reason: typing.Optional[str] = pydantic.Field(default=None)
45
+ """
46
+ An optional explanation for the provided approval status
47
+ """
48
+
49
+ if IS_PYDANTIC_V2:
50
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
51
+ else:
52
+
53
+ class Config:
54
+ frozen = True
55
+ smart_union = True
56
+ extra = pydantic.Extra.allow
@@ -5,12 +5,12 @@ import typing
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
7
  from ..core.unchecked_base_model import UncheckedBaseModel
8
- from .message_create import MessageCreate
8
+ from .letta_batch_request_messages_item import LettaBatchRequestMessagesItem
9
9
  from .message_type import MessageType
10
10
 
11
11
 
12
12
  class LettaBatchRequest(UncheckedBaseModel):
13
- messages: typing.List[MessageCreate] = pydantic.Field()
13
+ messages: typing.List[LettaBatchRequestMessagesItem] = pydantic.Field()
14
14
  """
15
15
  The messages to be sent to the agent.
16
16
  """
@@ -0,0 +1,8 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .approval_create import ApprovalCreate
6
+ from .message_create import MessageCreate
7
+
8
+ LettaBatchRequestMessagesItem = typing.Union[MessageCreate, ApprovalCreate]
@@ -2,6 +2,8 @@
2
2
 
3
3
  import typing
4
4
 
5
+ from .approval_request_message import ApprovalRequestMessage
6
+ from .approval_response_message import ApprovalResponseMessage
5
7
  from .assistant_message import AssistantMessage
6
8
  from .hidden_reasoning_message import HiddenReasoningMessage
7
9
  from .reasoning_message import ReasoningMessage
@@ -18,4 +20,6 @@ LettaMessageUnion = typing.Union[
18
20
  ToolCallMessage,
19
21
  ToolReturnMessage,
20
22
  AssistantMessage,
23
+ ApprovalRequestMessage,
24
+ ApprovalResponseMessage,
21
25
  ]
@@ -5,12 +5,12 @@ import typing
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
7
  from ..core.unchecked_base_model import UncheckedBaseModel
8
- from .message_create import MessageCreate
8
+ from .letta_request_messages_item import LettaRequestMessagesItem
9
9
  from .message_type import MessageType
10
10
 
11
11
 
12
12
  class LettaRequest(UncheckedBaseModel):
13
- messages: typing.List[MessageCreate] = pydantic.Field()
13
+ messages: typing.List[LettaRequestMessagesItem] = pydantic.Field()
14
14
  """
15
15
  The messages to be sent to the agent.
16
16
  """
@@ -0,0 +1,8 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .approval_create import ApprovalCreate
6
+ from .message_create import MessageCreate
7
+
8
+ LettaRequestMessagesItem = typing.Union[MessageCreate, ApprovalCreate]
@@ -17,6 +17,11 @@ class LettaSchemasAgentFileMessageSchema(UncheckedBaseModel):
17
17
  Message with human-readable ID for agent file
18
18
  """
19
19
 
20
+ type: typing.Optional[typing.Literal["message"]] = pydantic.Field(default=None)
21
+ """
22
+ The message type to be created.
23
+ """
24
+
20
25
  role: MessageRole = pydantic.Field()
21
26
  """
22
27
  The role of the participant.
@@ -77,6 +77,11 @@ class LettaSchemasAgentFileToolSchema(UncheckedBaseModel):
77
77
  Optional list of npm packages required by this tool.
78
78
  """
79
79
 
80
+ default_requires_approval: typing.Optional[bool] = pydantic.Field(default=None)
81
+ """
82
+ Default value for whether or not executing this tool requires approval.
83
+ """
84
+
80
85
  created_by_id: typing.Optional[str] = pydantic.Field(default=None)
81
86
  """
82
87
  The id of the user that made this Tool.