letta-client 1.0.0a1__py3-none-any.whl → 1.0.0a2__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 (202) hide show
  1. letta_client/__init__.py +149 -23
  2. letta_client/agents/__init__.py +15 -17
  3. letta_client/agents/blocks/__init__.py +3 -0
  4. letta_client/agents/blocks/client.py +77 -4
  5. letta_client/agents/blocks/raw_client.py +63 -2
  6. letta_client/agents/blocks/types/__init__.py +7 -0
  7. letta_client/agents/blocks/types/blocks_list_request_order.py +5 -0
  8. letta_client/agents/client.py +46 -13
  9. letta_client/agents/files/__init__.py +3 -0
  10. letta_client/agents/files/client.py +71 -10
  11. letta_client/agents/files/raw_client.py +51 -10
  12. letta_client/agents/files/types/__init__.py +7 -0
  13. letta_client/{types/tool_return_status.py → agents/files/types/files_list_request_order.py} +1 -1
  14. letta_client/agents/folders/__init__.py +3 -0
  15. letta_client/agents/folders/client.py +77 -4
  16. letta_client/agents/folders/raw_client.py +63 -2
  17. letta_client/agents/folders/types/__init__.py +7 -0
  18. letta_client/agents/folders/types/folders_list_request_order.py +5 -0
  19. letta_client/agents/groups/__init__.py +3 -0
  20. letta_client/agents/groups/client.py +71 -2
  21. letta_client/agents/groups/raw_client.py +51 -0
  22. letta_client/agents/groups/types/__init__.py +7 -0
  23. letta_client/agents/groups/types/groups_list_request_order.py +5 -0
  24. letta_client/agents/messages/__init__.py +2 -0
  25. letta_client/agents/messages/client.py +55 -14
  26. letta_client/agents/messages/raw_client.py +35 -14
  27. letta_client/agents/messages/types/__init__.py +2 -0
  28. letta_client/agents/messages/types/messages_list_request_order.py +5 -0
  29. letta_client/agents/passages/client.py +29 -0
  30. letta_client/agents/raw_client.py +4 -4
  31. letta_client/agents/sources/__init__.py +3 -0
  32. letta_client/agents/sources/client.py +77 -4
  33. letta_client/agents/sources/raw_client.py +63 -2
  34. letta_client/agents/sources/types/__init__.py +7 -0
  35. letta_client/agents/sources/types/sources_list_request_order.py +5 -0
  36. letta_client/agents/tools/__init__.py +3 -0
  37. letta_client/agents/tools/client.py +77 -4
  38. letta_client/agents/tools/raw_client.py +63 -2
  39. letta_client/agents/tools/types/__init__.py +7 -0
  40. letta_client/agents/tools/types/tools_list_request_order.py +5 -0
  41. letta_client/archives/client.py +16 -2
  42. letta_client/base_client.py +3 -0
  43. letta_client/batches/client.py +12 -2
  44. letta_client/batches/messages/client.py +10 -0
  45. letta_client/blocks/agents/client.py +8 -0
  46. letta_client/blocks/client.py +32 -2
  47. letta_client/chat/__init__.py +7 -0
  48. letta_client/chat/client.py +255 -0
  49. letta_client/chat/raw_client.py +269 -0
  50. letta_client/chat/types/__init__.py +8 -0
  51. letta_client/chat/types/chat_completion_request_messages_item.py +19 -0
  52. letta_client/chat/types/chat_completion_request_stop.py +5 -0
  53. letta_client/client_side_access_tokens/client.py +10 -2
  54. letta_client/core/client_wrapper.py +2 -2
  55. letta_client/errors/__init__.py +2 -0
  56. letta_client/errors/gone_error.py +10 -0
  57. letta_client/folders/agents/client.py +8 -0
  58. letta_client/folders/client.py +20 -4
  59. letta_client/folders/files/client.py +14 -0
  60. letta_client/folders/passages/client.py +8 -0
  61. letta_client/groups/client.py +16 -2
  62. letta_client/groups/messages/client.py +14 -0
  63. letta_client/identities/agents/client.py +8 -0
  64. letta_client/identities/blocks/client.py +8 -0
  65. letta_client/identities/client.py +20 -2
  66. letta_client/jobs/__init__.py +3 -0
  67. letta_client/jobs/client.py +61 -12
  68. letta_client/jobs/raw_client.py +29 -8
  69. letta_client/jobs/types/__init__.py +7 -0
  70. letta_client/jobs/types/jobs_list_request_order.py +5 -0
  71. letta_client/models/client.py +8 -2
  72. letta_client/projects/client.py +10 -2
  73. letta_client/providers/client.py +90 -2
  74. letta_client/providers/raw_client.py +102 -0
  75. letta_client/runs/__init__.py +11 -2
  76. letta_client/runs/client.py +150 -18
  77. letta_client/runs/messages/client.py +30 -2
  78. letta_client/runs/messages/raw_client.py +10 -0
  79. letta_client/runs/raw_client.py +144 -14
  80. letta_client/runs/steps/__init__.py +3 -0
  81. letta_client/runs/steps/client.py +39 -30
  82. letta_client/runs/steps/raw_client.py +19 -28
  83. letta_client/runs/steps/types/__init__.py +7 -0
  84. letta_client/runs/steps/types/steps_list_request_order.py +5 -0
  85. letta_client/runs/types/__init__.py +2 -1
  86. letta_client/runs/types/runs_list_request_order.py +5 -0
  87. letta_client/sources/client.py +8 -2
  88. letta_client/sources/files/client.py +12 -0
  89. letta_client/sources/passages/client.py +6 -0
  90. letta_client/steps/client.py +26 -2
  91. letta_client/steps/messages/client.py +8 -0
  92. letta_client/tags/client.py +16 -2
  93. letta_client/templates/__init__.py +12 -0
  94. letta_client/templates/client.py +30 -4
  95. letta_client/templates/raw_client.py +2 -2
  96. letta_client/templates/types/__init__.py +24 -0
  97. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config.py +4 -0
  98. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_display_name.py +14 -0
  99. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_display_name_item.py +5 -0
  100. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_secrets_item.py +4 -0
  101. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_secrets_item_value_enc.py +14 -0
  102. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_secrets_item_value_enc_item.py +5 -0
  103. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item.py +6 -0
  104. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_value_enc.py +16 -0
  105. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_value_enc_item.py +7 -0
  106. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_tool_type.py +1 -1
  107. letta_client/tools/client.py +30 -220
  108. letta_client/tools/raw_client.py +0 -292
  109. letta_client/types/__init__.py +130 -22
  110. letta_client/types/agent_environment_variable.py +5 -0
  111. letta_client/types/{action_parameters_model.py → annotation.py} +4 -10
  112. letta_client/types/{action_response_model.py → annotation_url_citation.py} +4 -9
  113. letta_client/types/approval_create.py +8 -2
  114. letta_client/types/approval_create_approvals_item.py +8 -0
  115. letta_client/types/approval_response_message.py +8 -2
  116. letta_client/types/approval_response_message_approvals_item.py +8 -0
  117. letta_client/types/approval_return.py +34 -0
  118. letta_client/{agents/templates/types/templates_migrate_response.py → types/audio.py} +4 -4
  119. letta_client/types/chat_completion.py +30 -0
  120. letta_client/types/chat_completion_assistant_message_param.py +30 -0
  121. letta_client/types/chat_completion_assistant_message_param_content.py +9 -0
  122. letta_client/types/chat_completion_assistant_message_param_content_item.py +10 -0
  123. letta_client/types/chat_completion_assistant_message_param_tool_calls_item.py +10 -0
  124. letta_client/types/chat_completion_audio.py +23 -0
  125. letta_client/types/chat_completion_content_part_image_param.py +22 -0
  126. letta_client/types/chat_completion_content_part_input_audio_param.py +22 -0
  127. letta_client/types/chat_completion_content_part_refusal_param.py +21 -0
  128. letta_client/types/chat_completion_content_part_text_param.py +21 -0
  129. letta_client/types/chat_completion_developer_message_param.py +23 -0
  130. letta_client/types/chat_completion_developer_message_param_content.py +7 -0
  131. letta_client/types/chat_completion_function_message_param.py +22 -0
  132. letta_client/types/chat_completion_message.py +30 -0
  133. letta_client/types/chat_completion_message_custom_tool_call.py +23 -0
  134. letta_client/types/chat_completion_message_custom_tool_call_param.py +23 -0
  135. letta_client/types/chat_completion_message_function_tool_call_input.py +25 -0
  136. letta_client/types/{chat_completion_message_function_tool_call.py → chat_completion_message_function_tool_call_output.py} +3 -3
  137. letta_client/types/chat_completion_message_function_tool_call_param.py +25 -0
  138. letta_client/types/chat_completion_message_tool_calls_item.py +10 -0
  139. letta_client/types/chat_completion_service_tier.py +5 -0
  140. letta_client/types/chat_completion_system_message_param.py +23 -0
  141. letta_client/types/chat_completion_system_message_param_content.py +7 -0
  142. letta_client/types/chat_completion_token_logprob.py +24 -0
  143. letta_client/types/chat_completion_tool_message_param.py +23 -0
  144. letta_client/types/chat_completion_tool_message_param_content.py +7 -0
  145. letta_client/types/chat_completion_user_message_param.py +23 -0
  146. letta_client/types/chat_completion_user_message_param_content.py +7 -0
  147. letta_client/types/chat_completion_user_message_param_content_item.py +15 -0
  148. letta_client/types/choice.py +26 -0
  149. letta_client/types/choice_finish_reason.py +7 -0
  150. letta_client/types/choice_logprobs.py +22 -0
  151. letta_client/types/completion_tokens_details.py +23 -0
  152. letta_client/types/{auth_scheme_field.py → completion_usage.py} +8 -13
  153. letta_client/types/custom_input.py +21 -0
  154. letta_client/types/custom_output.py +21 -0
  155. letta_client/types/file.py +22 -0
  156. letta_client/types/file_file.py +22 -0
  157. letta_client/types/function_call_input.py +21 -0
  158. letta_client/types/function_call_output.py +21 -0
  159. letta_client/types/{function.py → function_output.py} +1 -1
  160. letta_client/types/image_url.py +22 -0
  161. letta_client/types/image_url_detail.py +5 -0
  162. letta_client/types/input_audio.py +22 -0
  163. letta_client/types/input_audio_format.py +5 -0
  164. letta_client/types/internal_template_agent_create.py +2 -2
  165. letta_client/types/letta_schemas_agent_file_agent_schema.py +2 -2
  166. letta_client/types/letta_schemas_agent_file_message_schema.py +27 -4
  167. letta_client/types/letta_schemas_agent_file_message_schema_approvals_item.py +8 -0
  168. letta_client/types/letta_schemas_letta_message_tool_return.py +26 -0
  169. letta_client/types/letta_schemas_letta_message_tool_return_status.py +5 -0
  170. letta_client/types/{tool_return.py → letta_schemas_message_tool_return.py} +9 -3
  171. letta_client/types/letta_schemas_message_tool_return_status.py +5 -0
  172. letta_client/types/llm_config.py +5 -0
  173. letta_client/types/message.py +10 -4
  174. letta_client/types/message_approvals_item.py +8 -0
  175. letta_client/types/omitted_reasoning_content.py +4 -0
  176. letta_client/types/openai_types_chat_chat_completion_message_function_tool_call_function.py +21 -0
  177. letta_client/types/openai_types_chat_chat_completion_message_function_tool_call_param_function.py +21 -0
  178. letta_client/types/prompt_tokens_details.py +21 -0
  179. letta_client/types/provider.py +10 -0
  180. letta_client/types/run_metrics.py +58 -0
  181. letta_client/types/sandbox_environment_variable.py +5 -0
  182. letta_client/types/text_content.py +5 -0
  183. letta_client/types/tool_call_content.py +5 -0
  184. letta_client/types/tool_call_message.py +2 -0
  185. letta_client/types/tool_call_message_tool_calls.py +8 -0
  186. letta_client/types/tool_return_message.py +8 -5
  187. letta_client/types/tool_type.py +1 -1
  188. letta_client/types/top_logprob.py +22 -0
  189. letta_client/voice/client.py +14 -0
  190. letta_client/voice/raw_client.py +37 -0
  191. letta_client-1.0.0a2.dist-info/METADATA +422 -0
  192. {letta_client-1.0.0a1.dist-info → letta_client-1.0.0a2.dist-info}/RECORD +193 -115
  193. letta_client/agents/templates/__init__.py +0 -7
  194. letta_client/agents/templates/client.py +0 -307
  195. letta_client/agents/templates/raw_client.py +0 -275
  196. letta_client/agents/templates/types/__init__.py +0 -7
  197. letta_client/types/action_model.py +0 -39
  198. letta_client/types/app_auth_scheme.py +0 -35
  199. letta_client/types/app_auth_scheme_auth_mode.py +0 -19
  200. letta_client/types/app_model.py +0 -45
  201. letta_client-1.0.0a1.dist-info/METADATA +0 -211
  202. {letta_client-1.0.0a1.dist-info → letta_client-1.0.0a2.dist-info}/WHEEL +0 -0
