letta-client 1.0.0a6__py3-none-any.whl → 1.0.0a8__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 (467) hide show
  1. {letta_sdk → letta_client}/__init__.py +8 -8
  2. {letta_sdk → letta_client}/_base_client.py +1 -1
  3. {letta_sdk → letta_client}/_client.py +124 -171
  4. {letta_sdk → letta_client}/_exceptions.py +2 -2
  5. {letta_sdk → letta_client}/_resource.py +5 -5
  6. {letta_sdk → letta_client}/_response.py +8 -6
  7. {letta_sdk → letta_client}/_streaming.py +3 -3
  8. {letta_sdk → letta_client}/_types.py +1 -1
  9. {letta_sdk → letta_client}/_utils/_logs.py +3 -3
  10. {letta_sdk → letta_client}/_utils/_resources_proxy.py +4 -4
  11. {letta_sdk → letta_client}/_version.py +2 -2
  12. letta_client/pagination.py +107 -0
  13. {letta_sdk → letta_client}/resources/__init__.py +14 -154
  14. {letta_sdk → letta_client}/resources/agents/__init__.py +28 -42
  15. {letta_sdk → letta_client}/resources/agents/agents.py +228 -744
  16. {letta_sdk/resources/agents/core_memory → letta_client/resources/agents}/blocks.py +112 -19
  17. {letta_sdk → letta_client}/resources/agents/files.py +71 -8
  18. {letta_sdk → letta_client}/resources/agents/folders.py +101 -11
  19. letta_client/resources/agents/groups.py +245 -0
  20. {letta_sdk → letta_client}/resources/agents/messages.py +265 -490
  21. {letta_sdk → letta_client}/resources/agents/tools.py +147 -31
  22. letta_sdk/resources/jobs.py → letta_client/resources/archives.py +268 -280
  23. {letta_sdk/resources/messages → letta_client/resources/batches}/batches.py +46 -161
  24. letta_client/resources/batches/messages.py +238 -0
  25. {letta_sdk/resources/agents/core_memory → letta_client/resources/blocks}/__init__.py +14 -14
  26. letta_client/resources/blocks/agents.py +287 -0
  27. {letta_sdk/resources → letta_client/resources/blocks}/blocks.py +64 -175
  28. letta_client/resources/folders/__init__.py +47 -0
  29. letta_client/resources/folders/agents.py +237 -0
  30. letta_client/resources/folders/files.py +472 -0
  31. letta_sdk/resources/providers.py → letta_client/resources/folders/folders.py +298 -313
  32. {letta_sdk → letta_client}/resources/groups/groups.py +24 -88
  33. {letta_sdk → letta_client}/resources/groups/messages.py +178 -37
  34. letta_client/resources/identities/__init__.py +61 -0
  35. letta_client/resources/identities/agents.py +269 -0
  36. letta_client/resources/identities/blocks.py +237 -0
  37. {letta_sdk/resources → letta_client/resources/identities}/identities.py +277 -533
  38. letta_client/resources/identities/properties.py +174 -0
  39. letta_client/resources/models/__init__.py +33 -0
  40. {letta_sdk/resources → letta_client/resources/models}/embeddings.py +26 -49
  41. {letta_sdk/resources → letta_client/resources/models}/models.py +42 -117
  42. letta_client/resources/runs/__init__.py +61 -0
  43. letta_sdk/resources/archives.py → letta_client/resources/runs/messages.py +189 -157
  44. letta_client/resources/runs/runs.py +462 -0
  45. letta_client/resources/runs/steps.py +229 -0
  46. letta_sdk/resources/voice_beta/chat.py → letta_client/resources/runs/usage.py +50 -57
  47. letta_client/resources/steps/__init__.py +75 -0
  48. letta_client/resources/steps/feedback.py +198 -0
  49. letta_client/resources/steps/messages.py +237 -0
  50. letta_client/resources/steps/metrics.py +167 -0
  51. letta_client/resources/steps/steps.py +513 -0
  52. letta_sdk/resources/telemetry.py → letta_client/resources/steps/trace.py +45 -56
  53. {letta_sdk → letta_client}/resources/tags.py +13 -10
  54. letta_client/resources/templates/__init__.py +33 -0
  55. letta_client/resources/templates/agents.py +236 -0
  56. letta_client/resources/templates/templates.py +102 -0
  57. {letta_sdk/resources/tools → letta_client/resources}/tools.py +249 -433
  58. letta_client/types/__init__.py +111 -0
  59. {letta_sdk → letta_client}/types/agent_create_params.py +5 -2
  60. {letta_sdk → letta_client}/types/agent_environment_variable.py +3 -0
  61. letta_client/types/agent_export_file_params.py +18 -0
  62. letta_sdk/types/agent_export_response.py → letta_client/types/agent_export_file_response.py +2 -2
  63. letta_sdk/types/agent_import_params.py → letta_client/types/agent_import_file_params.py +5 -2
  64. letta_sdk/types/agent_import_response.py → letta_client/types/agent_import_file_response.py +2 -2
  65. {letta_sdk → letta_client}/types/agent_list_params.py +19 -2
  66. {letta_sdk → letta_client}/types/agent_retrieve_params.py +20 -3
  67. {letta_sdk → letta_client}/types/agent_state.py +131 -3
  68. {letta_sdk → letta_client}/types/agent_type.py +1 -0
  69. {letta_sdk → letta_client}/types/agent_update_params.py +12 -0
  70. {letta_sdk → letta_client}/types/agents/__init__.py +10 -21
  71. letta_client/types/agents/approval_create_param.py +44 -0
  72. {letta_sdk → letta_client}/types/agents/approval_request_message.py +10 -2
  73. letta_client/types/agents/approval_response_message.py +63 -0
  74. {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block.py +1 -1
  75. letta_sdk/types/identity_list_blocks_params.py → letta_client/types/agents/block_list_params.py +2 -2
  76. {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block_update_params.py +1 -0
  77. letta_client/types/agents/file_list_params.py +40 -0
  78. letta_client/types/agents/folder_list_params.py +34 -0
  79. letta_sdk/types/source.py → letta_client/types/agents/folder_list_response.py +5 -5
  80. letta_client/types/agents/group_list_params.py +37 -0
  81. {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union.py +3 -0
  82. {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union_param.py +4 -0
  83. {letta_sdk → letta_client}/types/agents/letta_response.py +0 -4
  84. {letta_sdk → letta_client}/types/agents/message.py +93 -2
  85. {letta_sdk → letta_client}/types/agents/message_list_params.py +20 -5
  86. letta_sdk/types/agent_reset_messages_params.py → letta_client/types/agents/message_reset_params.py +2 -2
  87. {letta_sdk → letta_client}/types/agents/message_send_async_params.py +12 -3
  88. {letta_sdk → letta_client}/types/agents/message_send_params.py +12 -3
  89. letta_sdk/types/agents/message_send_stream_params.py → letta_client/types/agents/message_stream_params.py +14 -5
  90. {letta_sdk → letta_client}/types/agents/message_update_params.py +4 -0
  91. {letta_sdk → letta_client}/types/agents/omitted_reasoning_content.py +3 -0
  92. {letta_sdk → letta_client}/types/agents/omitted_reasoning_content_param.py +4 -0
  93. {letta_sdk → letta_client}/types/agents/run.py +16 -19
  94. {letta_sdk → letta_client}/types/agents/text_content.py +3 -0
  95. {letta_sdk → letta_client}/types/agents/text_content_param.py +4 -0
  96. {letta_sdk → letta_client}/types/agents/tool_call_content.py +3 -0
  97. {letta_sdk → letta_client}/types/agents/tool_call_content_param.py +4 -1
  98. {letta_sdk → letta_client}/types/agents/tool_call_message.py +6 -2
  99. letta_client/types/agents/tool_list_params.py +34 -0
  100. {letta_sdk → letta_client}/types/agents/tool_return.py +7 -3
  101. letta_client/types/agents/tool_return_param.py +25 -0
  102. letta_client/types/agents/tool_update_approval_params.py +21 -0
  103. {letta_sdk → letta_client}/types/archive.py +4 -0
  104. letta_client/types/archive_create_params.py +19 -0
  105. letta_sdk/types/archive_retrieve_params.py → letta_client/types/archive_list_params.py +2 -2
  106. letta_sdk/types/archive_retrieve_response.py → letta_client/types/archive_list_response.py +2 -2
  107. {letta_sdk → letta_client}/types/archive_update_params.py +3 -3
  108. {letta_sdk/types/messages → letta_client/types}/batch_create_params.py +15 -6
  109. letta_sdk/types/job.py → letta_client/types/batch_job.py +8 -3
  110. letta_client/types/batches/__init__.py +6 -0
  111. letta_sdk/types/messages/batch_list_messages_params.py → letta_client/types/batches/message_list_params.py +2 -2
  112. letta_sdk/types/messages/batch_list_messages_response.py → letta_client/types/batches/message_list_response.py +2 -2
  113. {letta_sdk/types/tools → letta_client/types/blocks}/__init__.py +2 -0
  114. letta_sdk/types/block_list_agents_params.py → letta_client/types/blocks/agent_list_params.py +22 -5
  115. letta_client/types/child_tool_rule.py +40 -0
  116. letta_client/types/child_tool_rule_param.py +42 -0
  117. letta_client/types/folders/__init__.py +10 -0
  118. letta_sdk/types/folder_list_agents_params.py → letta_client/types/folders/agent_list_params.py +2 -2
  119. letta_client/types/folders/agent_list_response.py +7 -0
  120. letta_sdk/types/folder_list_files_params.py → letta_client/types/folders/file_list_params.py +2 -2
  121. letta_sdk/types/file_metadata.py → letta_client/types/folders/file_list_response.py +5 -5
  122. letta_sdk/types/source_upload_file_params.py → letta_client/types/folders/file_upload_params.py +5 -6
  123. letta_client/types/folders/file_upload_response.py +65 -0
  124. {letta_sdk → letta_client}/types/groups/__init__.py +1 -2
  125. {letta_sdk → letta_client}/types/groups/message_send_params.py +12 -3
  126. letta_sdk/types/groups/message_send_stream_params.py → letta_client/types/groups/message_stream_params.py +14 -5
  127. {letta_sdk → letta_client}/types/groups/message_update_params.py +4 -0
  128. letta_sdk/types/health_check_response.py → letta_client/types/health_response.py +2 -2
  129. letta_client/types/identities/__init__.py +7 -0
  130. letta_sdk/types/identity_list_agents_params.py → letta_client/types/identities/agent_list_params.py +19 -3
  131. letta_client/types/identities/block_list_params.py +34 -0
  132. letta_sdk/types/identity_upsert_properties_params.py → letta_client/types/identities/property_upsert_params.py +3 -3
  133. letta_sdk/types/identity_modify_params.py → letta_client/types/identity_update_params.py +2 -2
  134. {letta_sdk → letta_client}/types/init_tool_rule.py +10 -1
  135. {letta_sdk → letta_client}/types/init_tool_rule_param.py +10 -1
  136. {letta_sdk → letta_client}/types/llm_config.py +6 -0
  137. {letta_sdk → letta_client}/types/llm_config_param.py +6 -0
  138. {letta_sdk/types/voice_beta → letta_client/types/models}/__init__.py +1 -1
  139. letta_sdk/types/agents/archival_memory_create_response.py → letta_client/types/models/embedding_list_response.py +3 -3
  140. {letta_sdk → letta_client}/types/run_list_params.py +29 -5
  141. letta_client/types/runs/__init__.py +8 -0
  142. letta_sdk/types/run_list_messages_params.py → letta_client/types/runs/message_list_params.py +5 -2
  143. letta_sdk/types/run_retrieve_stream_params.py → letta_client/types/runs/message_stream_params.py +2 -2
  144. letta_sdk/types/run_list_steps_params.py → letta_client/types/runs/step_list_params.py +9 -6
  145. letta_sdk/types/run_retrieve_usage_response.py → letta_client/types/runs/usage_retrieve_response.py +3 -3
  146. {letta_sdk → letta_client}/types/step.py +6 -6
  147. letta_client/types/steps/__init__.py +8 -0
  148. letta_sdk/types/step_update_feedback_params.py → letta_client/types/steps/feedback_create_params.py +3 -3
  149. letta_sdk/types/step_list_messages_params.py → letta_client/types/steps/message_list_params.py +2 -2
  150. letta_client/types/steps/message_list_response.py +32 -0
  151. letta_sdk/types/step_retrieve_metrics_response.py → letta_client/types/steps/metric_retrieve_response.py +6 -6
  152. {letta_sdk → letta_client}/types/tag_list_response.py +1 -2
  153. letta_client/types/templates/__init__.py +5 -0
  154. letta_sdk/types/template_create_agents_params.py → letta_client/types/templates/agent_create_params.py +4 -4
  155. {letta_sdk → letta_client}/types/tool.py +6 -0
  156. {letta_sdk → letta_client}/types/tool_create_params.py +6 -0
  157. {letta_sdk → letta_client}/types/tool_return_message.py +3 -0
  158. letta_sdk/types/tool_modify_params.py → letta_client/types/tool_update_params.py +8 -2
  159. letta_sdk/types/tool_list_response.py → letta_client/types/tool_upsert_base_tools_response.py +2 -2
  160. {letta_sdk → letta_client}/types/tool_upsert_params.py +6 -0
  161. {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a8.dist-info}/METADATA +110 -70
  162. letta_client-1.0.0a8.dist-info/RECORD +289 -0
  163. {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a8.dist-info}/licenses/LICENSE +1 -1
  164. letta_client-1.0.0a6.dist-info/RECORD +0 -420
  165. letta_sdk/resources/_internal_templates/__init__.py +0 -33
  166. letta_sdk/resources/_internal_templates/_internal_templates.py +0 -961
  167. letta_sdk/resources/_internal_templates/deployment.py +0 -268
  168. letta_sdk/resources/agents/archival_memory.py +0 -581
  169. letta_sdk/resources/agents/core_memory/core_memory.py +0 -278
  170. letta_sdk/resources/agents/sources.py +0 -332
  171. letta_sdk/resources/client_side_access_tokens.py +0 -402
  172. letta_sdk/resources/folders.py +0 -1562
  173. letta_sdk/resources/health.py +0 -135
  174. letta_sdk/resources/messages/messages.py +0 -102
  175. letta_sdk/resources/projects.py +0 -189
  176. letta_sdk/resources/runs.py +0 -1016
  177. letta_sdk/resources/sources/__init__.py +0 -33
  178. letta_sdk/resources/sources/files.py +0 -341
  179. letta_sdk/resources/sources/sources.py +0 -1371
  180. letta_sdk/resources/steps.py +0 -784
  181. letta_sdk/resources/templates.py +0 -1310
  182. letta_sdk/resources/tools/__init__.py +0 -47
  183. letta_sdk/resources/tools/composio/__init__.py +0 -33
  184. letta_sdk/resources/tools/composio/apps.py +0 -214
  185. letta_sdk/resources/tools/composio/composio.py +0 -201
  186. letta_sdk/resources/tools/mcp/__init__.py +0 -47
  187. letta_sdk/resources/tools/mcp/mcp.py +0 -134
  188. letta_sdk/resources/tools/mcp/oauth.py +0 -214
  189. letta_sdk/resources/tools/mcp/servers/__init__.py +0 -33
  190. letta_sdk/resources/tools/mcp/servers/servers.py +0 -1785
  191. letta_sdk/resources/tools/mcp/servers/tools.py +0 -263
  192. letta_sdk/resources/voice_beta/__init__.py +0 -33
  193. letta_sdk/resources/voice_beta/voice_beta.py +0 -102
  194. letta_sdk/types/__init__.py +0 -226
  195. letta_sdk/types/_internal_templates/__init__.py +0 -7
  196. letta_sdk/types/_internal_templates/deployment_delete_response.py +0 -17
  197. letta_sdk/types/_internal_templates/deployment_list_entities_params.py +0 -15
  198. letta_sdk/types/_internal_templates/deployment_list_entities_response.py +0 -31
  199. letta_sdk/types/agent_export_params.py +0 -17
  200. letta_sdk/types/agent_list_groups_params.py +0 -13
  201. letta_sdk/types/agent_list_groups_response.py +0 -10
  202. letta_sdk/types/agent_list_response.py +0 -10
  203. letta_sdk/types/agent_migrate_params.py +0 -19
  204. letta_sdk/types/agent_migrate_response.py +0 -11
  205. letta_sdk/types/agent_retrieve_context_response.py +0 -110
  206. letta_sdk/types/agent_search_params.py +0 -78
  207. letta_sdk/types/agent_search_response.py +0 -16
  208. letta_sdk/types/agent_summarize_params.py +0 -12
  209. letta_sdk/types/agents/approval_create_param.py +0 -22
  210. letta_sdk/types/agents/approval_response_message.py +0 -41
  211. letta_sdk/types/agents/archival_memory_create_params.py +0 -23
  212. letta_sdk/types/agents/archival_memory_list_params.py +0 -28
  213. letta_sdk/types/agents/archival_memory_list_response.py +0 -10
  214. letta_sdk/types/agents/archival_memory_search_params.py +0 -35
  215. letta_sdk/types/agents/archival_memory_search_response.py +0 -26
  216. letta_sdk/types/agents/core_memory/__init__.py +0 -7
  217. letta_sdk/types/agents/core_memory/block_list_response.py +0 -10
  218. letta_sdk/types/agents/core_memory_retrieve_variables_response.py +0 -11
  219. letta_sdk/types/agents/file_list_params.py +0 -19
  220. letta_sdk/types/agents/folder_list_response.py +0 -10
  221. letta_sdk/types/agents/letta_request_param.py +0 -45
  222. letta_sdk/types/agents/letta_streaming_request_param.py +0 -60
  223. letta_sdk/types/agents/memory.py +0 -92
  224. letta_sdk/types/agents/message_list_response.py +0 -10
  225. letta_sdk/types/agents/message_preview_raw_payload_params.py +0 -103
  226. letta_sdk/types/agents/message_preview_raw_payload_response.py +0 -8
  227. letta_sdk/types/agents/message_search_params.py +0 -38
  228. letta_sdk/types/agents/message_search_response.py +0 -29
  229. letta_sdk/types/agents/source_list_response.py +0 -10
  230. letta_sdk/types/agents/tool_list_response.py +0 -10
  231. letta_sdk/types/agents/tool_modify_approval_params.py +0 -13
  232. letta_sdk/types/block_list_agents_response.py +0 -10
  233. letta_sdk/types/block_list_response.py +0 -10
  234. letta_sdk/types/child_tool_rule.py +0 -21
  235. letta_sdk/types/child_tool_rule_param.py +0 -23
  236. letta_sdk/types/client_side_access_token_create_params.py +0 -32
  237. letta_sdk/types/client_side_access_token_create_response.py +0 -34
  238. letta_sdk/types/client_side_access_token_delete_params.py +0 -11
  239. letta_sdk/types/client_side_access_token_list_params.py +0 -23
  240. letta_sdk/types/client_side_access_token_list_response.py +0 -40
  241. letta_sdk/types/duplicate_file_handling.py +0 -7
  242. letta_sdk/types/embedding_get_total_storage_size_response.py +0 -7
  243. letta_sdk/types/file_processing_status.py +0 -7
  244. letta_sdk/types/folder_get_by_name_response.py +0 -7
  245. letta_sdk/types/folder_list_agents_response.py +0 -8
  246. letta_sdk/types/folder_list_files_response.py +0 -10
  247. letta_sdk/types/folder_list_passages_params.py +0 -34
  248. letta_sdk/types/folder_list_passages_response.py +0 -10
  249. letta_sdk/types/folder_list_response.py +0 -10
  250. letta_sdk/types/folder_retrieve_metadata_params.py +0 -11
  251. letta_sdk/types/folder_upload_file_params.py +0 -21
  252. letta_sdk/types/group_list_response.py +0 -10
  253. letta_sdk/types/groups/message_list_response.py +0 -10
  254. letta_sdk/types/identity_list_agents_response.py +0 -10
  255. letta_sdk/types/identity_list_blocks_response.py +0 -10
  256. letta_sdk/types/identity_list_response.py +0 -10
  257. letta_sdk/types/internal_template_create_agent_params.py +0 -217
  258. letta_sdk/types/internal_template_create_block_params.py +0 -54
  259. letta_sdk/types/internal_template_create_group_params.py +0 -49
  260. letta_sdk/types/job_list_active_params.py +0 -28
  261. letta_sdk/types/job_list_active_response.py +0 -10
  262. letta_sdk/types/job_list_params.py +0 -31
  263. letta_sdk/types/job_list_response.py +0 -10
  264. letta_sdk/types/messages/__init__.py +0 -10
  265. letta_sdk/types/messages/batch_job.py +0 -60
  266. letta_sdk/types/messages/batch_list_response.py +0 -10
  267. letta_sdk/types/model_list_embedding_response.py +0 -10
  268. letta_sdk/types/organization_sources_stats.py +0 -49
  269. letta_sdk/types/passage.py +0 -56
  270. letta_sdk/types/project_list_params.py +0 -16
  271. letta_sdk/types/project_list_response.py +0 -23
  272. letta_sdk/types/provider.py +0 -42
  273. letta_sdk/types/provider_check_params.py +0 -30
  274. letta_sdk/types/provider_create_params.py +0 -33
  275. letta_sdk/types/provider_list_params.py +0 -42
  276. letta_sdk/types/provider_list_response.py +0 -10
  277. letta_sdk/types/provider_update_params.py +0 -25
  278. letta_sdk/types/run_list_active_params.py +0 -18
  279. letta_sdk/types/run_list_active_response.py +0 -10
  280. letta_sdk/types/run_list_messages_response.py +0 -10
  281. letta_sdk/types/run_list_response.py +0 -10
  282. letta_sdk/types/run_list_steps_response.py +0 -10
  283. letta_sdk/types/source_count_response.py +0 -7
  284. letta_sdk/types/source_create_params.py +0 -33
  285. letta_sdk/types/source_get_agents_response.py +0 -8
  286. letta_sdk/types/source_get_by_name_response.py +0 -7
  287. letta_sdk/types/source_get_metadata_params.py +0 -11
  288. letta_sdk/types/source_list_passages_params.py +0 -19
  289. letta_sdk/types/source_list_passages_response.py +0 -10
  290. letta_sdk/types/source_list_response.py +0 -10
  291. letta_sdk/types/source_update_params.py +0 -27
  292. letta_sdk/types/sources/__init__.py +0 -7
  293. letta_sdk/types/sources/file_list_params.py +0 -26
  294. letta_sdk/types/sources/file_list_response.py +0 -10
  295. letta_sdk/types/sources/file_retrieve_params.py +0 -14
  296. letta_sdk/types/step_list_messages_response.py +0 -34
  297. letta_sdk/types/step_list_response.py +0 -10
  298. letta_sdk/types/template_create_agents_response.py +0 -12
  299. letta_sdk/types/template_create_params.py +0 -40
  300. letta_sdk/types/template_create_response.py +0 -29
  301. letta_sdk/types/template_delete_response.py +0 -9
  302. letta_sdk/types/template_fork_params.py +0 -17
  303. letta_sdk/types/template_fork_response.py +0 -29
  304. letta_sdk/types/template_get_snapshot_response.py +0 -258
  305. letta_sdk/types/template_list_params.py +0 -34
  306. letta_sdk/types/template_list_response.py +0 -35
  307. letta_sdk/types/template_list_versions_params.py +0 -16
  308. letta_sdk/types/template_list_versions_response.py +0 -29
  309. letta_sdk/types/template_rename_params.py +0 -14
  310. letta_sdk/types/template_rename_response.py +0 -9
  311. letta_sdk/types/template_save_version_params.py +0 -32
  312. letta_sdk/types/template_save_version_response.py +0 -29
  313. letta_sdk/types/template_update_description_params.py +0 -14
  314. letta_sdk/types/template_update_description_response.py +0 -9
  315. letta_sdk/types/tool_run_params.py +0 -43
  316. letta_sdk/types/tool_upsert_base_response.py +0 -10
  317. letta_sdk/types/tools/composio/__init__.py +0 -6
  318. letta_sdk/types/tools/composio/app_list_actions_response.py +0 -70
  319. letta_sdk/types/tools/composio/app_list_response.py +0 -103
  320. letta_sdk/types/tools/mcp/__init__.py +0 -21
  321. letta_sdk/types/tools/mcp/mcp_server_type.py +0 -7
  322. letta_sdk/types/tools/mcp/oauth_callback_params.py +0 -22
  323. letta_sdk/types/tools/mcp/server_add_params.py +0 -68
  324. letta_sdk/types/tools/mcp/server_add_response.py +0 -14
  325. letta_sdk/types/tools/mcp/server_connect_params.py +0 -68
  326. letta_sdk/types/tools/mcp/server_delete_response.py +0 -14
  327. letta_sdk/types/tools/mcp/server_list_response.py +0 -14
  328. letta_sdk/types/tools/mcp/server_resync_params.py +0 -12
  329. letta_sdk/types/tools/mcp/server_test_params.py +0 -68
  330. letta_sdk/types/tools/mcp/server_update_params.py +0 -43
  331. letta_sdk/types/tools/mcp/server_update_response.py +0 -12
  332. letta_sdk/types/tools/mcp/servers/__init__.py +0 -6
  333. letta_sdk/types/tools/mcp/servers/tool_execute_params.py +0 -15
  334. letta_sdk/types/tools/mcp/servers/tool_list_response.py +0 -85
  335. letta_sdk/types/tools/mcp/sse_server_config.py +0 -27
  336. letta_sdk/types/tools/mcp/sse_server_config_param.py +0 -29
  337. letta_sdk/types/tools/mcp/stdio_server_config.py +0 -24
  338. letta_sdk/types/tools/mcp/stdio_server_config_param.py +0 -27
  339. letta_sdk/types/tools/mcp/streamable_http_server_config.py +0 -27
  340. letta_sdk/types/tools/mcp/streamable_http_server_config_param.py +0 -29
  341. letta_sdk/types/voice_beta/chat_create_completion_params.py +0 -12
  342. {letta_sdk → letta_client}/_compat.py +0 -0
  343. {letta_sdk → letta_client}/_constants.py +0 -0
  344. {letta_sdk → letta_client}/_files.py +0 -0
  345. {letta_sdk → letta_client}/_models.py +0 -0
  346. {letta_sdk → letta_client}/_qs.py +0 -0
  347. {letta_sdk → letta_client}/_utils/__init__.py +0 -0
  348. {letta_sdk → letta_client}/_utils/_compat.py +0 -0
  349. {letta_sdk → letta_client}/_utils/_datetime_parse.py +0 -0
  350. {letta_sdk → letta_client}/_utils/_proxy.py +0 -0
  351. {letta_sdk → letta_client}/_utils/_reflection.py +0 -0
  352. {letta_sdk → letta_client}/_utils/_streams.py +0 -0
  353. {letta_sdk → letta_client}/_utils/_sync.py +0 -0
  354. {letta_sdk → letta_client}/_utils/_transform.py +0 -0
  355. {letta_sdk → letta_client}/_utils/_typing.py +0 -0
  356. {letta_sdk → letta_client}/_utils/_utils.py +0 -0
  357. {letta_sdk → letta_client}/lib/.keep +0 -0
  358. {letta_sdk → letta_client}/py.typed +0 -0
  359. {letta_sdk/resources/messages → letta_client/resources/batches}/__init__.py +6 -6
  360. {letta_sdk → letta_client}/resources/groups/__init__.py +0 -0
  361. {letta_sdk → letta_client}/types/agent_count_response.py +0 -0
  362. {letta_sdk → letta_client}/types/agents/assistant_message.py +0 -0
  363. {letta_sdk → letta_client}/types/agents/file_close_all_response.py +0 -0
  364. {letta_sdk → letta_client}/types/agents/file_list_response.py +0 -0
  365. {letta_sdk → letta_client}/types/agents/file_open_response.py +0 -0
  366. {letta_sdk → letta_client}/types/agents/hidden_reasoning_message.py +0 -0
  367. {letta_sdk → letta_client}/types/agents/image_content.py +0 -0
  368. {letta_sdk → letta_client}/types/agents/image_content_param.py +0 -0
  369. {letta_sdk → letta_client}/types/agents/job_status.py +0 -0
  370. {letta_sdk → letta_client}/types/agents/job_type.py +0 -0
  371. {letta_sdk → letta_client}/types/agents/letta_message_union.py +0 -0
  372. {letta_sdk → letta_client}/types/agents/letta_user_message_content_union.py +0 -0
  373. {letta_sdk → letta_client}/types/agents/letta_user_message_content_union_param.py +0 -0
  374. {letta_sdk → letta_client}/types/agents/message_cancel_params.py +0 -0
  375. {letta_sdk → letta_client}/types/agents/message_cancel_response.py +0 -0
  376. {letta_sdk → letta_client}/types/agents/message_role.py +0 -0
  377. {letta_sdk → letta_client}/types/agents/message_type.py +0 -0
  378. {letta_sdk → letta_client}/types/agents/message_update_response.py +0 -0
  379. {letta_sdk → letta_client}/types/agents/reasoning_content.py +0 -0
  380. {letta_sdk → letta_client}/types/agents/reasoning_content_param.py +0 -0
  381. {letta_sdk → letta_client}/types/agents/reasoning_message.py +0 -0
  382. {letta_sdk → letta_client}/types/agents/redacted_reasoning_content.py +0 -0
  383. {letta_sdk → letta_client}/types/agents/redacted_reasoning_content_param.py +0 -0
  384. {letta_sdk → letta_client}/types/agents/system_message.py +0 -0
  385. {letta_sdk → letta_client}/types/agents/tool_call.py +0 -0
  386. {letta_sdk → letta_client}/types/agents/tool_call_delta.py +0 -0
  387. {letta_sdk → letta_client}/types/agents/tool_return_content.py +0 -0
  388. {letta_sdk → letta_client}/types/agents/tool_return_content_param.py +0 -0
  389. {letta_sdk → letta_client}/types/agents/update_assistant_message_param.py +0 -0
  390. {letta_sdk → letta_client}/types/agents/update_reasoning_message_param.py +0 -0
  391. {letta_sdk → letta_client}/types/agents/update_system_message_param.py +0 -0
  392. {letta_sdk → letta_client}/types/agents/update_user_message_param.py +0 -0
  393. {letta_sdk → letta_client}/types/agents/user_message.py +0 -0
  394. {letta_sdk/types/messages → letta_client/types}/batch_list_params.py +0 -0
  395. {letta_sdk → letta_client}/types/block_count_response.py +0 -0
  396. {letta_sdk → letta_client}/types/block_create_params.py +0 -0
  397. {letta_sdk → letta_client}/types/block_list_params.py +0 -0
  398. {letta_sdk → letta_client}/types/block_update_params.py +0 -0
  399. {letta_sdk → letta_client}/types/conditional_tool_rule.py +0 -0
  400. {letta_sdk → letta_client}/types/conditional_tool_rule_param.py +0 -0
  401. {letta_sdk → letta_client}/types/continue_tool_rule.py +0 -0
  402. {letta_sdk → letta_client}/types/continue_tool_rule_param.py +0 -0
  403. {letta_sdk → letta_client}/types/create_block_param.py +0 -0
  404. {letta_sdk → letta_client}/types/dynamic_manager_param.py +0 -0
  405. {letta_sdk → letta_client}/types/embedding_config.py +0 -0
  406. {letta_sdk → letta_client}/types/embedding_config_param.py +0 -0
  407. {letta_sdk → letta_client}/types/folder.py +0 -0
  408. {letta_sdk → letta_client}/types/folder_count_response.py +0 -0
  409. {letta_sdk → letta_client}/types/folder_create_params.py +0 -0
  410. {letta_sdk → letta_client}/types/folder_list_params.py +0 -0
  411. {letta_sdk → letta_client}/types/folder_update_params.py +0 -0
  412. {letta_sdk → letta_client}/types/group.py +0 -0
  413. {letta_sdk → letta_client}/types/group_count_response.py +0 -0
  414. {letta_sdk → letta_client}/types/group_create_params.py +0 -0
  415. {letta_sdk → letta_client}/types/group_list_params.py +0 -0
  416. {letta_sdk → letta_client}/types/group_update_params.py +0 -0
  417. {letta_sdk → letta_client}/types/groups/message_list_params.py +0 -0
  418. {letta_sdk → letta_client}/types/groups/message_update_response.py +0 -0
  419. {letta_sdk → letta_client}/types/identity.py +0 -0
  420. {letta_sdk → letta_client}/types/identity_count_response.py +0 -0
  421. {letta_sdk → letta_client}/types/identity_create_params.py +0 -0
  422. {letta_sdk → letta_client}/types/identity_list_params.py +0 -0
  423. {letta_sdk → letta_client}/types/identity_property.py +0 -0
  424. {letta_sdk → letta_client}/types/identity_property_param.py +0 -0
  425. {letta_sdk → letta_client}/types/identity_type.py +0 -0
  426. {letta_sdk → letta_client}/types/identity_upsert_params.py +0 -0
  427. {letta_sdk → letta_client}/types/json_object_response_format.py +0 -0
  428. {letta_sdk → letta_client}/types/json_object_response_format_param.py +0 -0
  429. {letta_sdk → letta_client}/types/json_schema_response_format.py +0 -0
  430. {letta_sdk → letta_client}/types/json_schema_response_format_param.py +0 -0
  431. {letta_sdk → letta_client}/types/letta_message_content_union_param.py +0 -0
  432. {letta_sdk → letta_client}/types/manager_type.py +0 -0
  433. {letta_sdk → letta_client}/types/max_count_per_step_tool_rule.py +0 -0
  434. {letta_sdk → letta_client}/types/max_count_per_step_tool_rule_param.py +0 -0
  435. {letta_sdk → letta_client}/types/message_create_param.py +0 -0
  436. {letta_sdk → letta_client}/types/model_list_params.py +0 -0
  437. {letta_sdk → letta_client}/types/model_list_response.py +0 -0
  438. {letta_sdk → letta_client}/types/npm_requirement.py +0 -0
  439. {letta_sdk → letta_client}/types/npm_requirement_param.py +0 -0
  440. {letta_sdk → letta_client}/types/parent_tool_rule.py +0 -0
  441. {letta_sdk → letta_client}/types/parent_tool_rule_param.py +0 -0
  442. {letta_sdk → letta_client}/types/pip_requirement.py +0 -0
  443. {letta_sdk → letta_client}/types/pip_requirement_param.py +0 -0
  444. {letta_sdk → letta_client}/types/provider_category.py +0 -0
  445. {letta_sdk → letta_client}/types/provider_trace.py +0 -0
  446. {letta_sdk → letta_client}/types/provider_type.py +0 -0
  447. {letta_sdk → letta_client}/types/required_before_exit_tool_rule.py +0 -0
  448. {letta_sdk → letta_client}/types/required_before_exit_tool_rule_param.py +0 -0
  449. {letta_sdk → letta_client}/types/requires_approval_tool_rule.py +0 -0
  450. {letta_sdk → letta_client}/types/requires_approval_tool_rule_param.py +0 -0
  451. {letta_sdk → letta_client}/types/round_robin_manager_param.py +0 -0
  452. {letta_sdk → letta_client}/types/sleeptime_manager_param.py +0 -0
  453. {letta_sdk → letta_client}/types/step_list_params.py +0 -0
  454. {letta_sdk → letta_client}/types/stop_reason_type.py +0 -0
  455. {letta_sdk → letta_client}/types/supervisor_manager_param.py +0 -0
  456. {letta_sdk → letta_client}/types/tag_list_params.py +0 -0
  457. {letta_sdk → letta_client}/types/terminal_tool_rule.py +0 -0
  458. {letta_sdk → letta_client}/types/terminal_tool_rule_param.py +0 -0
  459. {letta_sdk → letta_client}/types/text_response_format.py +0 -0
  460. {letta_sdk → letta_client}/types/text_response_format_param.py +0 -0
  461. {letta_sdk → letta_client}/types/tool_count_params.py +0 -0
  462. {letta_sdk → letta_client}/types/tool_count_response.py +0 -0
  463. {letta_sdk → letta_client}/types/tool_list_params.py +0 -0
  464. {letta_sdk → letta_client}/types/tool_type.py +1 -1
  465. {letta_sdk → letta_client}/types/vector_db_provider.py +0 -0
  466. {letta_sdk → letta_client}/types/voice_sleeptime_manager_param.py +0 -0
  467. {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a8.dist-info}/WHEEL +0 -0
@@ -3,12 +3,11 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import Any, List, Union, Iterable, Optional, cast
6
- from datetime import datetime
7
6
  from typing_extensions import Literal, overload
8
7
 
9
8
  import httpx
10
9
 
11
- from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
10
+ from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
12
11
  from ..._utils import required_args, maybe_transform, async_maybe_transform
13
12
  from ..._compat import cached_property
14
13
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -18,26 +17,24 @@ from ..._response import (
18
17
  async_to_raw_response_wrapper,
19
18
  async_to_streamed_response_wrapper,
20
19
  )
21
- from ..._base_client import make_request_options
20
+ from ...pagination import SyncArrayPage, AsyncArrayPage
21
+ from ..._base_client import AsyncPaginator, make_request_options
22
22
  from ...types.agents import (
23
23
  message_list_params,
24
24
  message_send_params,
25
+ message_reset_params,
25
26
  message_cancel_params,
26
- message_search_params,
27
+ message_stream_params,
27
28
  message_update_params,
28
29
  message_send_async_params,
29
- message_send_stream_params,
30
- message_preview_raw_payload_params,
31
30
  )
32
31
  from ...types.agents.run import Run
33
- from ...types.agents.message_role import MessageRole
32
+ from ...types.agent_state import AgentState
34
33
  from ...types.agents.message_type import MessageType
35
34
  from ...types.agents.letta_response import LettaResponse
36
- from ...types.agents.message_list_response import MessageListResponse
35
+ from ...types.agents.letta_message_union import LettaMessageUnion
37
36
  from ...types.agents.message_cancel_response import MessageCancelResponse
38
- from ...types.agents.message_search_response import MessageSearchResponse
39
37
  from ...types.agents.message_update_response import MessageUpdateResponse
40
- from ...types.agents.message_preview_raw_payload_response import MessagePreviewRawPayloadResponse
41
38
  from ...types.agents.letta_user_message_content_union_param import LettaUserMessageContentUnionParam
42
39
  from ...types.agents.letta_assistant_message_content_union_param import LettaAssistantMessageContentUnionParam
43
40
 
@@ -83,6 +80,10 @@ class MessagesResource(SyncAPIResource):
83
80
  Update the details of a message associated with an agent.
84
81
 
85
82
  Args:
83
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
84
+
85
+ message_id: The ID of the message in the format 'message-<uuid4>'
86
+
86
87
  content: The message content sent by the system (can be a string or an array of
87
88
  multi-modal content parts)
88
89
 
@@ -115,6 +116,10 @@ class MessagesResource(SyncAPIResource):
115
116
  Update the details of a message associated with an agent.
116
117
 
117
118
  Args:
119
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
120
+
121
+ message_id: The ID of the message in the format 'message-<uuid4>'
122
+
118
123
  content: The message content sent by the user (can be a string or an array of multi-modal
119
124
  content parts)
120
125
 
@@ -147,6 +152,10 @@ class MessagesResource(SyncAPIResource):
147
152
  Update the details of a message associated with an agent.
148
153
 
149
154
  Args:
155
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
156
+
157
+ message_id: The ID of the message in the format 'message-<uuid4>'
158
+
150
159
  extra_headers: Send extra headers
151
160
 
152
161
  extra_query: Add additional query parameters to the request
@@ -176,6 +185,10 @@ class MessagesResource(SyncAPIResource):
176
185
  Update the details of a message associated with an agent.
177
186
 
178
187
  Args:
188
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
189
+
190
+ message_id: The ID of the message in the format 'message-<uuid4>'
191
+
179
192
  content: The message content sent by the assistant (can be a string or an array of
180
193
  content parts)
181
194
 
@@ -244,7 +257,9 @@ class MessagesResource(SyncAPIResource):
244
257
  before: Optional[str] | Omit = omit,
245
258
  group_id: Optional[str] | Omit = omit,
246
259
  include_err: Optional[bool] | Omit = omit,
247
- limit: int | Omit = omit,
260
+ limit: Optional[int] | Omit = omit,
261
+ order: Literal["asc", "desc"] | Omit = omit,
262
+ order_by: Literal["created_at"] | Omit = omit,
248
263
  use_assistant_message: bool | Omit = omit,
249
264
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
250
265
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -252,25 +267,34 @@ class MessagesResource(SyncAPIResource):
252
267
  extra_query: Query | None = None,
253
268
  extra_body: Body | None = None,
254
269
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
255
- ) -> MessageListResponse:
270
+ ) -> SyncArrayPage[LettaMessageUnion]:
256
271
  """
257
272
  Retrieve message history for an agent.
258
273
 
259
274
  Args:
260
- after: Message after which to retrieve the returned messages.
275
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
276
+
277
+ after: Message ID cursor for pagination. Returns messages that come after this message
278
+ ID in the specified sort order
261
279
 
262
280
  assistant_message_tool_kwarg: The name of the message argument.
263
281
 
264
282
  assistant_message_tool_name: The name of the designated message tool.
265
283
 
266
- before: Message before which to retrieve the returned messages.
284
+ before: Message ID cursor for pagination. Returns messages that come before this message
285
+ ID in the specified sort order
267
286
 
268
287
  group_id: Group ID to filter messages by.
269
288
 
270
289
  include_err: Whether to include error messages and error statuses. For debugging purposes
271
290
  only.
272
291
 
273
- limit: Maximum number of messages to retrieve.
292
+ limit: Maximum number of messages to return
293
+
294
+ order: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
295
+ newest first
296
+
297
+ order_by: Field to sort by
274
298
 
275
299
  use_assistant_message: Whether to use assistant messages
276
300
 
@@ -284,8 +308,9 @@ class MessagesResource(SyncAPIResource):
284
308
  """
285
309
  if not agent_id:
286
310
  raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
287
- return self._get(
311
+ return self._get_api_list(
288
312
  f"/v1/agents/{agent_id}/messages",
313
+ page=SyncArrayPage[LettaMessageUnion],
289
314
  options=make_request_options(
290
315
  extra_headers=extra_headers,
291
316
  extra_query=extra_query,
@@ -300,12 +325,14 @@ class MessagesResource(SyncAPIResource):
300
325
  "group_id": group_id,
301
326
  "include_err": include_err,
302
327
  "limit": limit,
328
+ "order": order,
329
+ "order_by": order_by,
303
330
  "use_assistant_message": use_assistant_message,
304
331
  },
305
332
  message_list_params.MessageListParams,
306
333
  ),
307
334
  ),
308
- cast_to=MessageListResponse,
335
+ model=cast(Any, LettaMessageUnion), # Union types cannot be passed in as arguments in the type system
309
336
  )
310
337
 
311
338
  def cancel(
@@ -328,6 +355,8 @@ class MessagesResource(SyncAPIResource):
328
355
  Note to cancel active runs associated with an agent, redis is required.
329
356
 
330
357
  Args:
358
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
359
+
331
360
  run_ids: Optional list of run IDs to cancel
332
361
 
333
362
  extra_headers: Send extra headers
@@ -349,48 +378,25 @@ class MessagesResource(SyncAPIResource):
349
378
  cast_to=MessageCancelResponse,
350
379
  )
351
380
 
352
- @overload
353
- def preview_raw_payload(
381
+ def reset(
354
382
  self,
355
383
  agent_id: str,
356
384
  *,
357
- messages: Iterable[message_preview_raw_payload_params.LettaRequestMessage],
358
- assistant_message_tool_kwarg: str | Omit = omit,
359
- assistant_message_tool_name: str | Omit = omit,
360
- enable_thinking: str | Omit = omit,
361
- include_return_message_types: Optional[List[MessageType]] | Omit = omit,
362
- max_steps: int | Omit = omit,
363
- use_assistant_message: bool | Omit = omit,
385
+ add_default_initial_messages: bool | Omit = omit,
364
386
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
365
387
  # The extra values given here take precedence over values defined on the client or passed to this method.
366
388
  extra_headers: Headers | None = None,
367
389
  extra_query: Query | None = None,
368
390
  extra_body: Body | None = None,
369
391
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
370
- ) -> MessagePreviewRawPayloadResponse:
392
+ ) -> AgentState:
371
393
  """
372
- Inspect the raw LLM request payload without sending it.
373
-
374
- This endpoint processes the message through the agent loop up until the LLM
375
- request, then returns the raw request payload that would be sent to the LLM
376
- provider. Useful for debugging and inspection.
394
+ Resets the messages for an agent
377
395
 
378
396
  Args:
379
- messages: The messages to be sent to the agent.
380
-
381
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
382
-
383
- assistant_message_tool_name: The name of the designated message tool.
384
-
385
- enable_thinking: If set to True, enables reasoning before responses or tool calls from the agent.
386
-
387
- include_return_message_types: Only return specified message types in the response. If `None` (default) returns
388
- all messages.
397
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
389
398
 
390
- max_steps: Maximum number of steps the agent should take to process the request.
391
-
392
- use_assistant_message: Whether the server should parse specific tool call arguments (default
393
- `send_message`) as `AssistantMessage` objects.
399
+ add_default_initial_messages: If true, adds the default initial messages after resetting.
394
400
 
395
401
  extra_headers: Send extra headers
396
402
 
@@ -400,188 +406,17 @@ class MessagesResource(SyncAPIResource):
400
406
 
401
407
  timeout: Override the client-level default timeout for this request, in seconds
402
408
  """
403
- ...
404
-
405
- @overload
406
- def preview_raw_payload(
407
- self,
408
- agent_id: str,
409
- *,
410
- messages: Iterable[message_preview_raw_payload_params.LettaStreamingRequestMessage],
411
- assistant_message_tool_kwarg: str | Omit = omit,
412
- assistant_message_tool_name: str | Omit = omit,
413
- background: bool | Omit = omit,
414
- enable_thinking: str | Omit = omit,
415
- include_pings: bool | Omit = omit,
416
- include_return_message_types: Optional[List[MessageType]] | Omit = omit,
417
- max_steps: int | Omit = omit,
418
- stream_tokens: bool | Omit = omit,
419
- use_assistant_message: bool | Omit = omit,
420
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
421
- # The extra values given here take precedence over values defined on the client or passed to this method.
422
- extra_headers: Headers | None = None,
423
- extra_query: Query | None = None,
424
- extra_body: Body | None = None,
425
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
426
- ) -> MessagePreviewRawPayloadResponse:
427
- """
428
- Inspect the raw LLM request payload without sending it.
429
-
430
- This endpoint processes the message through the agent loop up until the LLM
431
- request, then returns the raw request payload that would be sent to the LLM
432
- provider. Useful for debugging and inspection.
433
-
434
- Args:
435
- messages: The messages to be sent to the agent.
436
-
437
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
438
-
439
- assistant_message_tool_name: The name of the designated message tool.
440
-
441
- background: Whether to process the request in the background.
442
-
443
- enable_thinking: If set to True, enables reasoning before responses or tool calls from the agent.
444
-
445
- include_pings: Whether to include periodic keepalive ping messages in the stream to prevent
446
- connection timeouts.
447
-
448
- include_return_message_types: Only return specified message types in the response. If `None` (default) returns
449
- all messages.
450
-
451
- max_steps: Maximum number of steps the agent should take to process the request.
452
-
453
- stream_tokens: Flag to determine if individual tokens should be streamed, rather than streaming
454
- per step.
455
-
456
- use_assistant_message: Whether the server should parse specific tool call arguments (default
457
- `send_message`) as `AssistantMessage` objects.
458
-
459
- extra_headers: Send extra headers
460
-
461
- extra_query: Add additional query parameters to the request
462
-
463
- extra_body: Add additional JSON properties to the request
464
-
465
- timeout: Override the client-level default timeout for this request, in seconds
466
- """
467
- ...
468
-
469
- @required_args(["messages"])
470
- def preview_raw_payload(
471
- self,
472
- agent_id: str,
473
- *,
474
- messages: Iterable[message_preview_raw_payload_params.LettaRequestMessage]
475
- | Iterable[message_preview_raw_payload_params.LettaStreamingRequestMessage],
476
- assistant_message_tool_kwarg: str | Omit = omit,
477
- assistant_message_tool_name: str | Omit = omit,
478
- enable_thinking: str | Omit = omit,
479
- include_return_message_types: Optional[List[MessageType]] | Omit = omit,
480
- max_steps: int | Omit = omit,
481
- use_assistant_message: bool | Omit = omit,
482
- background: bool | Omit = omit,
483
- include_pings: bool | Omit = omit,
484
- stream_tokens: bool | Omit = omit,
485
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
486
- # The extra values given here take precedence over values defined on the client or passed to this method.
487
- extra_headers: Headers | None = None,
488
- extra_query: Query | None = None,
489
- extra_body: Body | None = None,
490
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
491
- ) -> MessagePreviewRawPayloadResponse:
492
409
  if not agent_id:
493
410
  raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
494
- return self._post(
495
- f"/v1/agents/{agent_id}/messages/preview-raw-payload",
411
+ return self._patch(
412
+ f"/v1/agents/{agent_id}/reset-messages",
496
413
  body=maybe_transform(
497
- {
498
- "messages": messages,
499
- "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
500
- "assistant_message_tool_name": assistant_message_tool_name,
501
- "enable_thinking": enable_thinking,
502
- "include_return_message_types": include_return_message_types,
503
- "max_steps": max_steps,
504
- "use_assistant_message": use_assistant_message,
505
- "background": background,
506
- "include_pings": include_pings,
507
- "stream_tokens": stream_tokens,
508
- },
509
- message_preview_raw_payload_params.MessagePreviewRawPayloadParams,
414
+ {"add_default_initial_messages": add_default_initial_messages}, message_reset_params.MessageResetParams
510
415
  ),
511
416
  options=make_request_options(
512
417
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
513
418
  ),
514
- cast_to=MessagePreviewRawPayloadResponse,
515
- )
516
-
517
- def search(
518
- self,
519
- *,
520
- end_date: Union[str, datetime, None] | Omit = omit,
521
- limit: int | Omit = omit,
522
- project_id: Optional[str] | Omit = omit,
523
- query: Optional[str] | Omit = omit,
524
- roles: Optional[List[MessageRole]] | Omit = omit,
525
- search_mode: Literal["vector", "fts", "hybrid"] | Omit = omit,
526
- start_date: Union[str, datetime, None] | Omit = omit,
527
- template_id: Optional[str] | Omit = omit,
528
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
529
- # The extra values given here take precedence over values defined on the client or passed to this method.
530
- extra_headers: Headers | None = None,
531
- extra_query: Query | None = None,
532
- extra_body: Body | None = None,
533
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
534
- ) -> MessageSearchResponse:
535
- """
536
- Search messages across the entire organization with optional project and
537
- template filtering. Returns messages with FTS/vector ranks and total RRF score.
538
-
539
- This is a cloud-only feature.
540
-
541
- Args:
542
- end_date: Filter messages created on or before this date
543
-
544
- limit: Maximum number of results to return
545
-
546
- project_id: Filter messages by project ID
547
-
548
- query: Text query for full-text search
549
-
550
- roles: Filter messages by role
551
-
552
- search_mode: Search mode to use
553
-
554
- start_date: Filter messages created after this date
555
-
556
- template_id: Filter messages by template ID
557
-
558
- extra_headers: Send extra headers
559
-
560
- extra_query: Add additional query parameters to the request
561
-
562
- extra_body: Add additional JSON properties to the request
563
-
564
- timeout: Override the client-level default timeout for this request, in seconds
565
- """
566
- return self._post(
567
- "/v1/agents/messages/search",
568
- body=maybe_transform(
569
- {
570
- "end_date": end_date,
571
- "limit": limit,
572
- "project_id": project_id,
573
- "query": query,
574
- "roles": roles,
575
- "search_mode": search_mode,
576
- "start_date": start_date,
577
- "template_id": template_id,
578
- },
579
- message_search_params.MessageSearchParams,
580
- ),
581
- options=make_request_options(
582
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
583
- ),
584
- cast_to=MessageSearchResponse,
419
+ cast_to=AgentState,
585
420
  )
586
421
 
587
422
  def send(
@@ -608,11 +443,15 @@ class MessagesResource(SyncAPIResource):
608
443
  message from a user and processes it through the agent.
609
444
 
610
445
  Args:
446
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
447
+
611
448
  messages: The messages to be sent to the agent.
612
449
 
613
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
450
+ assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
451
+ for legacy agent types, but deprecated for letta_v1_agent onward.
614
452
 
615
- assistant_message_tool_name: The name of the designated message tool.
453
+ assistant_message_tool_name: The name of the designated message tool. Still supported for legacy agent types,
454
+ but deprecated for letta_v1_agent onward.
616
455
 
617
456
  enable_thinking: If set to True, enables reasoning before responses or tool calls from the agent.
618
457
 
@@ -622,7 +461,8 @@ class MessagesResource(SyncAPIResource):
622
461
  max_steps: Maximum number of steps the agent should take to process the request.
623
462
 
624
463
  use_assistant_message: Whether the server should parse specific tool call arguments (default
625
- `send_message`) as `AssistantMessage` objects.
464
+ `send_message`) as `AssistantMessage` objects. Still supported for legacy agent
465
+ types, but deprecated for letta_v1_agent onward.
626
466
 
627
467
  extra_headers: Send extra headers
628
468
 
@@ -679,15 +519,19 @@ class MessagesResource(SyncAPIResource):
679
519
  processing happens in the background, and the status can be checked using the
680
520
  run ID.
681
521
 
682
- This is "asynchronous" in the sense that it's a background job and explicitly
683
- must be fetched by the run ID. This is more like `send_message_job`
522
+ This is "asynchronous" in the sense that it's a background run and explicitly
523
+ must be fetched by the run ID.
684
524
 
685
525
  Args:
526
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
527
+
686
528
  messages: The messages to be sent to the agent.
687
529
 
688
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
530
+ assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
531
+ for legacy agent types, but deprecated for letta_v1_agent onward.
689
532
 
690
- assistant_message_tool_name: The name of the designated message tool.
533
+ assistant_message_tool_name: The name of the designated message tool. Still supported for legacy agent types,
534
+ but deprecated for letta_v1_agent onward.
691
535
 
692
536
  callback_url: Optional callback URL to POST to when the job completes
693
537
 
@@ -699,7 +543,8 @@ class MessagesResource(SyncAPIResource):
699
543
  max_steps: Maximum number of steps the agent should take to process the request.
700
544
 
701
545
  use_assistant_message: Whether the server should parse specific tool call arguments (default
702
- `send_message`) as `AssistantMessage` objects.
546
+ `send_message`) as `AssistantMessage` objects. Still supported for legacy agent
547
+ types, but deprecated for letta_v1_agent onward.
703
548
 
704
549
  extra_headers: Send extra headers
705
550
 
@@ -732,11 +577,11 @@ class MessagesResource(SyncAPIResource):
732
577
  cast_to=Run,
733
578
  )
