letta-client 0.1.319__py3-none-any.whl → 0.1.321__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 (211) hide show
  1. letta_client/__init__.py +51 -9
  2. letta_client/agents/__init__.py +6 -2
  3. letta_client/agents/client.py +50 -213
  4. letta_client/agents/files/client.py +51 -6
  5. letta_client/agents/files/raw_client.py +94 -9
  6. letta_client/agents/messages/__init__.py +2 -2
  7. letta_client/agents/messages/client.py +104 -24
  8. letta_client/agents/messages/raw_client.py +109 -17
  9. letta_client/agents/messages/types/__init__.py +2 -2
  10. letta_client/agents/messages/types/{messages_preview_raw_payload_request.py → messages_preview_request.py} +1 -1
  11. letta_client/agents/raw_client.py +50 -253
  12. letta_client/agents/types/__init__.py +4 -0
  13. letta_client/agents/types/agents_list_request_order.py +5 -0
  14. letta_client/agents/types/agents_list_request_order_by.py +5 -0
  15. letta_client/archives/__init__.py +7 -0
  16. letta_client/archives/client.py +362 -0
  17. letta_client/archives/raw_client.py +448 -0
  18. letta_client/archives/types/__init__.py +7 -0
  19. letta_client/archives/types/list_archives_request_order.py +5 -0
  20. letta_client/base_client.py +3 -6
  21. letta_client/batches/__init__.py +5 -0
  22. letta_client/batches/client.py +68 -8
  23. letta_client/batches/messages/__init__.py +7 -0
  24. letta_client/{messages → batches/messages}/client.py +50 -43
  25. letta_client/{messages → batches/messages}/raw_client.py +52 -45
  26. letta_client/batches/messages/types/__init__.py +7 -0
  27. letta_client/batches/messages/types/messages_list_request_order.py +5 -0
  28. letta_client/batches/raw_client.py +71 -6
  29. letta_client/batches/types/__init__.py +7 -0
  30. letta_client/batches/types/batches_list_request_order.py +5 -0
  31. letta_client/blocks/__init__.py +3 -1
  32. letta_client/blocks/agents/__init__.py +3 -0
  33. letta_client/blocks/agents/client.py +57 -2
  34. letta_client/blocks/agents/raw_client.py +51 -0
  35. letta_client/blocks/agents/types/__init__.py +7 -0
  36. letta_client/blocks/agents/types/agents_list_request_order.py +5 -0
  37. letta_client/blocks/client.py +25 -4
  38. letta_client/blocks/raw_client.py +25 -4
  39. letta_client/blocks/types/__init__.py +7 -0
  40. letta_client/blocks/types/blocks_list_request_order.py +5 -0
  41. letta_client/core/client_wrapper.py +2 -2
  42. letta_client/errors/__init__.py +9 -1
  43. letta_client/errors/internal_server_error.py +10 -0
  44. letta_client/folders/__init__.py +14 -2
  45. letta_client/folders/agents/__init__.py +7 -0
  46. letta_client/folders/agents/client.py +176 -0
  47. letta_client/folders/agents/raw_client.py +182 -0
  48. letta_client/folders/agents/types/__init__.py +7 -0
  49. letta_client/folders/agents/types/agents_list_request_order.py +5 -0
  50. letta_client/folders/client.py +96 -86
  51. letta_client/folders/files/__init__.py +3 -0
  52. letta_client/folders/files/client.py +49 -10
  53. letta_client/folders/files/raw_client.py +41 -10
  54. letta_client/folders/files/types/__init__.py +7 -0
  55. letta_client/folders/files/types/files_list_request_order.py +5 -0
  56. letta_client/folders/passages/__init__.py +3 -0
  57. letta_client/folders/passages/client.py +43 -14
  58. letta_client/folders/passages/raw_client.py +35 -14
  59. letta_client/folders/passages/types/__init__.py +7 -0
  60. letta_client/folders/passages/types/passages_list_request_order.py +5 -0
  61. letta_client/folders/raw_client.py +83 -104
  62. letta_client/folders/types/__init__.py +7 -0
  63. letta_client/folders/types/folders_list_request_order.py +5 -0
  64. letta_client/groups/__init__.py +4 -2
  65. letta_client/groups/client.py +27 -6
  66. letta_client/groups/messages/__init__.py +2 -2
  67. letta_client/groups/messages/client.py +39 -18
  68. letta_client/groups/messages/raw_client.py +35 -14
  69. letta_client/groups/messages/types/__init__.py +2 -1
  70. letta_client/groups/messages/types/messages_list_request_order.py +5 -0
  71. letta_client/groups/raw_client.py +27 -6
  72. letta_client/groups/types/__init__.py +2 -1
  73. letta_client/groups/types/groups_list_request_order.py +5 -0
  74. letta_client/identities/__init__.py +12 -2
  75. letta_client/identities/agents/__init__.py +7 -0
  76. letta_client/identities/agents/client.py +177 -0
  77. letta_client/identities/agents/raw_client.py +183 -0
  78. letta_client/identities/agents/types/__init__.py +7 -0
  79. letta_client/identities/agents/types/agents_list_request_order.py +5 -0
  80. letta_client/identities/blocks/__init__.py +7 -0
  81. letta_client/identities/blocks/client.py +177 -0
  82. letta_client/identities/blocks/raw_client.py +183 -0
  83. letta_client/identities/blocks/types/__init__.py +7 -0
  84. letta_client/identities/blocks/types/blocks_list_request_order.py +5 -0
  85. letta_client/identities/client.py +37 -0
  86. letta_client/identities/raw_client.py +27 -0
  87. letta_client/identities/types/__init__.py +7 -0
  88. letta_client/identities/types/identities_list_request_order.py +5 -0
  89. letta_client/jobs/client.py +10 -2
  90. letta_client/jobs/raw_client.py +10 -2
  91. letta_client/models/__init__.py +3 -0
  92. letta_client/models/client.py +3 -0
  93. letta_client/{embedding_models → models/embeddings}/client.py +14 -14
  94. letta_client/{embedding_models → models/embeddings}/raw_client.py +10 -10
  95. letta_client/providers/__init__.py +3 -0
  96. letta_client/providers/client.py +151 -82
  97. letta_client/providers/raw_client.py +165 -72
  98. letta_client/providers/types/__init__.py +7 -0
  99. letta_client/providers/types/providers_list_request_order.py +5 -0
  100. letta_client/runs/__init__.py +2 -1
  101. letta_client/runs/client.py +39 -8
  102. letta_client/runs/messages/__init__.py +3 -0
  103. letta_client/runs/messages/client.py +15 -49
  104. letta_client/runs/messages/raw_client.py +13 -49
  105. letta_client/runs/messages/types/__init__.py +7 -0
  106. letta_client/runs/messages/types/messages_list_request_order.py +5 -0
  107. letta_client/runs/raw_client.py +39 -8
  108. letta_client/steps/__init__.py +13 -3
  109. letta_client/steps/client.py +32 -83
  110. letta_client/steps/feedback/client.py +21 -6
  111. letta_client/steps/feedback/raw_client.py +29 -6
  112. letta_client/steps/messages/__init__.py +7 -0
  113. letta_client/steps/messages/client.py +177 -0
  114. letta_client/steps/messages/raw_client.py +183 -0
  115. letta_client/steps/messages/types/__init__.py +8 -0
  116. letta_client/steps/messages/types/messages_list_request_order.py +5 -0
  117. letta_client/steps/messages/types/messages_list_response_item.py +25 -0
  118. letta_client/steps/metrics/client.py +110 -0
  119. letta_client/steps/metrics/raw_client.py +122 -0
  120. letta_client/steps/raw_client.py +17 -107
  121. letta_client/steps/trace/__init__.py +4 -0
  122. letta_client/steps/trace/client.py +110 -0
  123. letta_client/steps/trace/raw_client.py +122 -0
  124. letta_client/steps/types/__init__.py +2 -1
  125. letta_client/steps/types/steps_list_request_order.py +5 -0
  126. letta_client/tags/__init__.py +3 -0
  127. letta_client/tags/client.py +57 -4
  128. letta_client/tags/raw_client.py +49 -2
  129. letta_client/tags/types/__init__.py +7 -0
  130. letta_client/tags/types/tags_list_request_order.py +5 -0
  131. letta_client/telemetry/client.py +8 -0
  132. letta_client/telemetry/raw_client.py +8 -0
  133. letta_client/templates/__init__.py +64 -0
  134. letta_client/templates/agents/__init__.py +58 -0
  135. letta_client/templates/agents/types/__init__.py +66 -0
  136. letta_client/templates/agents/types/agents_create_response.py +6 -0
  137. letta_client/templates/agents/types/agents_create_response_group.py +52 -0
  138. letta_client/templates/agents/types/agents_create_response_group_base_template_id.py +12 -0
  139. letta_client/templates/agents/types/agents_create_response_group_base_template_id_item.py +5 -0
  140. letta_client/templates/agents/types/agents_create_response_group_deployment_id.py +12 -0
  141. letta_client/templates/agents/types/agents_create_response_group_deployment_id_item.py +5 -0
  142. letta_client/templates/agents/types/agents_create_response_group_hidden.py +12 -0
  143. letta_client/templates/agents/types/agents_create_response_group_hidden_item.py +5 -0
  144. letta_client/templates/agents/types/agents_create_response_group_last_processed_message_id.py +14 -0
  145. letta_client/templates/agents/types/agents_create_response_group_last_processed_message_id_item.py +5 -0
  146. letta_client/templates/agents/types/agents_create_response_group_manager_agent_id.py +12 -0
  147. letta_client/templates/agents/types/agents_create_response_group_manager_agent_id_item.py +5 -0
  148. letta_client/templates/agents/types/agents_create_response_group_manager_type.py +7 -0
  149. letta_client/templates/agents/types/agents_create_response_group_max_message_buffer_length.py +14 -0
  150. letta_client/templates/agents/types/agents_create_response_group_max_message_buffer_length_item.py +5 -0
  151. letta_client/templates/agents/types/agents_create_response_group_max_turns.py +12 -0
  152. letta_client/templates/agents/types/agents_create_response_group_max_turns_item.py +5 -0
  153. letta_client/templates/agents/types/agents_create_response_group_min_message_buffer_length.py +14 -0
  154. letta_client/templates/agents/types/agents_create_response_group_min_message_buffer_length_item.py +5 -0
  155. letta_client/templates/agents/types/agents_create_response_group_project_id.py +12 -0
  156. letta_client/templates/agents/types/agents_create_response_group_project_id_item.py +5 -0
  157. letta_client/templates/agents/types/agents_create_response_group_shared_block_ids.py +5 -0
  158. letta_client/templates/agents/types/agents_create_response_group_sleeptime_agent_frequency.py +14 -0
  159. letta_client/templates/agents/types/agents_create_response_group_sleeptime_agent_frequency_item.py +5 -0
  160. letta_client/templates/agents/types/agents_create_response_group_template_id.py +12 -0
  161. letta_client/templates/agents/types/agents_create_response_group_template_id_item.py +5 -0
  162. letta_client/templates/agents/types/agents_create_response_group_termination_token.py +12 -0
  163. letta_client/templates/agents/types/agents_create_response_group_termination_token_item.py +5 -0
  164. letta_client/templates/agents/types/agents_create_response_group_turns_counter.py +12 -0
  165. letta_client/templates/agents/types/agents_create_response_group_turns_counter_item.py +5 -0
  166. letta_client/templates/client.py +260 -0
  167. letta_client/templates/raw_client.py +395 -0
  168. letta_client/templates/types/__init__.py +8 -0
  169. letta_client/templates/types/templates_get_template_snapshot_response.py +4 -0
  170. letta_client/templates/types/templates_get_template_snapshot_response_blocks_item.py +1 -0
  171. letta_client/templates/types/templates_get_template_snapshot_response_relationships_item.py +23 -0
  172. letta_client/templates/types/templates_migrate_deployment_response.py +21 -0
  173. letta_client/templates/types/templates_set_current_template_from_snapshot_response.py +21 -0
  174. letta_client/tools/__init__.py +2 -0
  175. letta_client/tools/client.py +47 -20
  176. letta_client/tools/raw_client.py +43 -26
  177. letta_client/tools/types/__init__.py +2 -0
  178. letta_client/tools/types/tools_list_request_order.py +5 -0
  179. letta_client/types/__init__.py +10 -2
  180. letta_client/types/agent_state.py +5 -0
  181. letta_client/types/archive.py +77 -0
  182. letta_client/types/batch_job.py +16 -0
  183. letta_client/types/{body_export_agent_serialized.py → body_export_agent.py} +1 -1
  184. letta_client/types/child_tool_rule.py +1 -1
  185. letta_client/types/conditional_tool_rule.py +1 -1
  186. letta_client/types/continue_tool_rule.py +1 -1
  187. letta_client/types/deployment_entity.py +2 -0
  188. letta_client/types/init_tool_rule.py +1 -1
  189. letta_client/types/internal_server_error_body.py +20 -0
  190. letta_client/types/internal_template_agent_create.py +5 -0
  191. letta_client/types/job.py +16 -0
  192. letta_client/types/letta_schemas_agent_file_agent_schema.py +5 -0
  193. letta_client/types/max_count_per_step_tool_rule.py +1 -1
  194. letta_client/types/memory.py +7 -1
  195. letta_client/types/memory_agent_type.py +7 -0
  196. letta_client/types/parent_tool_rule.py +1 -1
  197. letta_client/types/required_before_exit_tool_rule.py +1 -1
  198. letta_client/types/requires_approval_tool_rule.py +1 -1
  199. letta_client/types/run.py +16 -0
  200. letta_client/types/source.py +6 -0
  201. letta_client/types/step.py +1 -1
  202. letta_client/types/stop_reason_type.py +1 -0
  203. letta_client/types/terminal_tool_rule.py +1 -1
  204. letta_client/types/vector_db_provider.py +5 -0
  205. letta_client/voice/client.py +2 -8
  206. letta_client/voice/raw_client.py +0 -8
  207. {letta_client-0.1.319.dist-info → letta_client-0.1.321.dist-info}/METADATA +9 -9
  208. {letta_client-0.1.319.dist-info → letta_client-0.1.321.dist-info}/RECORD +211 -114
  209. /letta_client/{embedding_models → models/embeddings}/__init__.py +0 -0
  210. /letta_client/{messages → steps/metrics}/__init__.py +0 -0
  211. {letta_client-0.1.319.dist-info → letta_client-0.1.321.dist-info}/WHEEL +0 -0