@@ -7,6 +7,7 @@ from ...core.request_options import RequestOptions
7
7
  from ...types.agent_state import AgentState
8
8
  from ...types.block import Block
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, ...)
@@ -177,7 +178,17 @@ class BlocksClient:
177
178
  )
178
179
  return _response.data
179
180
 
180
- def list(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Block]:
181
+ def list(
182
+ self,
183
+ agent_id: str,
184
+ *,
185
+ before: typing.Optional[str] = None,
186
+ after: typing.Optional[str] = None,
187
+ limit: typing.Optional[int] = None,
188
+ order: typing.Optional[BlocksListRequestOrder] = None,
189
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
190
+ request_options: typing.Optional[RequestOptions] = None,
191
+ ) -> typing.List[Block]:
181
192
  """
182
193
  Retrieve the core memory blocks of a specific agent.
183
194
 
@@ -185,6 +196,21 @@ class BlocksClient:
185
196
  ----------
186
197
  agent_id : str
187
198
 
199
+ before : typing.Optional[str]
200
+ Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
201
+
202
+ after : typing.Optional[str]
203
+ Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
204
+
205
+ limit : typing.Optional[int]
206
+ Maximum number of blocks to return
207
+
208
+ order : typing.Optional[BlocksListRequestOrder]
209
+ Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
210
+
211
+ order_by : typing.Optional[typing.Literal["created_at"]]
212
+ Field to sort by
213
+
188
214
  request_options : typing.Optional[RequestOptions]
189
215
  Request-specific configuration.
190
216
 
@@ -203,9 +229,21 @@ class BlocksClient:
203
229
  )
204
230
  client.agents.blocks.list(
205
231
  agent_id="agent_id",
232
+ before="before",
233
+ after="after",
234
+ limit=1,
235
+ order="asc",
206
236
  )
207
237
  """