734
579
 
735
- def send_stream(
580
+ def stream(
736
581
  self,
737
582
  agent_id: str,
738
583
  *,
739
- messages: Iterable[message_send_stream_params.Message],
584
+ messages: Iterable[message_stream_params.Message],
740
585
  assistant_message_tool_kwarg: str | Omit = omit,
741
586
  assistant_message_tool_name: str | Omit = omit,
742
587
  background: bool | Omit = omit,
@@ -760,11 +605,15 @@ class MessagesResource(SyncAPIResource):
760
605
  of the response always, and stream the tokens if 'stream_tokens' is set to True.
761
606
 
762
607
  Args:
608
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
609
+
763
610
  messages: The messages to be sent to the agent.
764
611
 
765
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
612
+ assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
613
+ for legacy agent types, but deprecated for letta_v1_agent onward.
766
614
 
767
- assistant_message_tool_name: The name of the designated message tool.
615
+ assistant_message_tool_name: The name of the designated message tool. Still supported for legacy agent types,
616
+ but deprecated for letta_v1_agent onward.
768
617
 
769
618
  background: Whether to process the request in the background.
770
619
 
@@ -782,7 +631,8 @@ class MessagesResource(SyncAPIResource):
782
631
  per step.
783
632
 
784
633
  use_assistant_message: Whether the server should parse specific tool call arguments (default
785
- `send_message`) as `AssistantMessage` objects.
634
+ `send_message`) as `AssistantMessage` objects. Still supported for legacy agent
635
+ types, but deprecated for letta_v1_agent onward.
786
636
 
787
637
  extra_headers: Send extra headers
788
638
 
@@ -809,7 +659,7 @@ class MessagesResource(SyncAPIResource):
809
659
  "stream_tokens": stream_tokens,
810
660
  "use_assistant_message": use_assistant_message,
811
661
  },