@@ -14,6 +14,7 @@ from ..errors.unprocessable_entity_error import UnprocessableEntityError
14
14
  from ..types.batch_job import BatchJob
15
15
  from ..types.http_validation_error import HttpValidationError
16
16
  from ..types.letta_batch_request import LettaBatchRequest
17
+ from .types.batches_list_request_order import BatchesListRequestOrder
17
18
 
18
19
  # this is used as the default value for optional parameters
19
20
  OMIT = typing.cast(typing.Any, ...)
@@ -23,12 +24,36 @@ class RawBatchesClient:
23
24
  def __init__(self, *, client_wrapper: SyncClientWrapper):
24
25
  self._client_wrapper = client_wrapper
25
26
 
26
- def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[typing.List[BatchJob]]:
27
+ def list(
28
+ self,
29
+ *,
30
+ before: typing.Optional[str] = None,
31
+ after: typing.Optional[str] = None,
32
+ limit: typing.Optional[int] = None,
33
+ order: typing.Optional[BatchesListRequestOrder] = None,
34
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
35
+ request_options: typing.Optional[RequestOptions] = None,
36
+ ) -> HttpResponse[typing.List[BatchJob]]:
27
37
  """
28
38
  List all batch runs.
29
39
 
30
40
  Parameters
31
41
  ----------
42
+ before : typing.Optional[str]
43
+ Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order
44
+
45
+ after : typing.Optional[str]
46
+ Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order
47
+
48
+ limit : typing.Optional[int]
49
+ Maximum number of jobs to return
50
+
51
+ order : typing.Optional[BatchesListRequestOrder]
52
+ Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
53
+
54
+ order_by : typing.Optional[typing.Literal["created_at"]]
55
+ Field to sort by
56
+
32
57
  request_options : typing.Optional[RequestOptions]
33
58
  Request-specific configuration.
34
59
 
@@ -40,6 +65,13 @@ class RawBatchesClient:
40
65
  _response = self._client_wrapper.httpx_client.request(
41
66
  "v1/messages/batches",
42
67
  method="GET",
68
+ params={
69
+ "before": before,
70
+ "after": after,
71
+ "limit": limit,
72
+ "order": order,
73
+ "order_by": order_by,
74
+ },
43
75
  request_options=request_options,
44
76
  )
45
77
  try:
@@ -76,8 +108,10 @@ class RawBatchesClient:
76
108
  request_options: typing.Optional[RequestOptions] = None,
77
109
  ) -> HttpResponse[BatchJob]:
78
110
  """