208
- _response = self._raw_client.list(agent_id, request_options=request_options)
238
+ _response = self._raw_client.list(
239
+ agent_id,
240
+ before=before,
241
+ after=after,
242
+ limit=limit,
243
+ order=order,
244
+ order_by=order_by,
245
+ request_options=request_options,
246
+ )
209
247
  return _response.data
210
248
 
211
249
  def attach(
@@ -463,7 +501,15 @@ class AsyncBlocksClient:
463
501
  return _response.data
464
502
 
465
503
  async def list(
466
- self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
504
+ self,
505
+ agent_id: str,
506
+ *,
507
+ before: typing.Optional[str] = None,
508
+ after: typing.Optional[str] = None,
509
+ limit: typing.Optional[int] = None,
510
+ order: typing.Optional[BlocksListRequestOrder] = None,
511
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
512
+ request_options: typing.Optional[RequestOptions] = None,
467
513
  ) -> typing.List[Block]:
468
514
  """
469
515
  Retrieve the core memory blocks of a specific agent.
@@ -472,6 +518,21 @@ class AsyncBlocksClient:
472
518
  ----------
473
519
  agent_id : str
474
520
 
521
+ before : typing.Optional[str]
522
+ Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
523
+
524
+ after : typing.Optional[str]
525
+ Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
526
+
527
+ limit : typing.Optional[int]
528
+ Maximum number of blocks to return
529
+
530
+ order : typing.Optional[BlocksListRequestOrder]
531
+ Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
532
+
533
+ order_by : typing.Optional[typing.Literal["created_at"]]
534
+ Field to sort by
535
+
475
536
  request_options : typing.Optional[RequestOptions]
476
537
  Request-specific configuration.
477
538
 
@@ -495,12 +556,24 @@ class AsyncBlocksClient:
495
556
  async def main() -> None:
496
557
  await client.agents.blocks.list(
497
558
  agent_id="agent_id",
559
+ before="before",
560
+ after="after",
561
+ limit=1,
562
+ order="asc",
498
563
  )
499
564
 
500
565
 
501
566
  asyncio.run(main())
502
567
  """
503
- _response = await self._raw_client.list(agent_id, request_options=request_options)
568
+ _response = await self._raw_client.list(
569
+ agent_id,
570
+ before=before,
571
+ after=after,
572
+ limit=limit,
573
+ order=order,
574
+ order_by=order_by,
575
+ request_options=request_options,
576
+ )
504
577
  return _response.data
505
578
 
506
579
  async def attach(
@@ -13,6 +13,7 @@ from ...errors.unprocessable_entity_error import UnprocessableEntityError
13
13
  from ...types.agent_state import AgentState
14
14
  from ...types.block import Block
15
15
  from ...types.http_validation_error import HttpValidationError
16
+ from .types.blocks_list_request_order import BlocksListRequestOrder
16
17
 
17
18
  # this is used as the default value for optional parameters
18
19
  OMIT = typing.cast(typing.Any, ...)
@@ -205,7 +206,15 @@ class RawBlocksClient:
205
206
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
206
207
 
207
208
  def list(
208
- self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
209
+ self,
210
+ agent_id: str,
211
+ *,
212
+ before: typing.Optional[str] = None,
213
+ after: typing.Optional[str] = None,
214
+ limit: typing.Optional[int] = None,
215
+ order: typing.Optional[BlocksListRequestOrder] = None,
216
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
217
+ request_options: typing.Optional[RequestOptions] = None,
209
218
  ) -> HttpResponse[typing.List[Block]]:
210
219
  """
211
220
  Retrieve the core memory blocks of a specific agent.
@@ -214,6 +223,21 @@ class RawBlocksClient:
214
223
  ----------
215
224
  agent_id : str
216
225
 
226
+ before : typing.Optional[str]
227
+ Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
228
+
229
+ after : typing.Optional[str]
230
+ Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
231
+
232
+ limit : typing.Optional[int]
233
+ Maximum number of blocks to return
234
+
235
+ order : typing.Optional[BlocksListRequestOrder]
236
+ Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
237
+
238
+ order_by : typing.Optional[typing.Literal["created_at"]]
239
+ Field to sort by
240
+
217
241
  request_options : typing.Optional[RequestOptions]
218
242
  Request-specific configuration.
219
243
 
@@ -225,6 +249,13 @@ class RawBlocksClient:
225
249
  _response = self._client_wrapper.httpx_client.request(
226
250
  f"v1/agents/{jsonable_encoder(agent_id)}/core-memory/blocks",
227
251
  method="GET",
252
+ params={
253
+ "before": before,
254
+ "after": after,
255
+ "limit": limit,
256
+ "order": order,
257
+ "order_by": order_by,
258
+ },
228
259
  request_options=request_options,
229
260
  )
230
261
  try:
@@ -543,7 +574,15 @@ class AsyncRawBlocksClient:
543
574
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
544
575
 
545
576
  async def list(
546
- self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
577
+ self,
578
+ agent_id: str,
579
+ *,
580
+ before: typing.Optional[str] = None,
581
+ after: typing.Optional[str] = None,
582
+ limit: typing.Optional[int] = None,
583
+ order: typing.Optional[BlocksListRequestOrder] = None,
584
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
585
+ request_options: typing.Optional[RequestOptions] = None,
547
586
  ) -> AsyncHttpResponse[typing.List[Block]]:
548
587
  """
549
588
  Retrieve the core memory blocks of a specific agent.
@@ -552,6 +591,21 @@ class AsyncRawBlocksClient:
552
591
  ----------
553
592
  agent_id : str
554
593
 
594
+ before : typing.Optional[str]
595
+ Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
596
+
597
+ after : typing.Optional[str]
598
+ Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
599
+
600
+ limit : typing.Optional[int]
601
+ Maximum number of blocks to return
602
+
603
+ order : typing.Optional[BlocksListRequestOrder]
604
+ Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
605
+
606
+ order_by : typing.Optional[typing.Literal["created_at"]]
607
+ Field to sort by
608
+
555
609
  request_options : typing.Optional[RequestOptions]
556
610
  Request-specific configuration.
557
611
 
@@ -563,6 +617,13 @@ class AsyncRawBlocksClient:
563
617
  _response = await self._client_wrapper.httpx_client.request(
564
618
  f"v1/agents/{jsonable_encoder(agent_id)}/core-memory/blocks",
565
619
  method="GET",
620
+ params={
621
+ "before": before,
622
+ "after": after,
623
+ "limit": limit,
624
+ "order": order,
625
+ "order_by": order_by,
626
+ },
566
627
  request_options=request_options,
567
628
  )
568
629
  try:
@@ -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,7 +24,6 @@ from .messages.client import AsyncMessagesClient, MessagesClient
24
24
  from .passages.client import AsyncPassagesClient, PassagesClient
25
25
  from .raw_client import AsyncRawAgentsClient, RawAgentsClient
26
26
  from .sources.client import AsyncSourcesClient, SourcesClient
27
- from .templates.client import AsyncTemplatesClient, TemplatesClient
28
27
  from .tools.client import AsyncToolsClient, ToolsClient
29
28
  from .types.agents_list_request_order import AgentsListRequestOrder
30
29
  from .types.agents_list_request_order_by import AgentsListRequestOrderBy
@@ -63,8 +62,6 @@ class AgentsClient:
63
62
 
64
63
  self.groups = GroupsClient(client_wrapper=client_wrapper)
65
64
 
66
- self.templates = TemplatesClient(client_wrapper=client_wrapper)
67
-
68
65
  self.memory_variables = MemoryVariablesClient(client_wrapper=client_wrapper)
69
66
 
70
67
  @property
@@ -172,7 +169,22 @@ class AgentsClient:
172
169
  project="YOUR_PROJECT",
173
170
  token="YOUR_TOKEN",
174
171
  )
175
- client.agents.list()
172
+ client.agents.list(
173
+ name="name",
174
+ match_all_tags=True,
175
+ before="before",
176
+ after="after",
177
+ limit=1,
178
+ query_text="query_text",
179
+ project_id="project_id",
180
+ template_id="template_id",
181
+ base_template_id="base_template_id",
182
+ identity_id="identity_id",
183
+ order="asc",
184
+ order_by="created_at",
185
+ ascending=True,
186
+ sort_by="sort_by",
187
+ )
176
188
  """
177
189
  _response = self._raw_client.list(
178
190
  name=name,
@@ -332,10 +344,10 @@ class AgentsClient:
332
344
  Whether to enable reasoning for this agent.
333
345
 
334
346
  from_template : typing.Optional[str]
335
- The template id used to configure the agent
347
+ Deprecated: please use the 'create agents from a template' endpoint instead.
336
348
 
337
349
  template : typing.Optional[bool]
338
- Whether the agent is a template
350
+ Deprecated: No longer used
339
351
 
340
352
  project : typing.Optional[str]
341
353
  Deprecated: Project should now be passed via the X-Project header instead of in the request body. If using the sdk, this can be done via the new x_project field below.
@@ -518,6 +530,8 @@ class AgentsClient:
518
530
  )
519
531
  client.agents.export_file(
520
532
  agent_id="agent_id",
533
+ max_steps=1,
534
+ use_legacy_format=True,
521
535
  )
522
536
  """
523
537
  _response = self._raw_client.export_file(
@@ -583,7 +597,9 @@ class AgentsClient:
583
597
  project="YOUR_PROJECT",
584
598
  token="YOUR_TOKEN",
585
599
  )
586
- client.agents.import_file()
600
+ client.agents.import_file(
601
+ override_embedding_model="x-override-embedding-model",
602
+ )
587
603
  """
588
604
  _response = self._raw_client.import_file(
589
605
  file=file,
@@ -949,8 +965,6 @@ class AsyncAgentsClient:
949
965
 
950
966
  self.groups = AsyncGroupsClient(client_wrapper=client_wrapper)
951
967
 
952
- self.templates = AsyncTemplatesClient(client_wrapper=client_wrapper)
953
-
954
968
  self.memory_variables = AsyncMemoryVariablesClient(client_wrapper=client_wrapper)
955
969
 
956
970
  @property
@@ -1063,7 +1077,22 @@ class AsyncAgentsClient:
1063
1077
 
1064
1078
 
1065
1079
  async def main() -> None:
1066
- await client.agents.list()
1080
+ await client.agents.list(
1081
+ name="name",
1082
+ match_all_tags=True,
1083
+ before="before",
1084
+ after="after",
1085
+ limit=1,
1086
+ query_text="query_text",
1087
+ project_id="project_id",
1088
+ template_id="template_id",
1089
+ base_template_id="base_template_id",
1090
+ identity_id="identity_id",
1091
+ order="asc",
1092
+ order_by="created_at",
1093
+ ascending=True,
1094
+ sort_by="sort_by",
1095
+ )
1067
1096
 
1068
1097
 
1069
1098
  asyncio.run(main())
@@ -1226,10 +1255,10 @@ class AsyncAgentsClient:
1226
1255
  Whether to enable reasoning for this agent.
1227
1256
 
1228
1257
  from_template : typing.Optional[str]
1229
- The template id used to configure the agent
1258
+ Deprecated: please use the 'create agents from a template' endpoint instead.
1230
1259
 
1231
1260
  template : typing.Optional[bool]
1232
- Whether the agent is a template
1261
+ Deprecated: No longer used
1233
1262
 
1234
1263
  project : typing.Optional[str]
1235
1264
  Deprecated: Project should now be passed via the X-Project header instead of in the request body. If using the sdk, this can be done via the new x_project field below.
@@ -1433,6 +1462,8 @@ class AsyncAgentsClient:
1433
1462
  async def main() -> None:
1434
1463
  await client.agents.export_file(
1435
1464
  agent_id="agent_id",
1465
+ max_steps=1,
1466
+ use_legacy_format=True,
1436
1467
  )
1437
1468
 
1438
1469
 
@@ -1506,7 +1537,9 @@ class AsyncAgentsClient:
1506
1537
 
1507
1538
 
1508
1539
  async def main() -> None:
1509
- await client.agents.import_file()
1540
+ await client.agents.import_file(
1541
+ override_embedding_model="x-override-embedding-model",
1542
+ )
1510
1543
 
1511
1544
 
1512
1545
  asyncio.run(main())
@@ -2,3 +2,6 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
+ from .types import FilesListRequestOrder
6
+
7
+ __all__ = ["FilesListRequestOrder"]
@@ -6,6 +6,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ...core.request_options import RequestOptions
7
7
  from ...types.paginated_agent_files import PaginatedAgentFiles
8
8
  from .raw_client import AsyncRawFilesClient, RawFilesClient
9
+ from .types.files_list_request_order import FilesListRequestOrder
9
10
 
10
11
 
11
12
  class FilesClient:
@@ -140,8 +141,12 @@ class FilesClient:
140
141
  self,
141
142
  agent_id: str,
142
143
  *,
143
- cursor: typing.Optional[str] = None,
144
+ before: typing.Optional[str] = None,
145
+ after: typing.Optional[str] = None,
144
146
  limit: typing.Optional[int] = None,
147
+ order: typing.Optional[FilesListRequestOrder] = None,
148
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
149
+ cursor: typing.Optional[str] = None,
145
150
  is_open: typing.Optional[bool] = None,
146
151
  request_options: typing.Optional[RequestOptions] = None,
147
152
  ) -> PaginatedAgentFiles:
@@ -152,11 +157,23 @@ class FilesClient:
152
157
  ----------
153
158
  agent_id : str
154
159
 
155
- cursor : typing.Optional[str]
156
- Pagination cursor from previous response
160
+ before : typing.Optional[str]
161
+ File ID cursor for pagination. Returns files that come before this file ID in the specified sort order
162
+
163
+ after : typing.Optional[str]
164
+ File ID cursor for pagination. Returns files that come after this file ID in the specified sort order
157
165
 
158
166
  limit : typing.Optional[int]
159
- Number of items to return (1-100)
167
+ Maximum number of files to return
168
+
169
+ order : typing.Optional[FilesListRequestOrder]
170
+ Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
171
+
172
+ order_by : typing.Optional[typing.Literal["created_at"]]
173
+ Field to sort by
174
+
175
+ cursor : typing.Optional[str]
176
+ Pagination cursor from previous response (deprecated, use before/after)
160
177
 
161
178
  is_open : typing.Optional[bool]
162
179
  Filter by open status (true for open files, false for closed files)
@@ -179,10 +196,24 @@ class FilesClient:
179
196
  )
180
197
  client.agents.files.list(
181
198
  agent_id="agent_id",
199
+ before="before",
200
+ after="after",
201
+ limit=1,
202
+ order="asc",
203
+ cursor="cursor",
204
+ is_open=True,
182
205
  )
183
206
  """
184
207
  _response = self._raw_client.list(
185
- agent_id, cursor=cursor, limit=limit, is_open=is_open, request_options=request_options
208
+ agent_id,
209
+ before=before,
210
+ after=after,
211
+ limit=limit,
212
+ order=order,
213
+ order_by=order_by,
214
+ cursor=cursor,
215
+ is_open=is_open,
216
+ request_options=request_options,
186
217
  )
187
218
  return _response.data
188
219
 
@@ -345,8 +376,12 @@ class AsyncFilesClient:
345
376
  self,
346
377
  agent_id: str,
347
378
  *,
348
- cursor: typing.Optional[str] = None,
379
+ before: typing.Optional[str] = None,
380
+ after: typing.Optional[str] = None,
349
381
  limit: typing.Optional[int] = None,
382
+ order: typing.Optional[FilesListRequestOrder] = None,
383
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
384
+ cursor: typing.Optional[str] = None,
350
385
  is_open: typing.Optional[bool] = None,
351
386
  request_options: typing.Optional[RequestOptions] = None,
352
387
  ) -> PaginatedAgentFiles:
@@ -357,11 +392,23 @@ class AsyncFilesClient:
357
392
  ----------
358
393
  agent_id : str
359
394
 
360
- cursor : typing.Optional[str]
361
- Pagination cursor from previous response
395
+ before : typing.Optional[str]
396
+ File ID cursor for pagination. Returns files that come before this file ID in the specified sort order
397
+
398
+ after : typing.Optional[str]
399
+ File ID cursor for pagination. Returns files that come after this file ID in the specified sort order
362
400
 
363
401
  limit : typing.Optional[int]
364
- Number of items to return (1-100)
402
+ Maximum number of files to return
403
+
404
+ order : typing.Optional[FilesListRequestOrder]
405
+ Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
406
+
407
+ order_by : typing.Optional[typing.Literal["created_at"]]
408
+ Field to sort by
409
+
410
+ cursor : typing.Optional[str]
411
+ Pagination cursor from previous response (deprecated, use before/after)
365
412
 
366
413
  is_open : typing.Optional[bool]
367
414
  Filter by open status (true for open files, false for closed files)
@@ -389,12 +436,26 @@ class AsyncFilesClient:
389
436
  async def main() -> None:
390
437
  await client.agents.files.list(
391
438
  agent_id="agent_id",
439
+ before="before",
440
+ after="after",
441
+ limit=1,
442
+ order="asc",
443
+ cursor="cursor",
444
+ is_open=True,
392
445
  )