812
- message_send_stream_params.MessageSendStreamParams,
662
+ message_stream_params.MessageStreamParams,
813
663
  ),
814
664
  options=make_request_options(
815
665
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -817,6 +667,42 @@ class MessagesResource(SyncAPIResource):
817
667
  cast_to=object,
818
668
  )
819
669
 
670
+ def summarize(
671
+ self,
672
+ agent_id: str,
673
+ *,
674
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
675
+ # The extra values given here take precedence over values defined on the client or passed to this method.
676
+ extra_headers: Headers | None = None,
677
+ extra_query: Query | None = None,
678
+ extra_body: Body | None = None,
679
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
680
+ ) -> None:
681
+ """
682
+ Summarize an agent's conversation history.
683
+
684
+ Args:
685
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
686
+
687
+ extra_headers: Send extra headers
688
+
689
+ extra_query: Add additional query parameters to the request
690
+
691
+ extra_body: Add additional JSON properties to the request
692
+
693
+ timeout: Override the client-level default timeout for this request, in seconds
694
+ """
695
+ if not agent_id:
696
+ raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
697
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
698
+ return self._post(
699
+ f"/v1/agents/{agent_id}/summarize",
700
+ options=make_request_options(
701
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
702
+ ),
703
+ cast_to=NoneType,
704
+ )
705
+
820
706
 