79
- Submit a batch of agent messages for asynchronous processing.
111
+ Submit a batch of agent runs for asynchronous processing.
112
+
80
113
  Creates a job that will fan out messages to all listed agents and process them in parallel.
114
+ The request will be rejected if it exceeds 256MB.
81
115
 
82
116
  Parameters
83
117
  ----------
@@ -140,7 +174,7 @@ class RawBatchesClient:
140
174
  self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None
141
175
  ) -> HttpResponse[BatchJob]:
142
176
  """
143
- Get the status of a batch run.
177
+ Retrieve the status and details of a batch run.
144
178
 
145
179
  Parameters
146
180
  ----------
@@ -242,13 +276,35 @@ class AsyncRawBatchesClient:
242
276
  self._client_wrapper = client_wrapper
243
277
 
244
278
  async def list(
245
- self, *, request_options: typing.Optional[RequestOptions] = None
279
+ self,
280
+ *,
281
+ before: typing.Optional[str] = None,
282
+ after: typing.Optional[str] = None,
283
+ limit: typing.Optional[int] = None,
284
+ order: typing.Optional[BatchesListRequestOrder] = None,
285
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
286
+ request_options: typing.Optional[RequestOptions] = None,
246
287
  ) -> AsyncHttpResponse[typing.List[BatchJob]]:
247
288
  """