393
446
 
394
447
 
395
448
  asyncio.run(main())
396
449
  """
397
450
  _response = await self._raw_client.list(
398
- agent_id, cursor=cursor, limit=limit, is_open=is_open, request_options=request_options
451
+ agent_id,
452
+ before=before,
453
+ after=after,
454
+ limit=limit,
455
+ order=order,
456
+ order_by=order_by,
457
+ cursor=cursor,
458
+ is_open=is_open,
459
+ request_options=request_options,
399
460
  )
400
461
  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.http_validation_error import HttpValidationError
14
14
  from ...types.paginated_agent_files import PaginatedAgentFiles
15
+ from .types.files_list_request_order import FilesListRequestOrder
15
16
 
16
17
 
17
18
  class RawFilesClient:
@@ -185,8 +186,12 @@ class RawFilesClient:
185
186
  self,
186
187
  agent_id: str,
187
188
  *,
188
- cursor: typing.Optional[str] = None,
189
+ before: typing.Optional[str] = None,
190
+ after: typing.Optional[str] = None,
189
191
  limit: typing.Optional[int] = None,
192
+ order: typing.Optional[FilesListRequestOrder] = None,
193
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
194
+ cursor: typing.Optional[str] = None,
190
195
  is_open: typing.Optional[bool] = None,
191
196
  request_options: typing.Optional[RequestOptions] = None,
192
197
  ) -> HttpResponse[PaginatedAgentFiles]:
@@ -197,11 +202,23 @@ class RawFilesClient:
197
202
  ----------
198
203
  agent_id : str
199
204
 
200
- cursor : typing.Optional[str]
201
- Pagination cursor from previous response
205
+ before : typing.Optional[str]
206
+ File ID cursor for pagination. Returns files that come before this file ID in the specified sort order
207
+
208
+ after : typing.Optional[str]
209
+ File ID cursor for pagination. Returns files that come after this file ID in the specified sort order
202
210
 
203
211
  limit : typing.Optional[int]
204
- Number of items to return (1-100)
212
+ Maximum number of files to return
213
+
214
+ order : typing.Optional[FilesListRequestOrder]
215
+ Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
216
+
217
+ order_by : typing.Optional[typing.Literal["created_at"]]
218
+ Field to sort by
219
+
220
+ cursor : typing.Optional[str]
221
+ Pagination cursor from previous response (deprecated, use before/after)
205
222
 
206
223
  is_open : typing.Optional[bool]
207
224
  Filter by open status (true for open files, false for closed files)
@@ -218,8 +235,12 @@ class RawFilesClient:
218
235
  f"v1/agents/{jsonable_encoder(agent_id)}/files",
219
236
  method="GET",
220
237
  params={
221
- "cursor": cursor,
238
+ "before": before,
239
+ "after": after,
222
240
  "limit": limit,
241
+ "order": order,
242
+ "order_by": order_by,
243
+ "cursor": cursor,
223
244
  "is_open": is_open,
224
245
  },
225
246
  request_options=request_options,
@@ -422,8 +443,12 @@ class AsyncRawFilesClient:
422
443
  self,
423
444
  agent_id: str,
424
445
  *,
425
- cursor: typing.Optional[str] = None,
446
+ before: typing.Optional[str] = None,
447
+ after: typing.Optional[str] = None,
426
448
  limit: typing.Optional[int] = None,
449
+ order: typing.Optional[FilesListRequestOrder] = None,
450
+ order_by: typing.Optional[typing.Literal["created_at"]] = None,
451
+ cursor: typing.Optional[str] = None,
427
452
  is_open: typing.Optional[bool] = None,
428
453
  request_options: typing.Optional[RequestOptions] = None,
429
454
  ) -> AsyncHttpResponse[PaginatedAgentFiles]:
@@ -434,11 +459,23 @@ class AsyncRawFilesClient:
434
459
  ----------
435
460
  agent_id : str
436
461
 
437
- cursor : typing.Optional[str]
438
- Pagination cursor from previous response
462
+ before : typing.Optional[str]
463
+ File ID cursor for pagination. Returns files that come before this file ID in the specified sort order
464
+
465
+ after : typing.Optional[str]
466
+ File ID cursor for pagination. Returns files that come after this file ID in the specified sort order
439
467
 
440
468
  limit : typing.Optional[int]
441
- Number of items to return (1-100)
469
+ Maximum number of files to return
470
+
471
+ order : typing.Optional[FilesListRequestOrder]
472
+ Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
473
+
474
+ order_by : typing.Optional[typing.Literal["created_at"]]
475
+ Field to sort by
476
+
477
+ cursor : typing.Optional[str]
478
+ Pagination cursor from previous response (deprecated, use before/after)
442
479
 
443
480
  is_open : typing.Optional[bool]
444
481
  Filter by open status (true for open files, false for closed files)
@@ -455,8 +492,12 @@ class AsyncRawFilesClient:
455
492
  f"v1/agents/{jsonable_encoder(agent_id)}/files",
456
493
  method="GET",
457
494
  params={
458
- "cursor": cursor,
495
+ "before": before,
496
+ "after": after,
459
497
  "limit": limit,
498
+ "order": order,
499
+ "order_by": order_by,
500
+ "cursor": cursor,
460
501
  "is_open": is_open,
461
502
  },
462
503
  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 .files_list_request_order import FilesListRequestOrder
6
+
7
+ __all__ = ["FilesListRequestOrder"]
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- ToolReturnStatus = typing.Union[typing.Literal["success", "error"], typing.Any]
5
+ FilesListRequestOrder = typing.Union[typing.Literal["asc", "desc"], typing.Any]