821
707
  class AsyncMessagesResource(AsyncAPIResource):
822
708
  @cached_property
@@ -857,6 +743,10 @@ class AsyncMessagesResource(AsyncAPIResource):
857
743
  Update the details of a message associated with an agent.
858
744
 
859
745
  Args:
746
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
747
+
748
+ message_id: The ID of the message in the format 'message-<uuid4>'
749
+
860
750
  content: The message content sent by the system (can be a string or an array of
861
751
  multi-modal content parts)
862
752
 
@@ -889,6 +779,10 @@ class AsyncMessagesResource(AsyncAPIResource):
889
779
  Update the details of a message associated with an agent.
890
780
 
891
781
  Args:
782
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
783
+
784
+ message_id: The ID of the message in the format 'message-<uuid4>'
785
+
892
786
  content: The message content sent by the user (can be a string or an array of multi-modal
893
787
  content parts)
894
788
 
@@ -921,6 +815,10 @@ class AsyncMessagesResource(AsyncAPIResource):
921
815
  Update the details of a message associated with an agent.
922
816
 
923
817
  Args:
818
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
819
+
820
+ message_id: The ID of the message in the format 'message-<uuid4>'
821
+
924
822
  extra_headers: Send extra headers
925
823
 
926
824
  extra_query: Add additional query parameters to the request