248
289
  List all batch runs.
249
290
 
250
291
  Parameters
251
292
  ----------
293
+ before : typing.Optional[str]
294
+ Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order
295
+
296
+ after : typing.Optional[str]
297
+ Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order
298
+
299
+ limit : typing.Optional[int]
300
+ Maximum number of jobs to return
301
+
302
+ order : typing.Optional[BatchesListRequestOrder]
303
+ Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
304
+
305
+ order_by : typing.Optional[typing.Literal["created_at"]]
306
+ Field to sort by
307
+
252
308
  request_options : typing.Optional[RequestOptions]
253
309
  Request-specific configuration.
254
310
 
@@ -260,6 +316,13 @@ class AsyncRawBatchesClient:
260
316
  _response = await self._client_wrapper.httpx_client.request(
261
317
  "v1/messages/batches",
262
318
  method="GET",
319
+ params={
320
+ "before": before,
321
+ "after": after,
322
+ "limit": limit,
323
+ "order": order,
324
+ "order_by": order_by,
325
+ },
263
326
  request_options=request_options,
264
327
  )
265
328
  try:
@@ -296,8 +359,10 @@ class AsyncRawBatchesClient:
296
359
  request_options: typing.Optional[RequestOptions] = None,
297
360
  ) -> AsyncHttpResponse[BatchJob]:
