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