@@ -950,6 +848,10 @@ class AsyncMessagesResource(AsyncAPIResource):
950
848
  Update the details of a message associated with an agent.
951
849
 
952
850
  Args:
851
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
852
+
853
+ message_id: The ID of the message in the format 'message-<uuid4>'
854
+
953
855
  content: The message content sent by the assistant (can be a string or an array of
954
856
  content parts)
955
857
 
@@ -1008,7 +910,7 @@ class AsyncMessagesResource(AsyncAPIResource):
1008
910
  ),
1009
911
  )
1010
912
 
1011
- async def list(
913
+ def list(
1012
914
  self,
1013
915
  agent_id: str,
1014
916
  *,
@@ -1018,7 +920,9 @@ class AsyncMessagesResource(AsyncAPIResource):
1018
920
  before: Optional[str] | Omit = omit,
1019
921
  group_id: Optional[str] | Omit = omit,
1020
922
  include_err: Optional[bool] | Omit = omit,
1021
- limit: int | Omit = omit,
923
+ limit: Optional[int] | Omit = omit,
924
+ order: Literal["asc", "desc"] | Omit = omit,
925
+ order_by: Literal["created_at"] | Omit = omit,
1022
926
  use_assistant_message: bool | Omit = omit,
1023
927
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1024
928
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1026,25 +930,34 @@ class AsyncMessagesResource(AsyncAPIResource):
1026
930
  extra_query: Query | None = None,
1027
931
  extra_body: Body | None = None,
1028
932
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
1029
- ) -> MessageListResponse:
933
+ ) -> AsyncPaginator[LettaMessageUnion, AsyncArrayPage[LettaMessageUnion]]:
1030
934
  """
1031
935
  Retrieve message history for an agent.
1032
936
 
1033
937
  Args:
1034
- after: Message after which to retrieve the returned messages.
938
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
939
+
940
+ after: Message ID cursor for pagination. Returns messages that come after this message
941
+ ID in the specified sort order
1035
942
 
1036
943
  assistant_message_tool_kwarg: The name of the message argument.
1037
944
 
1038
945
  assistant_message_tool_name: The name of the designated message tool.
1039
946
 
1040
- before: Message before which to retrieve the returned messages.
947
+ before: Message ID cursor for pagination. Returns messages that come before this message
948
+ ID in the specified sort order
1041
949
 
1042
950
  group_id: Group ID to filter messages by.
1043
951
 
1044
952
  include_err: Whether to include error messages and error statuses. For debugging purposes
1045
953
  only.
1046
954
 
1047
- limit: Maximum number of messages to retrieve.
955
+ limit: Maximum number of messages to return
956
+
957
+ order: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
958
+ newest first
959
+
960
+ order_by: Field to sort by
1048
961
 
1049
962
  use_assistant_message: Whether to use assistant messages
1050
963
 
@@ -1058,14 +971,15 @@ class AsyncMessagesResource(AsyncAPIResource):
1058
971
  """