298
361
  """
299
- Submit a batch of agent messages for asynchronous processing.
362
+ Submit a batch of agent runs for asynchronous processing.
363
+
300
364
  Creates a job that will fan out messages to all listed agents and process them in parallel.
365
+ The request will be rejected if it exceeds 256MB.
301
366
 
302
367
  Parameters
303
368
  ----------
@@ -360,7 +425,7 @@ class AsyncRawBatchesClient:
360
425
  self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None
361
426
  ) -> AsyncHttpResponse[BatchJob]:
362
427
  """
363
- Get the status of a batch run.
428
+ Retrieve the status and details of a batch run.
364
429
 
365
430
  Parameters
366
431
  ----------
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .batches_list_request_order import BatchesListRequestOrder
6
+
7
+ __all__ = ["BatchesListRequestOrder"]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ BatchesListRequestOrder = typing.Union[typing.Literal["asc", "desc"], typing.Any]
@@ -2,6 +2,8 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
+ from .types import BlocksListRequestOrder
5
6
  from . import agents
7
+ from .agents import AgentsListRequestOrder
6
8
 
7
- __all__ = ["agents"]
9
+ __all__ = ["AgentsListRequestOrder", "BlocksListRequestOrder", "agents"]
@@ -2,3 +2,6 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
+ from .types import AgentsListRequestOrder
6
+
7
+ __all__ = ["AgentsListRequestOrder"]
@@ -6,6 +6,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ...core.request_options import RequestOptions
7
7
  from ...types.agent_state import AgentState
8
8
  from .raw_client import AsyncRawAgentsClient, RawAgentsClient
9
+ from .types.agents_list_request_order import AgentsListRequestOrder
9
10
 
10
11
 
11
12
  class AgentsClient:
@@ -27,6 +28,11 @@ class AgentsClient:
27
28
  self,
28
29
  block_id: str,
29
30
  *,
31
+ before: typing.Optional[str] = None,
32
+ after: typing.Optional[str] = None,
33
+ limit: typing.Optional[int] = None,
34
+ order: typing.Optional[AgentsListRequestOrder] = None,
35
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
30
36
  include_relationships: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
31
37
  request_options: typing.Optional[RequestOptions] = None,
32
38
  ) -> typing.List[AgentState]:
@@ -38,6 +44,21 @@ class AgentsClient:
38
44
  ----------
39
45
  block_id : str
40
46
 
47
+ before : typing.Optional[str]
48
+ Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order
49
+
50
+ after : typing.Optional[str]
51
+ Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order
52
+
53
+ limit : typing.Optional[int]
54
+ Maximum number of agents to return
55
+
56
+ order : typing.Optional[AgentsListRequestOrder]
57
+ Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
58
+
59
+ order_by : typing.Optional[typing.Literal["created_at"]]
60
+ Field to sort by
61
+
41
62
  include_relationships : typing.Optional[typing.Union[str, typing.Sequence[str]]]
42
63
  Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.
43
64
 
@@ -62,7 +83,14 @@ class AgentsClient:
62
83
  )
63
84
  """
64
85
  _response = self._raw_client.list(
65
- block_id, include_relationships=include_relationships, request_options=request_options
86
+ block_id,
87
+ before=before,
88
+ after=after,
89
+ limit=limit,
90
+ order=order,
91
+ order_by=order_by,
92
+ include_relationships=include_relationships,
93
+ request_options=request_options,
66
94
  )
67
95
  return _response.data
68
96
 
@@ -86,6 +114,11 @@ class AsyncAgentsClient:
86
114
  self,
87
115
  block_id: str,
88
116
  *,
117
+ before: typing.Optional[str] = None,
118
+ after: typing.Optional[str] = None,
119
+ limit: typing.Optional[int] = None,
120
+ order: typing.Optional[AgentsListRequestOrder] = None,
121
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
89
122
  include_relationships: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
90
123
  request_options: typing.Optional[RequestOptions] = None,
91
124
  ) -> typing.List[AgentState]:
@@ -97,6 +130,21 @@ class AsyncAgentsClient:
97
130
  ----------
98
131
  block_id : str
99
132
 
133
+ before : typing.Optional[str]
134
+ Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order
135
+
136
+ after : typing.Optional[str]
137
+ Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order
138
+
139
+ limit : typing.Optional[int]
140
+ Maximum number of agents to return
141
+
142
+ order : typing.Optional[AgentsListRequestOrder]
143
+ Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
144
+
145
+ order_by : typing.Optional[typing.Literal["created_at"]]
146
+ Field to sort by
147
+
100
148
  include_relationships : typing.Optional[typing.Union[str, typing.Sequence[str]]]
101
149
  Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.
102
150
 
@@ -129,6 +177,13 @@ class AsyncAgentsClient:
129
177
  asyncio.run(main())
130
178
  """