1059
972
  if not agent_id:
1060
973
  raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
1061
- return await self._get(
974
+ return self._get_api_list(
1062
975
  f"/v1/agents/{agent_id}/messages",
976
+ page=AsyncArrayPage[LettaMessageUnion],
1063
977
  options=make_request_options(
1064
978
  extra_headers=extra_headers,
1065
979
  extra_query=extra_query,
1066
980
  extra_body=extra_body,
1067
981
  timeout=timeout,
1068
- query=await async_maybe_transform(
982
+ query=maybe_transform(
1069
983
  {
1070
984
  "after": after,
1071
985
  "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
@@ -1074,12 +988,14 @@ class AsyncMessagesResource(AsyncAPIResource):
1074
988
  "group_id": group_id,
1075
989
  "include_err": include_err,
1076
990
  "limit": limit,
991
+ "order": order,
992
+ "order_by": order_by,
1077
993
  "use_assistant_message": use_assistant_message,
1078
994
  },
1079
995
  message_list_params.MessageListParams,
1080
996
  ),
1081
997
  ),
1082
- cast_to=MessageListResponse,
998
+ model=cast(Any, LettaMessageUnion), # Union types cannot be passed in as arguments in the type system
1083
999
  )
1084
1000
 
1085
1001
  async def cancel(
@@ -1102,6 +1018,8 @@ class AsyncMessagesResource(AsyncAPIResource):
1102
1018
  Note to cancel active runs associated with an agent, redis is required.
1103
1019
 
1104
1020
  Args:
1021
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
1022
+
1105
1023
  run_ids: Optional list of run IDs to cancel
1106
1024
 
1107
1025
  extra_headers: Send extra headers
@@ -1123,48 +1041,25 @@ class AsyncMessagesResource(AsyncAPIResource):
1123
1041
  cast_to=MessageCancelResponse,
1124
1042
  )
1125
1043
 
1126
- @overload
1127
- async def preview_raw_payload(
1044
+ async def reset(
1128
1045
  self,
1129
1046
  agent_id: str,
1130
1047
  *,
1131
- messages: Iterable[message_preview_raw_payload_params.LettaRequestMessage],
1132
- assistant_message_tool_kwarg: str | Omit = omit,
1133
- assistant_message_tool_name: str | Omit = omit,
1134
- enable_thinking: str | Omit = omit,
1135
- include_return_message_types: Optional[List[MessageType]] | Omit = omit,
1136
- max_steps: int | Omit = omit,
1137
- use_assistant_message: bool | Omit = omit,
1048
+ add_default_initial_messages: bool | Omit = omit,
1138
1049
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1139
1050
  # The extra values given here take precedence over values defined on the client or passed to this method.
1140
1051
  extra_headers: Headers | None = None,
1141
1052
  extra_query: Query | None = None,
1142
1053
  extra_body: Body | None = None,
1143
1054
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
1144
- ) -> MessagePreviewRawPayloadResponse:
1055
+ ) -> AgentState:
1145
1056
  """
1146
- Inspect the raw LLM request payload without sending it.
1147
-
1148
- This endpoint processes the message through the agent loop up until the LLM
1149
- request, then returns the raw request payload that would be sent to the LLM
1150
- provider. Useful for debugging and inspection.
1057
+ Resets the messages for an agent
1151
1058
 
1152
1059
  Args:
1153
- messages: The messages to be sent to the agent.
1154
-
1155
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
1156
-
1157
- assistant_message_tool_name: The name of the designated message tool.
1158
-
1159
- enable_thinking: If set to True, enables reasoning before responses or tool calls from the agent.
1160
-
1161
- include_return_message_types: Only return specified message types in the response. If `None` (default) returns
1162
- all messages.
1163
-
1164
- max_steps: Maximum number of steps the agent should take to process the request.
1060
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
1165
1061
 
1166
- use_assistant_message: Whether the server should parse specific tool call arguments (default
1167
- `send_message`) as `AssistantMessage` objects.
1062
+ add_default_initial_messages: If true, adds the default initial messages after resetting.
1168
1063
 
1169
1064
  extra_headers: Send extra headers
1170
1065
 
@@ -1174,188 +1069,17 @@ class AsyncMessagesResource(AsyncAPIResource):
1174
1069
 
1175
1070
  timeout: Override the client-level default timeout for this request, in seconds
1176
1071
  """
1177
- ...
1178
-
1179
- @overload
1180
- async def preview_raw_payload(
1181
- self,
1182
- agent_id: str,
1183
- *,
1184
- messages: Iterable[message_preview_raw_payload_params.LettaStreamingRequestMessage],
1185
- assistant_message_tool_kwarg: str | Omit = omit,
1186
- assistant_message_tool_name: str | Omit = omit,
1187
- background: bool | Omit = omit,
1188
- enable_thinking: str | Omit = omit,
1189
- include_pings: bool | Omit = omit,
1190
- include_return_message_types: Optional[List[MessageType]] | Omit = omit,
1191
- max_steps: int | Omit = omit,
1192
- stream_tokens: bool | Omit = omit,
1193
- use_assistant_message: bool | Omit = omit,
1194
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1195
- # The extra values given here take precedence over values defined on the client or passed to this method.
1196
- extra_headers: Headers | None = None,
1197
- extra_query: Query | None = None,
1198
- extra_body: Body | None = None,
1199
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
1200
- ) -> MessagePreviewRawPayloadResponse:
1201
- """
1202
- Inspect the raw LLM request payload without sending it.
1203
-
1204
- This endpoint processes the message through the agent loop up until the LLM
1205
- request, then returns the raw request payload that would be sent to the LLM
1206
- provider. Useful for debugging and inspection.
1207
-
1208
- Args:
1209
- messages: The messages to be sent to the agent.
1210
-
1211
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
1212
-
1213
- assistant_message_tool_name: The name of the designated message tool.
1214
-
1215
- background: Whether to process the request in the background.
1216
-
1217
- enable_thinking: If set to True, enables reasoning before responses or tool calls from the agent.
1218
-
1219
- include_pings: Whether to include periodic keepalive ping messages in the stream to prevent
1220
- connection timeouts.
1221
-
1222
- include_return_message_types: Only return specified message types in the response. If `None` (default) returns
1223
- all messages.
1224
-
1225
- max_steps: Maximum number of steps the agent should take to process the request.
1226
-
1227
- stream_tokens: Flag to determine if individual tokens should be streamed, rather than streaming
1228
- per step.
1229
-
1230
- use_assistant_message: Whether the server should parse specific tool call arguments (default
1231
- `send_message`) as `AssistantMessage` objects.
1232
-
1233
- extra_headers: Send extra headers
1234
-
1235
- extra_query: Add additional query parameters to the request
1236
-
1237
- extra_body: Add additional JSON properties to the request
1238
-
1239
- timeout: Override the client-level default timeout for this request, in seconds
1240
- """
1241
- ...
1242
-
1243
- @required_args(["messages"])
1244
- async def preview_raw_payload(
1245
- self,
1246
- agent_id: str,
1247
- *,
1248
- messages: Iterable[message_preview_raw_payload_params.LettaRequestMessage]
1249
- | Iterable[message_preview_raw_payload_params.LettaStreamingRequestMessage],
1250
- assistant_message_tool_kwarg: str | Omit = omit,
1251
- assistant_message_tool_name: str | Omit = omit,
1252
- enable_thinking: str | Omit = omit,
1253
- include_return_message_types: Optional[List[MessageType]] | Omit = omit,
1254
- max_steps: int | Omit = omit,
1255
- use_assistant_message: bool | Omit = omit,
1256
- background: bool | Omit = omit,
1257
- include_pings: bool | Omit = omit,
1258
- stream_tokens: bool | Omit = omit,
1259
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1260
- # The extra values given here take precedence over values defined on the client or passed to this method.
1261
- extra_headers: Headers | None = None,
1262
- extra_query: Query | None = None,
1263
- extra_body: Body | None = None,
1264
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
1265
- ) -> MessagePreviewRawPayloadResponse:
1266
1072
  if not agent_id:
1267
1073
  raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
1268
- return await self._post(
1269
- f"/v1/agents/{agent_id}/messages/preview-raw-payload",
1074
+ return await self._patch(
1075
+ f"/v1/agents/{agent_id}/reset-messages",
1270
1076
  body=await async_maybe_transform(
1271
- {
1272
- "messages": messages,
1273
- "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
1274
- "assistant_message_tool_name": assistant_message_tool_name,
1275
- "enable_thinking": enable_thinking,
1276
- "include_return_message_types": include_return_message_types,
1277
- "max_steps": max_steps,
1278
- "use_assistant_message": use_assistant_message,
1279
- "background": background,
1280
- "include_pings": include_pings,
1281
- "stream_tokens": stream_tokens,
1282
- },
1283
- message_preview_raw_payload_params.MessagePreviewRawPayloadParams,
1077
+ {"add_default_initial_messages": add_default_initial_messages}, message_reset_params.MessageResetParams
1284
1078
  ),
1285
1079
  options=make_request_options(
1286
1080
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1287
1081
  ),
1288
- cast_to=MessagePreviewRawPayloadResponse,
1289
- )
1290
-
1291
- async def search(
1292
- self,
1293
- *,
1294
- end_date: Union[str, datetime, None] | Omit = omit,
1295
- limit: int | Omit = omit,
1296
- project_id: Optional[str] | Omit = omit,
1297
- query: Optional[str] | Omit = omit,
1298
- roles: Optional[List[MessageRole]] | Omit = omit,
1299
- search_mode: Literal["vector", "fts", "hybrid"] | Omit = omit,
1300
- start_date: Union[str, datetime, None] | Omit = omit,
1301
- template_id: Optional[str] | Omit = omit,
1302
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1303
- # The extra values given here take precedence over values defined on the client or passed to this method.
1304
- extra_headers: Headers | None = None,
1305
- extra_query: Query | None = None,
1306
- extra_body: Body | None = None,
1307
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
1308
- ) -> MessageSearchResponse:
1309
- """
1310
- Search messages across the entire organization with optional project and
1311
- template filtering. Returns messages with FTS/vector ranks and total RRF score.
1312
-
1313
- This is a cloud-only feature.
1314
-
1315
- Args:
1316
- end_date: Filter messages created on or before this date
1317
-
1318
- limit: Maximum number of results to return
1319
-
1320
- project_id: Filter messages by project ID
1321
-
1322
- query: Text query for full-text search
1323
-
1324
- roles: Filter messages by role
1325
-
1326
- search_mode: Search mode to use
1327
-
1328
- start_date: Filter messages created after this date
1329
-
1330
- template_id: Filter messages by template ID
1331
-
1332
- extra_headers: Send extra headers
1333
-
1334
- extra_query: Add additional query parameters to the request
1335
-
1336
- extra_body: Add additional JSON properties to the request
1337
-
1338
- timeout: Override the client-level default timeout for this request, in seconds
1339
- """
1340
- return await self._post(
1341
- "/v1/agents/messages/search",
1342
- body=await async_maybe_transform(
1343
- {
1344
- "end_date": end_date,
1345
- "limit": limit,
1346
- "project_id": project_id,
1347
- "query": query,
1348
- "roles": roles,
1349
- "search_mode": search_mode,
1350
- "start_date": start_date,
1351
- "template_id": template_id,
1352
- },
1353
- message_search_params.MessageSearchParams,
1354
- ),
1355
- options=make_request_options(
1356
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1357
- ),
1358
- cast_to=MessageSearchResponse,
1082
+ cast_to=AgentState,
1359
1083
  )
1360
1084
 
1361
1085
  async def send(
@@ -1382,11 +1106,15 @@ class AsyncMessagesResource(AsyncAPIResource):
1382
1106
  message from a user and processes it through the agent.
1383
1107
 
1384
1108
  Args:
1109
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
1110
+
1385
1111
  messages: The messages to be sent to the agent.
1386
1112
 
1387
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
1113
+ assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
1114
+ for legacy agent types, but deprecated for letta_v1_agent onward.
1388
1115
 
1389
- assistant_message_tool_name: The name of the designated message tool.
1116
+ assistant_message_tool_name: The name of the designated message tool. Still supported for legacy agent types,
1117
+ but deprecated for letta_v1_agent onward.
1390
1118
 
1391
1119
  enable_thinking: If set to True, enables reasoning before responses or tool calls from the agent.
1392
1120
 
@@ -1396,7 +1124,8 @@ class AsyncMessagesResource(AsyncAPIResource):
1396
1124
  max_steps: Maximum number of steps the agent should take to process the request.
1397
1125
 
1398
1126
  use_assistant_message: Whether the server should parse specific tool call arguments (default
1399
- `send_message`) as `AssistantMessage` objects.
1127
+ `send_message`) as `AssistantMessage` objects. Still supported for legacy agent
1128
+ types, but deprecated for letta_v1_agent onward.
1400
1129
 
1401
1130
  extra_headers: Send extra headers
1402
1131
 
@@ -1453,15 +1182,19 @@ class AsyncMessagesResource(AsyncAPIResource):
1453
1182
  processing happens in the background, and the status can be checked using the
1454
1183
  run ID.
1455
1184
 
1456
- This is "asynchronous" in the sense that it's a background job and explicitly
1457
- must be fetched by the run ID. This is more like `send_message_job`
1185
+ This is "asynchronous" in the sense that it's a background run and explicitly
1186
+ must be fetched by the run ID.
1458
1187
 
1459
1188
  Args:
1189
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
1190
+
1460
1191
  messages: The messages to be sent to the agent.
1461
1192
 
1462
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
1193
+ assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
1194
+ for legacy agent types, but deprecated for letta_v1_agent onward.
1463
1195
 
1464
- assistant_message_tool_name: The name of the designated message tool.
1196
+ assistant_message_tool_name: The name of the designated message tool. Still supported for legacy agent types,
1197
+ but deprecated for letta_v1_agent onward.
1465
1198
 
1466
1199
  callback_url: Optional callback URL to POST to when the job completes
1467
1200
 
@@ -1473,7 +1206,8 @@ class AsyncMessagesResource(AsyncAPIResource):
1473
1206
  max_steps: Maximum number of steps the agent should take to process the request.
1474
1207
 
1475
1208
  use_assistant_message: Whether the server should parse specific tool call arguments (default
1476
- `send_message`) as `AssistantMessage` objects.
1209
+ `send_message`) as `AssistantMessage` objects. Still supported for legacy agent
1210
+ types, but deprecated for letta_v1_agent onward.
1477
1211
 
1478
1212
  extra_headers: Send extra headers
1479
1213
 
@@ -1506,11 +1240,11 @@ class AsyncMessagesResource(AsyncAPIResource):
1506
1240
  cast_to=Run,
1507
1241
  )
1508
1242
 
1509
- async def send_stream(
1243
+ async def stream(
1510
1244
  self,
1511
1245
  agent_id: str,
1512
1246
  *,
1513
- messages: Iterable[message_send_stream_params.Message],
1247
+ messages: Iterable[message_stream_params.Message],
1514
1248
  assistant_message_tool_kwarg: str | Omit = omit,
1515
1249
  assistant_message_tool_name: str | Omit = omit,
1516
1250
  background: bool | Omit = omit,
@@ -1534,11 +1268,15 @@ class AsyncMessagesResource(AsyncAPIResource):
1534
1268
  of the response always, and stream the tokens if 'stream_tokens' is set to True.
1535
1269
 
1536
1270
  Args:
1271
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
1272
+
1537
1273
  messages: The messages to be sent to the agent.
1538
1274
 
1539
- assistant_message_tool_kwarg: The name of the message argument in the designated message tool.
1275
+ assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
1276
+ for legacy agent types, but deprecated for letta_v1_agent onward.
1540
1277
 
1541
- assistant_message_tool_name: The name of the designated message tool.
1278
+ assistant_message_tool_name: The name of the designated message tool. Still supported for legacy agent types,
1279
+ but deprecated for letta_v1_agent onward.
1542
1280
 
1543
1281
  background: Whether to process the request in the background.
1544
1282
 
@@ -1556,7 +1294,8 @@ class AsyncMessagesResource(AsyncAPIResource):
1556
1294
  per step.
1557
1295
 
1558
1296
  use_assistant_message: Whether the server should parse specific tool call arguments (default
1559
- `send_message`) as `AssistantMessage` objects.
1297
+ `send_message`) as `AssistantMessage` objects. Still supported for legacy agent
1298
+ types, but deprecated for letta_v1_agent onward.
1560
1299
 
1561
1300
  extra_headers: Send extra headers
1562
1301
 
@@ -1583,7 +1322,7 @@ class AsyncMessagesResource(AsyncAPIResource):
1583
1322
  "stream_tokens": stream_tokens,
1584
1323
  "use_assistant_message": use_assistant_message,
1585
1324
  },
1586
- message_send_stream_params.MessageSendStreamParams,
1325
+ message_stream_params.MessageStreamParams,
1587
1326
  ),