131
179
  _response = await self._raw_client.list(
132
- block_id, include_relationships=include_relationships, request_options=request_options
180
+ block_id,
181
+ before=before,
182
+ after=after,
183
+ limit=limit,
184
+ order=order,
185
+ order_by=order_by,
186
+ include_relationships=include_relationships,
187
+ request_options=request_options,
133
188
  )
134
189
  return _response.data
@@ -12,6 +12,7 @@ from ...core.unchecked_base_model import construct_type
12
12
  from ...errors.unprocessable_entity_error import UnprocessableEntityError
13
13
  from ...types.agent_state import AgentState
14
14
  from ...types.http_validation_error import HttpValidationError
15
+ from .types.agents_list_request_order import AgentsListRequestOrder
15
16
 
16
17
 
17
18
  class RawAgentsClient:
@@ -22,6 +23,11 @@ class RawAgentsClient:
22
23
  self,
23
24
  block_id: str,
24
25
  *,
26
+ before: typing.Optional[str] = None,
27
+ after: typing.Optional[str] = None,
28
+ limit: typing.Optional[int] = None,
29
+ order: typing.Optional[AgentsListRequestOrder] = None,
30
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
25
31
  include_relationships: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
26
32
  request_options: typing.Optional[RequestOptions] = None,
27
33
  ) -> HttpResponse[typing.List[AgentState]]:
@@ -33,6 +39,21 @@ class RawAgentsClient:
33
39
  ----------
34
40
  block_id : str
35
41
 
42
+ before : typing.Optional[str]
43
+ Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order
44
+
45
+ after : typing.Optional[str]
46
+ Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order
47
+
48
+ limit : typing.Optional[int]
49
+ Maximum number of agents to return
50
+
51
+ order : typing.Optional[AgentsListRequestOrder]
52
+ Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
53
+
54
+ order_by : typing.Optional[typing.Literal["created_at"]]
55
+ Field to sort by
56
+
36
57
  include_relationships : typing.Optional[typing.Union[str, typing.Sequence[str]]]
37
58
  Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.
38
59
 
@@ -48,6 +69,11 @@ class RawAgentsClient:
48
69
  f"v1/blocks/{jsonable_encoder(block_id)}/agents",
49
70
  method="GET",
50
71
  params={
72
+ "before": before,
73
+ "after": after,
74
+ "limit": limit,
75
+ "order": order,
76
+ "order_by": order_by,
51
77
  "include_relationships": include_relationships,
52
78
  },
53
79
  request_options=request_options,
@@ -87,6 +113,11 @@ class AsyncRawAgentsClient:
87
113
  self,
88
114
  block_id: str,
89
115
  *,
116
+ before: typing.Optional[str] = None,
117
+ after: typing.Optional[str] = None,
118
+ limit: typing.Optional[int] = None,
119
+ order: typing.Optional[AgentsListRequestOrder] = None,
120
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
90
121
  include_relationships: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
91
122
  request_options: typing.Optional[RequestOptions] = None,
92
123
  ) -> AsyncHttpResponse[typing.List[AgentState]]:
@@ -98,6 +129,21 @@ class AsyncRawAgentsClient:
98
129
  ----------
99
130
  block_id : str
100
131
 
132
+ before : typing.Optional[str]
133
+ Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order
134
+
135
+ after : typing.Optional[str]
136
+ Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order
137
+
138
+ limit : typing.Optional[int]
139
+ Maximum number of agents to return
140
+
141
+ order : typing.Optional[AgentsListRequestOrder]
142
+ Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
143
+
144
+ order_by : typing.Optional[typing.Literal["created_at"]]
145
+ Field to sort by
146
+
101
147
  include_relationships : typing.Optional[typing.Union[str, typing.Sequence[str]]]
102
148
  Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.
103
149
 
@@ -113,6 +159,11 @@ class AsyncRawAgentsClient:
113
159
  f"v1/blocks/{jsonable_encoder(block_id)}/agents",
114
160
  method="GET",
115
161
  params={
162
+ "before": before,
163
+ "after": after,
164
+ "limit": limit,
165
+ "order": order,
166
+ "order_by": order_by,
116
167
  "include_relationships": include_relationships,
117
168
  },
118
169
  request_options=request_options,
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .agents_list_request_order import AgentsListRequestOrder
6
+
7
+ __all__ = ["AgentsListRequestOrder"]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ AgentsListRequestOrder = typing.Union[typing.Literal["asc", "desc"], typing.Any]
@@ -7,6 +7,7 @@ from ..core.request_options import RequestOptions
7
7
  from ..types.block import Block
8
8
  from .agents.client import AgentsClient, AsyncAgentsClient
9
9
  from .raw_client import AsyncRawBlocksClient, RawBlocksClient
10
+ from .types.blocks_list_request_order import BlocksListRequestOrder
10
11
 
11
12
  # this is used as the default value for optional parameters
12
13
  OMIT = typing.cast(typing.Any, ...)
@@ -40,6 +41,8 @@ class BlocksClient:
40
41
  limit: typing.Optional[int] = None,
41
42
  before: typing.Optional[str] = None,
42
43
  after: typing.Optional[str] = None,
44
+ order: typing.Optional[BlocksListRequestOrder] = None,
45
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
43
46
  label_search: typing.Optional[str] = None,
44
47
  description_search: typing.Optional[str] = None,
45
48
  value_search: typing.Optional[str] = None,
@@ -73,10 +76,16 @@ class BlocksClient:
73
76
  Number of blocks to return
74
77
 
75
78
  before : typing.Optional[str]
76
- Cursor for pagination. If provided, returns blocks before this cursor.
79
+ Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
77
80
 
78
81
  after : typing.Optional[str]
79
- Cursor for pagination. If provided, returns blocks after this cursor.
82
+ Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
83
+
84
+ order : typing.Optional[BlocksListRequestOrder]
85
+ Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
86
+
87
+ order_by : typing.Optional[typing.Literal["created_at"]]
88
+ Field to sort by
80
89
 
81
90
  label_search : typing.Optional[str]
82
91
  Search blocks by label. If provided, returns blocks that match this label. This is a full-text search on labels.
@@ -124,6 +133,8 @@ class BlocksClient:
124
133
  limit=limit,
125
134
  before=before,
126
135
  after=after,
136
+ order=order,
137
+ order_by=order_by,
127
138
  label_search=label_search,
128
139
  description_search=description_search,
129
140
  value_search=value_search,
@@ -460,6 +471,8 @@ class AsyncBlocksClient:
460
471
  limit: typing.Optional[int] = None,
461
472
  before: typing.Optional[str] = None,
462
473
  after: typing.Optional[str] = None,
474
+ order: typing.Optional[BlocksListRequestOrder] = None,
475
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
463
476
  label_search: typing.Optional[str] = None,
464
477
  description_search: typing.Optional[str] = None,
465
478
  value_search: typing.Optional[str] = None,
@@ -493,10 +506,16 @@ class AsyncBlocksClient:
493
506
  Number of blocks to return
494
507
 
495
508
  before : typing.Optional[str]
496
- Cursor for pagination. If provided, returns blocks before this cursor.
509
+ Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
497
510
 
498
511
  after : typing.Optional[str]
499
- Cursor for pagination. If provided, returns blocks after this cursor.
512
+ Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
513
+
514
+ order : typing.Optional[BlocksListRequestOrder]
515
+ Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
516
+
517
+ order_by : typing.Optional[typing.Literal["created_at"]]
518
+ Field to sort by
500
519
 
501
520
  label_search : typing.Optional[str]
502
521
  Search blocks by label. If provided, returns blocks that match this label. This is a full-text search on labels.
@@ -552,6 +571,8 @@ class AsyncBlocksClient:
552
571
  limit=limit,
553
572
  before=before,
554
573
  after=after,
574
+ order=order,
575
+ order_by=order_by,
555
576
  label_search=label_search,
556
577
  description_search=description_search,
557
578
  value_search=value_search,
@@ -12,6 +12,7 @@ from ..core.unchecked_base_model import construct_type
12
12
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
13
13
  from ..types.block import Block
14
14
  from ..types.http_validation_error import HttpValidationError
15
+ from .types.blocks_list_request_order import BlocksListRequestOrder
15
16
 
16
17
  # this is used as the default value for optional parameters
17
18
  OMIT = typing.cast(typing.Any, ...)
@@ -33,6 +34,8 @@ class RawBlocksClient:
33
34
  limit: typing.Optional[int] = None,
34
35
  before: typing.Optional[str] = None,
35
36
  after: typing.Optional[str] = None,
37
+ order: typing.Optional[BlocksListRequestOrder] = None,
38
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
36
39
  label_search: typing.Optional[str] = None,
37
40
  description_search: typing.Optional[str] = None,
38
41
  value_search: typing.Optional[str] = None,
@@ -66,10 +69,16 @@ class RawBlocksClient:
66
69
  Number of blocks to return
67
70
 
68
71
  before : typing.Optional[str]