1588
1327
  options=make_request_options(
1589
1328
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -1591,6 +1330,42 @@ class AsyncMessagesResource(AsyncAPIResource):
1591
1330
  cast_to=object,
1592
1331
  )
1593
1332
 
1333
+ async def summarize(
1334
+ self,
1335
+ agent_id: str,
1336
+ *,
1337
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1338
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1339
+ extra_headers: Headers | None = None,
1340
+ extra_query: Query | None = None,
1341
+ extra_body: Body | None = None,
1342
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1343
+ ) -> None:
1344
+ """
1345
+ Summarize an agent's conversation history.
1346
+
1347
+ Args:
1348
+ agent_id: The ID of the agent in the format 'agent-<uuid4>'
1349
+
1350
+ extra_headers: Send extra headers
1351
+
1352
+ extra_query: Add additional query parameters to the request
1353
+
1354
+ extra_body: Add additional JSON properties to the request
1355
+
1356
+ timeout: Override the client-level default timeout for this request, in seconds
1357
+ """
1358
+ if not agent_id:
1359
+ raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
1360
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
1361
+ return await self._post(
1362
+ f"/v1/agents/{agent_id}/summarize",
1363
+ options=make_request_options(
1364
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1365
+ ),
1366
+ cast_to=NoneType,
1367
+ )
1368
+
1594
1369
 