69
- Cursor for pagination. If provided, returns blocks before this cursor.
72
+ Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
70
73
 
71
74
  after : typing.Optional[str]
72
- Cursor for pagination. If provided, returns blocks after this cursor.
75
+ Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
76
+
77
+ order : typing.Optional[BlocksListRequestOrder]
78
+ Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
79
+
80
+ order_by : typing.Optional[typing.Literal["created_at"]]
81
+ Field to sort by
73
82
 
74
83
  label_search : typing.Optional[str]
75
84
  Search blocks by label. If provided, returns blocks that match this label. This is a full-text search on labels.
@@ -110,6 +119,8 @@ class RawBlocksClient:
110
119
  "limit": limit,
111
120
  "before": before,
112
121
  "after": after,
122
+ "order": order,
123
+ "order_by": order_by,
113
124
  "label_search": label_search,
114
125
  "description_search": description_search,
115
126
  "value_search": value_search,
@@ -551,6 +562,8 @@ class AsyncRawBlocksClient:
551
562
  limit: typing.Optional[int] = None,
552
563
  before: typing.Optional[str] = None,
553
564
  after: typing.Optional[str] = None,
565
+ order: typing.Optional[BlocksListRequestOrder] = None,
566
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
554
567
  label_search: typing.Optional[str] = None,
555
568
  description_search: typing.Optional[str] = None,
556
569
  value_search: typing.Optional[str] = None,
@@ -584,10 +597,16 @@ class AsyncRawBlocksClient:
584
597
  Number of blocks to return
585
598
 
586
599
  before : typing.Optional[str]
587
- Cursor for pagination. If provided, returns blocks before this cursor.
600
+ Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
588
601
 
589
602
  after : typing.Optional[str]
590
- Cursor for pagination. If provided, returns blocks after this cursor.
603
+ Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
604
+
605
+ order : typing.Optional[BlocksListRequestOrder]
606
+ Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
607
+
608
+ order_by : typing.Optional[typing.Literal["created_at"]]
609
+ Field to sort by
591
610
 
592
611
  label_search : typing.Optional[str]
593
612
  Search blocks by label. If provided, returns blocks that match this label. This is a full-text search on labels.
@@ -628,6 +647,8 @@ class AsyncRawBlocksClient:
628
647
  "limit": limit,
629
648
  "before": before,
630
649
  "after": after,
650
+ "order": order,
651
+ "order_by": order_by,
631
652
  "label_search": label_search,
632
653
  "description_search": description_search,
633
654
  "value_search": value_search,
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .blocks_list_request_order import BlocksListRequestOrder
6
+
7
+ __all__ = ["BlocksListRequestOrder"]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ BlocksListRequestOrder = typing.Union[typing.Literal["asc", "desc"], typing.Any]
@@ -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.319",
27
+ "User-Agent": "letta-client/0.1.321",
28
28
  "X-Fern-Language": "Python",
29
29
  "X-Fern-SDK-Name": "letta-client",
30
- "X-Fern-SDK-Version": "0.1.319",
30
+ "X-Fern-SDK-Version": "0.1.321",
31
31
  **(self.get_custom_headers() or {}),
32
32
  }
33
33
  if self._project is not None:
@@ -4,8 +4,16 @@
4
4
 
5
5
  from .bad_request_error import BadRequestError
6
6
  from .conflict_error import ConflictError
7
+ from .internal_server_error import InternalServerError
7
8
  from .not_found_error import NotFoundError
8
9
  from .payment_required_error import PaymentRequiredError
9
10
  from .unprocessable_entity_error import UnprocessableEntityError
10
11
 
11
- __all__ = ["BadRequestError", "ConflictError", "NotFoundError", "PaymentRequiredError", "UnprocessableEntityError"]
12
+ __all__ = [
13
+ "BadRequestError",
14
+ "ConflictError",
15
+ "InternalServerError",
16
+ "NotFoundError",
17
+ "PaymentRequiredError",
18
+ "UnprocessableEntityError",
19
+ ]
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+
7
+
8
+ class InternalServerError(ApiError):
9
+ def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
10
+ super().__init__(status_code=500, headers=headers, body=body)
@@ -2,6 +2,18 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
- from . import files, passages
5
+ from .types import FoldersListRequestOrder
6
+ from . import agents, files, passages
7
+ from .agents import AgentsListRequestOrder
8
+ from .files import FilesListRequestOrder
9
+ from .passages import PassagesListRequestOrder
6
10
 
7
- __all__ = ["files", "passages"]
11
+ __all__ = [
12
+ "AgentsListRequestOrder",
13
+ "FilesListRequestOrder",
14
+ "FoldersListRequestOrder",
15
+ "PassagesListRequestOrder",
16
+ "agents",
17
+ "files",
18
+ "passages",
19
+ ]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .types import AgentsListRequestOrder
6
+
7
+ __all__ = ["AgentsListRequestOrder"]