1595
1370
  class MessagesResourceWithRawResponse:
1596
1371
  def __init__(self, messages: MessagesResource) -> None:
@@ -1605,11 +1380,8 @@ class MessagesResourceWithRawResponse:
1605
1380
  self.cancel = to_raw_response_wrapper(
1606
1381
  messages.cancel,
1607
1382
  )
1608
- self.preview_raw_payload = to_raw_response_wrapper(
1609
- messages.preview_raw_payload,
1610
- )
1611
- self.search = to_raw_response_wrapper(
1612
- messages.search,
1383
+ self.reset = to_raw_response_wrapper(
1384
+ messages.reset,
1613
1385
  )
1614
1386
  self.send = to_raw_response_wrapper(
1615
1387
  messages.send,
@@ -1617,8 +1389,11 @@ class MessagesResourceWithRawResponse:
1617
1389
  self.send_async = to_raw_response_wrapper(
1618
1390
  messages.send_async,
1619
1391
  )
1620
- self.send_stream = to_raw_response_wrapper(
1621
- messages.send_stream,
1392
+ self.stream = to_raw_response_wrapper(
1393
+ messages.stream,
1394
+ )
1395
+ self.summarize = to_raw_response_wrapper(
1396
+ messages.summarize,
1622
1397
  )
1623
1398
 
1624
1399
 
@@ -1635,11 +1410,8 @@ class AsyncMessagesResourceWithRawResponse:
1635
1410
  self.cancel = async_to_raw_response_wrapper(
1636
1411
  messages.cancel,
1637
1412
  )
1638
- self.preview_raw_payload = async_to_raw_response_wrapper(
1639
- messages.preview_raw_payload,
1640
- )
1641
- self.search = async_to_raw_response_wrapper(
1642
- messages.search,
1413
+ self.reset = async_to_raw_response_wrapper(
1414
+ messages.reset,
1643
1415
  )
1644
1416
  self.send = async_to_raw_response_wrapper(
1645
1417
  messages.send,
@@ -1647,8 +1419,11 @@ class AsyncMessagesResourceWithRawResponse:
1647
1419
  self.send_async = async_to_raw_response_wrapper(
1648
1420
  messages.send_async,
1649
1421
  )
1650
- self.send_stream = async_to_raw_response_wrapper(
1651
- messages.send_stream,
1422
+ self.stream = async_to_raw_response_wrapper(
1423
+ messages.stream,
1424
+ )
1425
+ self.summarize = async_to_raw_response_wrapper(
1426
+ messages.summarize,
1652
1427
  )
1653
1428
 
1654
1429
 
@@ -1665,11 +1440,8 @@ class MessagesResourceWithStreamingResponse:
1665
1440
  self.cancel = to_streamed_response_wrapper(
1666
1441
  messages.cancel,
1667
1442
  )
1668
- self.preview_raw_payload = to_streamed_response_wrapper(
1669
- messages.preview_raw_payload,
1670
- )
1671
- self.search = to_streamed_response_wrapper(
1672
- messages.search,
1443
+ self.reset = to_streamed_response_wrapper(
1444
+ messages.reset,
1673
1445
  )
1674
1446
  self.send = to_streamed_response_wrapper(
1675
1447
  messages.send,
@@ -1677,8 +1449,11 @@ class MessagesResourceWithStreamingResponse:
1677
1449
  self.send_async = to_streamed_response_wrapper(
1678
1450
  messages.send_async,
1679
1451
  )
1680
- self.send_stream = to_streamed_response_wrapper(
1681
- messages.send_stream,
1452
+ self.stream = to_streamed_response_wrapper(
1453
+ messages.stream,
1454
+ )
1455
+ self.summarize = to_streamed_response_wrapper(
1456
+ messages.summarize,
1682
1457
  )
1683
1458
 
1684
1459
 
@@ -1695,11 +1470,8 @@ class AsyncMessagesResourceWithStreamingResponse:
1695
1470
  self.cancel = async_to_streamed_response_wrapper(
1696
1471
  messages.cancel,
1697
1472
  )
1698
- self.preview_raw_payload = async_to_streamed_response_wrapper(
1699
- messages.preview_raw_payload,
1700
- )
1701
- self.search = async_to_streamed_response_wrapper(
1702
- messages.search,
1473
+ self.reset = async_to_streamed_response_wrapper(
1474
+ messages.reset,
1703
1475
  )
1704
1476
  self.send = async_to_streamed_response_wrapper(
1705
1477
  messages.send,
@@ -1707,6 +1479,9 @@ class AsyncMessagesResourceWithStreamingResponse:
1707
1479
  self.send_async = async_to_streamed_response_wrapper(
1708
1480
  messages.send_async,
1709
1481
  )
1710
- self.send_stream = async_to_streamed_response_wrapper(
1711
- messages.send_stream,
1482
+ self.stream = async_to_streamed_response_wrapper(
1483
+ messages.stream,
1484
+ )
1485
+ self.summarize = async_to_streamed_response_wrapper(
1486
+ messages.summarize,
1712
1487
  )