letta-client 0.0.1285__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.
Files changed (564) hide show
  1. letta_client/__init__.py +1000 -0
  2. letta_client/agents/__init__.py +358 -0
  3. letta_client/agents/archival_memory/__init__.py +2 -0
  4. letta_client/agents/archival_memory/client.py +466 -0
  5. letta_client/agents/client.py +1598 -0
  6. letta_client/agents/context/__init__.py +2 -0
  7. letta_client/agents/context/client.py +147 -0
  8. letta_client/agents/core_memory/__init__.py +2 -0
  9. letta_client/agents/core_memory/client.py +878 -0
  10. letta_client/agents/memory_variables/__init__.py +5 -0
  11. letta_client/agents/memory_variables/client.py +150 -0
  12. letta_client/agents/memory_variables/types/__init__.py +5 -0
  13. letta_client/agents/memory_variables/types/memory_variables_list_response.py +19 -0
  14. letta_client/agents/messages/__init__.py +5 -0
  15. letta_client/agents/messages/client.py +1061 -0
  16. letta_client/agents/messages/types/__init__.py +6 -0
  17. letta_client/agents/messages/types/letta_streaming_response.py +20 -0
  18. letta_client/agents/messages/types/message_update_content.py +6 -0
  19. letta_client/agents/sources/__init__.py +2 -0
  20. letta_client/agents/sources/client.py +406 -0
  21. letta_client/agents/templates/__init__.py +5 -0
  22. letta_client/agents/templates/client.py +573 -0
  23. letta_client/agents/templates/types/__init__.py +6 -0
  24. letta_client/agents/templates/types/templates_create_response.py +22 -0
  25. letta_client/agents/templates/types/templates_migrate_response.py +19 -0
  26. letta_client/agents/tools/__init__.py +2 -0
  27. letta_client/agents/tools/client.py +406 -0
  28. letta_client/agents/types/__init__.py +565 -0
  29. letta_client/agents/types/agents_search_request_search_item.py +10 -0
  30. letta_client/agents/types/agents_search_request_search_item_field.py +21 -0
  31. letta_client/agents/types/agents_search_request_search_item_one.py +22 -0
  32. letta_client/agents/types/agents_search_request_search_item_one_operator.py +5 -0
  33. letta_client/agents/types/agents_search_request_search_item_zero.py +20 -0
  34. letta_client/agents/types/agents_search_response.py +23 -0
  35. letta_client/agents/types/agents_search_response_agents_item.py +63 -0
  36. letta_client/agents/types/agents_search_response_agents_item_agent_type.py +7 -0
  37. letta_client/agents/types/agents_search_response_agents_item_base_template_id.py +11 -0
  38. letta_client/agents/types/agents_search_response_agents_item_base_template_id_item.py +5 -0
  39. letta_client/agents/types/agents_search_response_agents_item_created_at.py +11 -0
  40. letta_client/agents/types/agents_search_response_agents_item_created_at_item.py +5 -0
  41. letta_client/agents/types/agents_search_response_agents_item_created_by_id.py +11 -0
  42. letta_client/agents/types/agents_search_response_agents_item_created_by_id_item.py +5 -0
  43. letta_client/agents/types/agents_search_response_agents_item_description.py +11 -0
  44. letta_client/agents/types/agents_search_response_agents_item_description_item.py +5 -0
  45. letta_client/agents/types/agents_search_response_agents_item_embedding_config.py +48 -0
  46. letta_client/agents/types/agents_search_response_agents_item_embedding_config_azure_deployment.py +13 -0
  47. letta_client/agents/types/agents_search_response_agents_item_embedding_config_azure_deployment_item.py +5 -0
  48. letta_client/agents/types/agents_search_response_agents_item_embedding_config_azure_endpoint.py +13 -0
  49. letta_client/agents/types/agents_search_response_agents_item_embedding_config_azure_endpoint_item.py +5 -0
  50. letta_client/agents/types/agents_search_response_agents_item_embedding_config_azure_version.py +13 -0
  51. letta_client/agents/types/agents_search_response_agents_item_embedding_config_azure_version_item.py +5 -0
  52. letta_client/agents/types/agents_search_response_agents_item_embedding_config_embedding_chunk_size.py +13 -0
  53. letta_client/agents/types/agents_search_response_agents_item_embedding_config_embedding_chunk_size_item.py +5 -0
  54. letta_client/agents/types/agents_search_response_agents_item_embedding_config_embedding_endpoint.py +13 -0
  55. letta_client/agents/types/agents_search_response_agents_item_embedding_config_embedding_endpoint_item.py +5 -0
  56. letta_client/agents/types/agents_search_response_agents_item_embedding_config_embedding_endpoint_type.py +27 -0
  57. letta_client/agents/types/agents_search_response_agents_item_embedding_config_handle.py +13 -0
  58. letta_client/agents/types/agents_search_response_agents_item_embedding_config_handle_item.py +5 -0
  59. letta_client/agents/types/agents_search_response_agents_item_last_updated_by_id.py +13 -0
  60. letta_client/agents/types/agents_search_response_agents_item_last_updated_by_id_item.py +5 -0
  61. letta_client/agents/types/agents_search_response_agents_item_llm_config.py +46 -0
  62. letta_client/agents/types/agents_search_response_agents_item_llm_config_handle.py +11 -0
  63. letta_client/agents/types/agents_search_response_agents_item_llm_config_handle_item.py +5 -0
  64. letta_client/agents/types/agents_search_response_agents_item_llm_config_max_tokens.py +13 -0
  65. letta_client/agents/types/agents_search_response_agents_item_llm_config_max_tokens_item.py +5 -0
  66. letta_client/agents/types/agents_search_response_agents_item_llm_config_model_endpoint.py +13 -0
  67. letta_client/agents/types/agents_search_response_agents_item_llm_config_model_endpoint_item.py +5 -0
  68. letta_client/agents/types/agents_search_response_agents_item_llm_config_model_endpoint_type.py +27 -0
  69. letta_client/agents/types/agents_search_response_agents_item_llm_config_model_wrapper.py +13 -0
  70. letta_client/agents/types/agents_search_response_agents_item_llm_config_model_wrapper_item.py +5 -0
  71. letta_client/agents/types/agents_search_response_agents_item_llm_config_put_inner_thoughts_in_kwargs.py +13 -0
  72. letta_client/agents/types/agents_search_response_agents_item_llm_config_put_inner_thoughts_in_kwargs_item.py +5 -0
  73. letta_client/agents/types/agents_search_response_agents_item_llm_config_temperature.py +5 -0
  74. letta_client/agents/types/agents_search_response_agents_item_memory.py +24 -0
  75. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item.py +57 -0
  76. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_created_by_id.py +13 -0
  77. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_created_by_id_item.py +5 -0
  78. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_description.py +13 -0
  79. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_description_item.py +5 -0
  80. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_id.py +5 -0
  81. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_is_template.py +5 -0
  82. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_label.py +13 -0
  83. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_label_item.py +5 -0
  84. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_last_updated_by_id.py +13 -0
  85. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_last_updated_by_id_item.py +5 -0
  86. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_limit.py +5 -0
  87. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_metadata.py +12 -0
  88. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_metadata_item.py +7 -0
  89. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_name.py +13 -0
  90. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_name_item.py +5 -0
  91. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_organization_id.py +13 -0
  92. letta_client/agents/types/agents_search_response_agents_item_memory_blocks_item_organization_id_item.py +5 -0
  93. letta_client/agents/types/agents_search_response_agents_item_memory_prompt_template.py +5 -0
  94. letta_client/agents/types/agents_search_response_agents_item_message_ids.py +11 -0
  95. letta_client/agents/types/agents_search_response_agents_item_message_ids_item.py +5 -0
  96. letta_client/agents/types/agents_search_response_agents_item_metadata.py +10 -0
  97. letta_client/agents/types/agents_search_response_agents_item_metadata_item.py +5 -0
  98. letta_client/agents/types/agents_search_response_agents_item_organization_id.py +11 -0
  99. letta_client/agents/types/agents_search_response_agents_item_organization_id_item.py +5 -0
  100. letta_client/agents/types/agents_search_response_agents_item_project_id.py +11 -0
  101. letta_client/agents/types/agents_search_response_agents_item_project_id_item.py +5 -0
  102. letta_client/agents/types/agents_search_response_agents_item_sources_item.py +51 -0
  103. letta_client/agents/types/agents_search_response_agents_item_sources_item_created_at.py +13 -0
  104. letta_client/agents/types/agents_search_response_agents_item_sources_item_created_at_item.py +5 -0
  105. letta_client/agents/types/agents_search_response_agents_item_sources_item_created_by_id.py +13 -0
  106. letta_client/agents/types/agents_search_response_agents_item_sources_item_created_by_id_item.py +5 -0
  107. letta_client/agents/types/agents_search_response_agents_item_sources_item_description.py +13 -0
  108. letta_client/agents/types/agents_search_response_agents_item_sources_item_description_item.py +5 -0
  109. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config.py +52 -0
  110. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_azure_deployment.py +13 -0
  111. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_azure_deployment_item.py +5 -0
  112. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_azure_endpoint.py +13 -0
  113. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_azure_endpoint_item.py +5 -0
  114. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_azure_version.py +13 -0
  115. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_azure_version_item.py +5 -0
  116. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_embedding_chunk_size.py +13 -0
  117. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_embedding_chunk_size_item.py +7 -0
  118. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_embedding_endpoint.py +13 -0
  119. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_embedding_endpoint_item.py +5 -0
  120. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_embedding_endpoint_type.py +27 -0
  121. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_handle.py +13 -0
  122. letta_client/agents/types/agents_search_response_agents_item_sources_item_embedding_config_handle_item.py +5 -0
  123. letta_client/agents/types/agents_search_response_agents_item_sources_item_id.py +5 -0
  124. letta_client/agents/types/agents_search_response_agents_item_sources_item_last_updated_by_id.py +13 -0
  125. letta_client/agents/types/agents_search_response_agents_item_sources_item_last_updated_by_id_item.py +5 -0
  126. letta_client/agents/types/agents_search_response_agents_item_sources_item_metadata.py +12 -0
  127. letta_client/agents/types/agents_search_response_agents_item_sources_item_metadata_item.py +5 -0
  128. letta_client/agents/types/agents_search_response_agents_item_sources_item_organization_id.py +13 -0
  129. letta_client/agents/types/agents_search_response_agents_item_sources_item_organization_id_item.py +5 -0
  130. letta_client/agents/types/agents_search_response_agents_item_sources_item_updated_at.py +13 -0
  131. letta_client/agents/types/agents_search_response_agents_item_sources_item_updated_at_item.py +5 -0
  132. letta_client/agents/types/agents_search_response_agents_item_template_id.py +11 -0
  133. letta_client/agents/types/agents_search_response_agents_item_template_id_item.py +5 -0
  134. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables.py +10 -0
  135. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item.py +53 -0
  136. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_created_at.py +13 -0
  137. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_created_at_item.py +5 -0
  138. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_created_by_id.py +13 -0
  139. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_created_by_id_item.py +5 -0
  140. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_description.py +13 -0
  141. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_description_item.py +5 -0
  142. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_id.py +5 -0
  143. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_last_updated_by_id.py +13 -0
  144. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_last_updated_by_id_item.py +7 -0
  145. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_organization_id.py +13 -0
  146. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_organization_id_item.py +7 -0
  147. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_updated_at.py +13 -0
  148. letta_client/agents/types/agents_search_response_agents_item_tool_exec_environment_variables_item_updated_at_item.py +5 -0
  149. letta_client/agents/types/agents_search_response_agents_item_tool_rules.py +11 -0
  150. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item.py +8 -0
  151. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_child_output_mapping.py +34 -0
  152. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_child_output_mapping_default_child.py +13 -0
  153. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_child_output_mapping_default_child_item.py +5 -0
  154. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_child_output_mapping_require_output_mapping.py +7 -0
  155. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_child_output_mapping_type.py +7 -0
  156. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_children.py +24 -0
  157. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_children_type.py +7 -0
  158. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item.py +22 -0
  159. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_child_output_mapping.py +34 -0
  160. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_child_output_mapping_default_child.py +13 -0
  161. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_child_output_mapping_default_child_item.py +7 -0
  162. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_child_output_mapping_require_output_mapping.py +7 -0
  163. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_child_output_mapping_type.py +7 -0
  164. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_children.py +24 -0
  165. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_children_type.py +7 -0
  166. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_one.py +23 -0
  167. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_one_type.py +7 -0
  168. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_two.py +23 -0
  169. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_item_two_type.py +7 -0
  170. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_one.py +23 -0
  171. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_one_type.py +7 -0
  172. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_two.py +23 -0
  173. letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_two_type.py +7 -0
  174. letta_client/agents/types/agents_search_response_agents_item_tools_item.py +47 -0
  175. letta_client/agents/types/agents_search_response_agents_item_tools_item_created_by_id.py +10 -0
  176. letta_client/agents/types/agents_search_response_agents_item_tools_item_created_by_id_item.py +5 -0
  177. letta_client/agents/types/agents_search_response_agents_item_tools_item_description.py +10 -0
  178. letta_client/agents/types/agents_search_response_agents_item_tools_item_description_item.py +5 -0
  179. letta_client/agents/types/agents_search_response_agents_item_tools_item_json_schema.py +12 -0
  180. letta_client/agents/types/agents_search_response_agents_item_tools_item_json_schema_item.py +5 -0
  181. letta_client/agents/types/agents_search_response_agents_item_tools_item_last_updated_by_id.py +10 -0
  182. letta_client/agents/types/agents_search_response_agents_item_tools_item_last_updated_by_id_item.py +5 -0
  183. letta_client/agents/types/agents_search_response_agents_item_tools_item_name.py +8 -0
  184. letta_client/agents/types/agents_search_response_agents_item_tools_item_name_item.py +5 -0
  185. letta_client/agents/types/agents_search_response_agents_item_tools_item_organization_id.py +10 -0
  186. letta_client/agents/types/agents_search_response_agents_item_tools_item_organization_id_item.py +5 -0
  187. letta_client/agents/types/agents_search_response_agents_item_tools_item_source_code.py +10 -0
  188. letta_client/agents/types/agents_search_response_agents_item_tools_item_source_code_item.py +5 -0
  189. letta_client/agents/types/agents_search_response_agents_item_tools_item_source_type.py +10 -0
  190. letta_client/agents/types/agents_search_response_agents_item_tools_item_source_type_item.py +5 -0
  191. letta_client/agents/types/agents_search_response_agents_item_tools_item_tool_type.py +10 -0
  192. letta_client/agents/types/agents_search_response_agents_item_updated_at.py +11 -0
  193. letta_client/agents/types/agents_search_response_agents_item_updated_at_item.py +5 -0
  194. letta_client/agents/types/create_agent_request_tool_rules_item.py +9 -0
  195. letta_client/agents/types/update_agent_tool_rules_item.py +9 -0
  196. letta_client/base_client.py +184 -0
  197. letta_client/blocks/__init__.py +2 -0
  198. letta_client/blocks/client.py +933 -0
  199. letta_client/client.py +76 -0
  200. letta_client/core/__init__.py +51 -0
  201. letta_client/core/api_error.py +15 -0
  202. letta_client/core/client_wrapper.py +65 -0
  203. letta_client/core/datetime_utils.py +28 -0
  204. letta_client/core/file.py +67 -0
  205. letta_client/core/http_client.py +499 -0
  206. letta_client/core/jsonable_encoder.py +101 -0
  207. letta_client/core/pydantic_utilities.py +296 -0
  208. letta_client/core/query_encoder.py +58 -0
  209. letta_client/core/remove_none_from_dict.py +11 -0
  210. letta_client/core/request_options.py +35 -0
  211. letta_client/core/serialization.py +272 -0
  212. letta_client/core/unchecked_base_model.py +305 -0
  213. letta_client/environment.py +8 -0
  214. letta_client/errors/__init__.py +8 -0
  215. letta_client/errors/conflict_error.py +9 -0
  216. letta_client/errors/internal_server_error.py +9 -0
  217. letta_client/errors/not_found_error.py +9 -0
  218. letta_client/errors/unprocessable_entity_error.py +9 -0
  219. letta_client/health/__init__.py +2 -0
  220. letta_client/health/client.py +108 -0
  221. letta_client/jobs/__init__.py +2 -0
  222. letta_client/jobs/client.py +503 -0
  223. letta_client/models/__init__.py +2 -0
  224. letta_client/models/client.py +201 -0
  225. letta_client/providers/__init__.py +2 -0
  226. letta_client/providers/client.py +597 -0
  227. letta_client/py.typed +0 -0
  228. letta_client/runs/__init__.py +2 -0
  229. letta_client/runs/client.py +824 -0
  230. letta_client/sources/__init__.py +5 -0
  231. letta_client/sources/client.py +878 -0
  232. letta_client/sources/files/__init__.py +2 -0
  233. letta_client/sources/files/client.py +436 -0
  234. letta_client/sources/passages/__init__.py +2 -0
  235. letta_client/sources/passages/client.py +145 -0
  236. letta_client/steps/__init__.py +2 -0
  237. letta_client/steps/client.py +339 -0
  238. letta_client/tag/__init__.py +2 -0
  239. letta_client/tag/client.py +169 -0
  240. letta_client/templates/__init__.py +327 -0
  241. letta_client/templates/client.py +198 -0
  242. letta_client/templates/types/__init__.py +643 -0
  243. letta_client/templates/types/templates_create_agents_from_template_response.py +22 -0
  244. letta_client/templates/types/templates_create_agents_from_template_response_agents_item.py +100 -0
  245. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_agent_type.py +7 -0
  246. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_base_template_id.py +13 -0
  247. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_base_template_id_item.py +5 -0
  248. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_created_at.py +13 -0
  249. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_created_at_item.py +5 -0
  250. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_created_by_id.py +13 -0
  251. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_created_by_id_item.py +5 -0
  252. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_description.py +13 -0
  253. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_description_item.py +5 -0
  254. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config.py +58 -0
  255. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_azure_deployment.py +13 -0
  256. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_azure_deployment_item.py +7 -0
  257. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_azure_endpoint.py +13 -0
  258. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_azure_endpoint_item.py +7 -0
  259. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_azure_version.py +13 -0
  260. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_azure_version_item.py +7 -0
  261. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_embedding_chunk_size.py +15 -0
  262. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_embedding_chunk_size_item.py +7 -0
  263. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_embedding_endpoint.py +15 -0
  264. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_embedding_endpoint_item.py +7 -0
  265. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_embedding_endpoint_type.py +27 -0
  266. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_handle.py +13 -0
  267. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_embedding_config_handle_item.py +5 -0
  268. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_last_updated_by_id.py +13 -0
  269. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_last_updated_by_id_item.py +5 -0
  270. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config.py +50 -0
  271. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_handle.py +13 -0
  272. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_handle_item.py +5 -0
  273. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_max_tokens.py +13 -0
  274. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_max_tokens_item.py +5 -0
  275. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_model_endpoint.py +13 -0
  276. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_model_endpoint_item.py +5 -0
  277. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_model_endpoint_type.py +27 -0
  278. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_model_wrapper.py +13 -0
  279. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_model_wrapper_item.py +5 -0
  280. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_put_inner_thoughts_in_kwargs.py +15 -0
  281. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_put_inner_thoughts_in_kwargs_item.py +7 -0
  282. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_temperature.py +7 -0
  283. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory.py +26 -0
  284. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item.py +65 -0
  285. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_created_by_id.py +13 -0
  286. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_created_by_id_item.py +7 -0
  287. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_description.py +13 -0
  288. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_description_item.py +7 -0
  289. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_id.py +5 -0
  290. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_is_template.py +7 -0
  291. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_label.py +13 -0
  292. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_label_item.py +5 -0
  293. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_last_updated_by_id.py +15 -0
  294. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_last_updated_by_id_item.py +7 -0
  295. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_limit.py +7 -0
  296. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_metadata.py +12 -0
  297. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_metadata_item.py +7 -0
  298. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_name.py +13 -0
  299. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_name_item.py +5 -0
  300. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_organization_id.py +13 -0
  301. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_blocks_item_organization_id_item.py +7 -0
  302. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_memory_prompt_template.py +5 -0
  303. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_message_ids.py +13 -0
  304. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_message_ids_item.py +5 -0
  305. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_metadata.py +12 -0
  306. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_metadata_item.py +7 -0
  307. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_organization_id.py +13 -0
  308. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_organization_id_item.py +5 -0
  309. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_project_id.py +13 -0
  310. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_project_id_item.py +5 -0
  311. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item.py +59 -0
  312. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_created_at.py +13 -0
  313. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_created_at_item.py +5 -0
  314. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_created_by_id.py +13 -0
  315. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_created_by_id_item.py +5 -0
  316. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_description.py +13 -0
  317. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_description_item.py +5 -0
  318. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config.py +60 -0
  319. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_azure_deployment.py +17 -0
  320. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_azure_deployment_item.py +7 -0
  321. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_azure_endpoint.py +15 -0
  322. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_azure_endpoint_item.py +7 -0
  323. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_azure_version.py +15 -0
  324. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_azure_version_item.py +7 -0
  325. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_embedding_chunk_size.py +17 -0
  326. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_embedding_chunk_size_item.py +7 -0
  327. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_embedding_endpoint.py +17 -0
  328. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_embedding_endpoint_item.py +7 -0
  329. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_embedding_endpoint_type.py +27 -0
  330. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_handle.py +15 -0
  331. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_embedding_config_handle_item.py +7 -0
  332. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_id.py +5 -0
  333. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_last_updated_by_id.py +13 -0
  334. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_last_updated_by_id_item.py +7 -0
  335. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_metadata.py +12 -0
  336. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_metadata_item.py +7 -0
  337. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_organization_id.py +13 -0
  338. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_organization_id_item.py +7 -0
  339. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_updated_at.py +13 -0
  340. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_sources_item_updated_at_item.py +5 -0
  341. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_template_id.py +13 -0
  342. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_template_id_item.py +5 -0
  343. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables.py +11 -0
  344. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item.py +61 -0
  345. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_created_at.py +17 -0
  346. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_created_at_item.py +7 -0
  347. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_created_by_id.py +17 -0
  348. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_created_by_id_item.py +7 -0
  349. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_description.py +17 -0
  350. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_description_item.py +7 -0
  351. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_id.py +7 -0
  352. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_last_updated_by_id.py +17 -0
  353. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_last_updated_by_id_item.py +7 -0
  354. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_organization_id.py +17 -0
  355. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_organization_id_item.py +7 -0
  356. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_updated_at.py +17 -0
  357. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_updated_at_item.py +7 -0
  358. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules.py +13 -0
  359. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item.py +10 -0
  360. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_child_output_mapping.py +36 -0
  361. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_child_output_mapping_default_child.py +17 -0
  362. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_child_output_mapping_default_child_item.py +7 -0
  363. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_child_output_mapping_require_output_mapping.py +7 -0
  364. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_child_output_mapping_type.py +7 -0
  365. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_children.py +24 -0
  366. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_children_type.py +7 -0
  367. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item.py +22 -0
  368. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_child_output_mapping.py +38 -0
  369. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_child_output_mapping_default_child.py +17 -0
  370. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_child_output_mapping_default_child_item.py +7 -0
  371. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_child_output_mapping_require_output_mapping.py +7 -0
  372. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_child_output_mapping_type.py +7 -0
  373. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_children.py +24 -0
  374. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_children_type.py +7 -0
  375. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_one.py +23 -0
  376. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_one_type.py +7 -0
  377. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_two.py +23 -0
  378. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_item_two_type.py +7 -0
  379. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_one.py +23 -0
  380. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_one_type.py +7 -0
  381. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_two.py +23 -0
  382. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_rules_item_two_type.py +7 -0
  383. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item.py +59 -0
  384. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_created_by_id.py +12 -0
  385. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_created_by_id_item.py +5 -0
  386. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_description.py +12 -0
  387. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_description_item.py +5 -0
  388. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_json_schema.py +12 -0
  389. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_json_schema_item.py +7 -0
  390. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_last_updated_by_id.py +12 -0
  391. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_last_updated_by_id_item.py +7 -0
  392. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_name.py +12 -0
  393. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_name_item.py +5 -0
  394. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_organization_id.py +12 -0
  395. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_organization_id_item.py +5 -0
  396. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_source_code.py +12 -0
  397. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_source_code_item.py +5 -0
  398. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_source_type.py +12 -0
  399. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_source_type_item.py +5 -0
  400. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_tool_type.py +10 -0
  401. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_updated_at.py +13 -0
  402. letta_client/templates/types/templates_create_agents_from_template_response_agents_item_updated_at_item.py +5 -0
  403. letta_client/tools/__init__.py +2 -0
  404. letta_client/tools/client.py +1665 -0
  405. letta_client/types/__init__.py +321 -0
  406. letta_client/types/action_model.py +38 -0
  407. letta_client/types/action_parameters_model.py +26 -0
  408. letta_client/types/action_response_model.py +26 -0
  409. letta_client/types/agent_environment_variable.py +63 -0
  410. letta_client/types/agent_state.py +153 -0
  411. letta_client/types/agent_state_tool_rules_item.py +9 -0
  412. letta_client/types/agent_type.py +7 -0
  413. letta_client/types/app_auth_scheme.py +34 -0
  414. letta_client/types/app_auth_scheme_auth_mode.py +7 -0
  415. letta_client/types/app_model.py +44 -0
  416. letta_client/types/assistant_message.py +24 -0
  417. letta_client/types/assistant_message_content.py +6 -0
  418. letta_client/types/audio.py +19 -0
  419. letta_client/types/auth_request.py +22 -0
  420. letta_client/types/auth_response.py +29 -0
  421. letta_client/types/auth_scheme_field.py +30 -0
  422. letta_client/types/block.py +82 -0
  423. letta_client/types/block_update.py +56 -0
  424. letta_client/types/chat_completion_assistant_message_param.py +29 -0
  425. letta_client/types/chat_completion_assistant_message_param_content.py +8 -0
  426. letta_client/types/chat_completion_assistant_message_param_content_item.py +9 -0
  427. letta_client/types/chat_completion_audio_param.py +22 -0
  428. letta_client/types/chat_completion_audio_param_format.py +5 -0
  429. letta_client/types/chat_completion_audio_param_voice.py +7 -0
  430. letta_client/types/chat_completion_content_part_image_param.py +21 -0
  431. letta_client/types/chat_completion_content_part_input_audio_param.py +21 -0
  432. letta_client/types/chat_completion_content_part_refusal_param.py +20 -0
  433. letta_client/types/chat_completion_content_part_text_param.py +20 -0
  434. letta_client/types/chat_completion_developer_message_param.py +22 -0
  435. letta_client/types/chat_completion_developer_message_param_content.py +6 -0
  436. letta_client/types/chat_completion_function_call_option_param.py +19 -0
  437. letta_client/types/chat_completion_function_message_param.py +21 -0
  438. letta_client/types/chat_completion_message_tool_call_input.py +24 -0
  439. letta_client/types/chat_completion_message_tool_call_output.py +22 -0
  440. letta_client/types/chat_completion_message_tool_call_param.py +24 -0
  441. letta_client/types/chat_completion_named_tool_choice_param.py +23 -0
  442. letta_client/types/chat_completion_prediction_content_param.py +21 -0
  443. letta_client/types/chat_completion_prediction_content_param_content.py +6 -0
  444. letta_client/types/chat_completion_stream_options_param.py +19 -0
  445. letta_client/types/chat_completion_system_message_param.py +22 -0
  446. letta_client/types/chat_completion_system_message_param_content.py +6 -0
  447. letta_client/types/chat_completion_tool_message_param.py +22 -0
  448. letta_client/types/chat_completion_tool_message_param_content.py +6 -0
  449. letta_client/types/chat_completion_tool_param.py +21 -0
  450. letta_client/types/chat_completion_user_message_param.py +22 -0
  451. letta_client/types/chat_completion_user_message_param_content.py +6 -0
  452. letta_client/types/chat_completion_user_message_param_content_item.py +10 -0
  453. letta_client/types/child_tool_rule.py +32 -0
  454. letta_client/types/completion_create_params_non_streaming.py +62 -0
  455. letta_client/types/completion_create_params_non_streaming_function_call.py +8 -0
  456. letta_client/types/completion_create_params_non_streaming_messages_item.py +18 -0
  457. letta_client/types/completion_create_params_non_streaming_modalities_item.py +5 -0
  458. letta_client/types/completion_create_params_non_streaming_model.py +46 -0
  459. letta_client/types/completion_create_params_non_streaming_reasoning_effort.py +5 -0
  460. letta_client/types/completion_create_params_non_streaming_response_format.py +10 -0
  461. letta_client/types/completion_create_params_non_streaming_service_tier.py +5 -0
  462. letta_client/types/completion_create_params_non_streaming_stop.py +5 -0
  463. letta_client/types/completion_create_params_non_streaming_tool_choice.py +8 -0
  464. letta_client/types/completion_create_params_streaming.py +62 -0
  465. letta_client/types/completion_create_params_streaming_function_call.py +8 -0
  466. letta_client/types/completion_create_params_streaming_messages_item.py +18 -0
  467. letta_client/types/completion_create_params_streaming_modalities_item.py +5 -0
  468. letta_client/types/completion_create_params_streaming_model.py +46 -0
  469. letta_client/types/completion_create_params_streaming_reasoning_effort.py +5 -0
  470. letta_client/types/completion_create_params_streaming_response_format.py +10 -0
  471. letta_client/types/completion_create_params_streaming_service_tier.py +5 -0
  472. letta_client/types/completion_create_params_streaming_stop.py +5 -0
  473. letta_client/types/completion_create_params_streaming_tool_choice.py +8 -0
  474. letta_client/types/conditional_tool_rule.py +42 -0
  475. letta_client/types/conflict_error_body.py +21 -0
  476. letta_client/types/context_window_overview.py +108 -0
  477. letta_client/types/create_block.py +52 -0
  478. letta_client/types/e_2_b_sandbox_config.py +32 -0
  479. letta_client/types/embedding_config.py +77 -0
  480. letta_client/types/embedding_config_embedding_endpoint_type.py +27 -0
  481. letta_client/types/file_metadata.py +77 -0
  482. letta_client/types/function_call.py +20 -0
  483. letta_client/types/function_definition_input.py +22 -0
  484. letta_client/types/function_definition_output.py +22 -0
  485. letta_client/types/function_output.py +20 -0
  486. letta_client/types/function_tool.py +21 -0
  487. letta_client/types/health.py +24 -0
  488. letta_client/types/http_validation_error.py +20 -0
  489. letta_client/types/image_url.py +21 -0
  490. letta_client/types/image_url_detail.py +5 -0
  491. letta_client/types/init_tool_rule.py +28 -0
  492. letta_client/types/input_audio.py +21 -0
  493. letta_client/types/input_audio_format.py +5 -0
  494. letta_client/types/internal_server_error_body.py +19 -0
  495. letta_client/types/job.py +76 -0
  496. letta_client/types/job_status.py +5 -0
  497. letta_client/types/job_type.py +5 -0
  498. letta_client/types/json_schema.py +26 -0
  499. letta_client/types/letta_message_union.py +13 -0
  500. letta_client/types/letta_request.py +38 -0
  501. letta_client/types/letta_request_config.py +32 -0
  502. letta_client/types/letta_response.py +38 -0
  503. letta_client/types/letta_usage_statistics.py +48 -0
  504. letta_client/types/llm_config.py +77 -0
  505. letta_client/types/llm_config_model_endpoint_type.py +27 -0
  506. letta_client/types/local_sandbox_config.py +38 -0
  507. letta_client/types/memory.py +32 -0
  508. letta_client/types/message.py +102 -0
  509. letta_client/types/message_create.py +38 -0
  510. letta_client/types/message_create_content.py +6 -0
  511. letta_client/types/message_create_role.py +5 -0
  512. letta_client/types/message_role.py +5 -0
  513. letta_client/types/not_found_error_body.py +19 -0
  514. letta_client/types/not_found_error_body_message.py +11 -0
  515. letta_client/types/openai_types_chat_chat_completion_message_tool_call_function.py +20 -0
  516. letta_client/types/openai_types_chat_chat_completion_message_tool_call_param_function.py +20 -0
  517. letta_client/types/openai_types_chat_chat_completion_named_tool_choice_param_function.py +19 -0
  518. letta_client/types/openai_types_chat_completion_create_params_function.py +21 -0
  519. letta_client/types/organization.py +33 -0
  520. letta_client/types/organization_create.py +22 -0
  521. letta_client/types/passage.py +98 -0
  522. letta_client/types/pip_requirement.py +27 -0
  523. letta_client/types/provider.py +38 -0
  524. letta_client/types/reasoning_message.py +32 -0
  525. letta_client/types/response_format_json_object.py +19 -0
  526. letta_client/types/response_format_json_schema.py +21 -0
  527. letta_client/types/response_format_text.py +19 -0
  528. letta_client/types/run.py +79 -0
  529. letta_client/types/sandbox_config.py +54 -0
  530. letta_client/types/sandbox_config_create.py +23 -0
  531. letta_client/types/sandbox_config_create_config.py +7 -0
  532. letta_client/types/sandbox_config_update.py +27 -0
  533. letta_client/types/sandbox_config_update_config.py +7 -0
  534. letta_client/types/sandbox_environment_variable.py +63 -0
  535. letta_client/types/sandbox_environment_variable_create.py +32 -0
  536. letta_client/types/sandbox_environment_variable_update.py +32 -0
  537. letta_client/types/sandbox_type.py +5 -0
  538. letta_client/types/source.py +76 -0
  539. letta_client/types/step.py +95 -0
  540. letta_client/types/system_message.py +33 -0
  541. letta_client/types/system_message_content.py +6 -0
  542. letta_client/types/terminal_tool_rule.py +28 -0
  543. letta_client/types/text_content.py +23 -0
  544. letta_client/types/tool.py +84 -0
  545. letta_client/types/tool_call.py +21 -0
  546. letta_client/types/tool_call_delta.py +21 -0
  547. letta_client/types/tool_call_message.py +33 -0
  548. letta_client/types/tool_call_message_tool_call.py +7 -0
  549. letta_client/types/tool_create.py +47 -0
  550. letta_client/types/tool_return_message.py +41 -0
  551. letta_client/types/tool_return_message_status.py +5 -0
  552. letta_client/types/tool_type.py +10 -0
  553. letta_client/types/usage_statistics.py +21 -0
  554. letta_client/types/user.py +52 -0
  555. letta_client/types/user_create.py +22 -0
  556. letta_client/types/user_message.py +33 -0
  557. letta_client/types/user_message_content.py +6 -0
  558. letta_client/types/user_update.py +27 -0
  559. letta_client/types/validation_error.py +22 -0
  560. letta_client/types/validation_error_loc_item.py +5 -0
  561. letta_client/version.py +3 -0
  562. letta_client-0.0.1285.dist-info/METADATA +189 -0
  563. letta_client-0.0.1285.dist-info/RECORD +564 -0
  564. letta_client-0.0.1285.dist-info/WHEEL +4 -0
@@ -0,0 +1,1598 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from ..core.client_wrapper import SyncClientWrapper
5
+ from .context.client import ContextClient
6
+ from .tools.client import ToolsClient
7
+ from .sources.client import SourcesClient
8
+ from .core_memory.client import CoreMemoryClient
9
+ from .archival_memory.client import ArchivalMemoryClient
10
+ from .messages.client import MessagesClient
11
+ from .templates.client import TemplatesClient
12
+ from .memory_variables.client import MemoryVariablesClient
13
+ from ..core.request_options import RequestOptions
14
+ from ..types.agent_state import AgentState
15
+ from ..core.unchecked_base_model import construct_type
16
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
17
+ from ..types.http_validation_error import HttpValidationError
18
+ from json.decoder import JSONDecodeError
19
+ from ..core.api_error import ApiError
20
+ from ..types.create_block import CreateBlock
21
+ from .types.create_agent_request_tool_rules_item import CreateAgentRequestToolRulesItem
22
+ from ..types.agent_type import AgentType
23
+ from ..types.llm_config import LlmConfig
24
+ from ..types.embedding_config import EmbeddingConfig
25
+ from ..types.message_create import MessageCreate
26
+ from ..core.serialization import convert_and_respect_annotation_metadata
27
+ from ..core.jsonable_encoder import jsonable_encoder
28
+ from .types.update_agent_tool_rules_item import UpdateAgentToolRulesItem
29
+ from .types.agents_search_request_search_item import AgentsSearchRequestSearchItem
30
+ from .types.agents_search_response import AgentsSearchResponse
31
+ from ..core.client_wrapper import AsyncClientWrapper
32
+ from .context.client import AsyncContextClient
33
+ from .tools.client import AsyncToolsClient
34
+ from .sources.client import AsyncSourcesClient
35
+ from .core_memory.client import AsyncCoreMemoryClient
36
+ from .archival_memory.client import AsyncArchivalMemoryClient
37
+ from .messages.client import AsyncMessagesClient
38
+ from .templates.client import AsyncTemplatesClient
39
+ from .memory_variables.client import AsyncMemoryVariablesClient
40
+
41
+ # this is used as the default value for optional parameters
42
+ OMIT = typing.cast(typing.Any, ...)
43
+
44
+
45
+ class AgentsClient:
46
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
47
+ self._client_wrapper = client_wrapper
48
+ self.context = ContextClient(client_wrapper=self._client_wrapper)
49
+ self.tools = ToolsClient(client_wrapper=self._client_wrapper)
50
+ self.sources = SourcesClient(client_wrapper=self._client_wrapper)
51
+ self.core_memory = CoreMemoryClient(client_wrapper=self._client_wrapper)
52
+ self.archival_memory = ArchivalMemoryClient(client_wrapper=self._client_wrapper)
53
+ self.messages = MessagesClient(client_wrapper=self._client_wrapper)
54
+ self.templates = TemplatesClient(client_wrapper=self._client_wrapper)
55
+ self.memory_variables = MemoryVariablesClient(client_wrapper=self._client_wrapper)
56
+
57
+ def list(
58
+ self,
59
+ *,
60
+ name: typing.Optional[str] = None,
61
+ tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
62
+ match_all_tags: typing.Optional[bool] = None,
63
+ before: typing.Optional[str] = None,
64
+ after: typing.Optional[str] = None,
65
+ limit: typing.Optional[int] = None,
66
+ query_text: typing.Optional[str] = None,
67
+ project_id: typing.Optional[str] = None,
68
+ template_id: typing.Optional[str] = None,
69
+ base_template_id: typing.Optional[str] = None,
70
+ request_options: typing.Optional[RequestOptions] = None,
71
+ ) -> typing.List[AgentState]:
72
+ """
73
+ List all agents associated with a given user.
74
+ This endpoint retrieves a list of all agents and their configurations associated with the specified user ID.
75
+
76
+ Parameters
77
+ ----------
78
+ name : typing.Optional[str]
79
+ Name of the agent
80
+
81
+ tags : typing.Optional[typing.Union[str, typing.Sequence[str]]]
82
+ List of tags to filter agents by
83
+
84
+ match_all_tags : typing.Optional[bool]
85
+ If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed in tags.
86
+
87
+ before : typing.Optional[str]
88
+ Cursor for pagination
89
+
90
+ after : typing.Optional[str]
91
+ Cursor for pagination
92
+
93
+ limit : typing.Optional[int]
94
+ Limit for pagination
95
+
96
+ query_text : typing.Optional[str]
97
+ Search agents by name
98
+
99
+ project_id : typing.Optional[str]
100
+ Search agents by project id
101
+
102
+ template_id : typing.Optional[str]
103
+ Search agents by template id
104
+
105
+ base_template_id : typing.Optional[str]
106
+ Search agents by base template id
107
+
108
+ request_options : typing.Optional[RequestOptions]
109
+ Request-specific configuration.
110
+
111
+ Returns
112
+ -------
113
+ typing.List[AgentState]
114
+ Successful Response
115
+
116
+ Examples
117
+ --------
118
+ from letta_client import Letta
119
+
120
+ client = Letta(
121
+ token="YOUR_TOKEN",
122
+ )
123
+ client.agents.list()
124
+ """
125
+ _response = self._client_wrapper.httpx_client.request(
126
+ "v1/agents/",
127
+ method="GET",
128
+ params={
129
+ "name": name,
130
+ "tags": tags,
131
+ "match_all_tags": match_all_tags,
132
+ "before": before,
133
+ "after": after,
134
+ "limit": limit,
135
+ "query_text": query_text,
136
+ "project_id": project_id,
137
+ "template_id": template_id,
138
+ "base_template_id": base_template_id,
139
+ },
140
+ request_options=request_options,
141
+ )
142
+ try:
143
+ if 200 <= _response.status_code < 300:
144
+ return typing.cast(
145
+ typing.List[AgentState],
146
+ construct_type(
147
+ type_=typing.List[AgentState], # type: ignore
148
+ object_=_response.json(),
149
+ ),
150
+ )
151
+ if _response.status_code == 422:
152
+ raise UnprocessableEntityError(
153
+ typing.cast(
154
+ HttpValidationError,
155
+ construct_type(
156
+ type_=HttpValidationError, # type: ignore
157
+ object_=_response.json(),
158
+ ),
159
+ )
160
+ )
161
+ _response_json = _response.json()
162
+ except JSONDecodeError:
163
+ raise ApiError(status_code=_response.status_code, body=_response.text)
164
+ raise ApiError(status_code=_response.status_code, body=_response_json)
165
+
166
+ def create(
167
+ self,
168
+ *,
169
+ name: typing.Optional[str] = OMIT,
170
+ memory_blocks: typing.Optional[typing.Sequence[CreateBlock]] = OMIT,
171
+ tools: typing.Optional[typing.Sequence[str]] = OMIT,
172
+ tool_ids: typing.Optional[typing.Sequence[str]] = OMIT,
173
+ source_ids: typing.Optional[typing.Sequence[str]] = OMIT,
174
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
175
+ tool_rules: typing.Optional[typing.Sequence[CreateAgentRequestToolRulesItem]] = OMIT,
176
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
177
+ system: typing.Optional[str] = OMIT,
178
+ agent_type: typing.Optional[AgentType] = OMIT,
179
+ llm_config: typing.Optional[LlmConfig] = OMIT,
180
+ embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
181
+ initial_message_sequence: typing.Optional[typing.Sequence[MessageCreate]] = OMIT,
182
+ include_base_tools: typing.Optional[bool] = OMIT,
183
+ include_multi_agent_tools: typing.Optional[bool] = OMIT,
184
+ description: typing.Optional[str] = OMIT,
185
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
186
+ model: typing.Optional[str] = OMIT,
187
+ embedding: typing.Optional[str] = OMIT,
188
+ context_window_limit: typing.Optional[int] = OMIT,
189
+ embedding_chunk_size: typing.Optional[int] = OMIT,
190
+ from_template: typing.Optional[str] = OMIT,
191
+ template: typing.Optional[bool] = OMIT,
192
+ project: typing.Optional[str] = OMIT,
193
+ tool_exec_environment_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
194
+ memory_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
195
+ project_id: typing.Optional[str] = OMIT,
196
+ template_id: typing.Optional[str] = OMIT,
197
+ base_template_id: typing.Optional[str] = OMIT,
198
+ request_options: typing.Optional[RequestOptions] = None,
199
+ ) -> AgentState:
200
+ """
201
+ Create a new agent with the specified configuration.
202
+
203
+ Parameters
204
+ ----------
205
+ name : typing.Optional[str]
206
+ The name of the agent.
207
+
208
+ memory_blocks : typing.Optional[typing.Sequence[CreateBlock]]
209
+ The blocks to create in the agent's in-context memory.
210
+
211
+ tools : typing.Optional[typing.Sequence[str]]
212
+ The tools used by the agent.
213
+
214
+ tool_ids : typing.Optional[typing.Sequence[str]]
215
+ The ids of the tools used by the agent.
216
+
217
+ source_ids : typing.Optional[typing.Sequence[str]]
218
+ The ids of the sources used by the agent.
219
+
220
+ block_ids : typing.Optional[typing.Sequence[str]]
221
+ The ids of the blocks used by the agent.
222
+
223
+ tool_rules : typing.Optional[typing.Sequence[CreateAgentRequestToolRulesItem]]
224
+ The tool rules governing the agent.
225
+
226
+ tags : typing.Optional[typing.Sequence[str]]
227
+ The tags associated with the agent.
228
+
229
+ system : typing.Optional[str]
230
+ The system prompt used by the agent.
231
+
232
+ agent_type : typing.Optional[AgentType]
233
+ The type of agent.
234
+
235
+ llm_config : typing.Optional[LlmConfig]
236
+ The LLM configuration used by the agent.
237
+
238
+ embedding_config : typing.Optional[EmbeddingConfig]
239
+ The embedding configuration used by the agent.
240
+
241
+ initial_message_sequence : typing.Optional[typing.Sequence[MessageCreate]]
242
+ The initial set of messages to put in the agent's in-context memory.
243
+
244
+ include_base_tools : typing.Optional[bool]
245
+ If true, attaches the Letta core tools (e.g. archival_memory and core_memory related functions).
246
+
247
+ include_multi_agent_tools : typing.Optional[bool]
248
+ If true, attaches the Letta multi-agent tools (e.g. sending a message to another agent).
249
+
250
+ description : typing.Optional[str]
251
+ The description of the agent.
252
+
253
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
254
+ The metadata of the agent.
255
+
256
+ model : typing.Optional[str]
257
+ The LLM configuration handle used by the agent, specified in the format provider/model-name, as an alternative to specifying llm_config.
258
+
259
+ embedding : typing.Optional[str]
260
+ The embedding configuration handle used by the agent, specified in the format provider/model-name.
261
+
262
+ context_window_limit : typing.Optional[int]
263
+ The context window limit used by the agent.
264
+
265
+ embedding_chunk_size : typing.Optional[int]
266
+ The embedding chunk size used by the agent.
267
+
268
+ from_template : typing.Optional[str]
269
+ The template id used to configure the agent
270
+
271
+ template : typing.Optional[bool]
272
+ Whether the agent is a template
273
+
274
+ project : typing.Optional[str]
275
+ The project slug that the agent will be associated with.
276
+
277
+ tool_exec_environment_variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
278
+ The environment variables for tool execution specific to this agent.
279
+
280
+ memory_variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
281
+ The variables that should be set for the agent.
282
+
283
+ project_id : typing.Optional[str]
284
+ The id of the project the agent belongs to.
285
+
286
+ template_id : typing.Optional[str]
287
+ The id of the template the agent belongs to.
288
+
289
+ base_template_id : typing.Optional[str]
290
+ The base template id of the agent.
291
+
292
+ request_options : typing.Optional[RequestOptions]
293
+ Request-specific configuration.
294
+
295
+ Returns
296
+ -------
297
+ AgentState
298
+ Successful Response
299
+
300
+ Examples
301
+ --------
302
+ from letta_client import Letta
303
+
304
+ client = Letta(
305
+ token="YOUR_TOKEN",
306
+ )
307
+ client.agents.create()
308
+ """
309
+ _response = self._client_wrapper.httpx_client.request(
310
+ "v1/agents/",
311
+ method="POST",
312
+ json={
313
+ "name": name,
314
+ "memory_blocks": convert_and_respect_annotation_metadata(
315
+ object_=memory_blocks, annotation=typing.Sequence[CreateBlock], direction="write"
316
+ ),
317
+ "tools": tools,
318
+ "tool_ids": tool_ids,
319
+ "source_ids": source_ids,
320
+ "block_ids": block_ids,
321
+ "tool_rules": convert_and_respect_annotation_metadata(
322
+ object_=tool_rules, annotation=typing.Sequence[CreateAgentRequestToolRulesItem], direction="write"
323
+ ),
324
+ "tags": tags,
325
+ "system": system,
326
+ "agent_type": agent_type,
327
+ "llm_config": convert_and_respect_annotation_metadata(
328
+ object_=llm_config, annotation=LlmConfig, direction="write"
329
+ ),
330
+ "embedding_config": convert_and_respect_annotation_metadata(
331
+ object_=embedding_config, annotation=EmbeddingConfig, direction="write"
332
+ ),
333
+ "initial_message_sequence": convert_and_respect_annotation_metadata(
334
+ object_=initial_message_sequence, annotation=typing.Sequence[MessageCreate], direction="write"
335
+ ),
336
+ "include_base_tools": include_base_tools,
337
+ "include_multi_agent_tools": include_multi_agent_tools,
338
+ "description": description,
339
+ "metadata": metadata,
340
+ "model": model,
341
+ "embedding": embedding,
342
+ "context_window_limit": context_window_limit,
343
+ "embedding_chunk_size": embedding_chunk_size,
344
+ "from_template": from_template,
345
+ "template": template,
346
+ "project": project,
347
+ "tool_exec_environment_variables": tool_exec_environment_variables,
348
+ "memory_variables": memory_variables,
349
+ "project_id": project_id,
350
+ "template_id": template_id,
351
+ "base_template_id": base_template_id,
352
+ },
353
+ headers={
354
+ "content-type": "application/json",
355
+ },
356
+ request_options=request_options,
357
+ omit=OMIT,
358
+ )
359
+ try:
360
+ if 200 <= _response.status_code < 300:
361
+ return typing.cast(
362
+ AgentState,
363
+ construct_type(
364
+ type_=AgentState, # type: ignore
365
+ object_=_response.json(),
366
+ ),
367
+ )
368
+ if _response.status_code == 422:
369
+ raise UnprocessableEntityError(
370
+ typing.cast(
371
+ HttpValidationError,
372
+ construct_type(
373
+ type_=HttpValidationError, # type: ignore
374
+ object_=_response.json(),
375
+ ),
376
+ )
377
+ )
378
+ _response_json = _response.json()
379
+ except JSONDecodeError:
380
+ raise ApiError(status_code=_response.status_code, body=_response.text)
381
+ raise ApiError(status_code=_response.status_code, body=_response_json)
382
+
383
+ def retrieve(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AgentState:
384
+ """
385
+ Get the state of the agent.
386
+
387
+ Parameters
388
+ ----------
389
+ agent_id : str
390
+
391
+ request_options : typing.Optional[RequestOptions]
392
+ Request-specific configuration.
393
+
394
+ Returns
395
+ -------
396
+ AgentState
397
+ Successful Response
398
+
399
+ Examples
400
+ --------
401
+ from letta_client import Letta
402
+
403
+ client = Letta(
404
+ token="YOUR_TOKEN",
405
+ )
406
+ client.agents.retrieve(
407
+ agent_id="agent_id",
408
+ )
409
+ """
410
+ _response = self._client_wrapper.httpx_client.request(
411
+ f"v1/agents/{jsonable_encoder(agent_id)}",
412
+ method="GET",
413
+ request_options=request_options,
414
+ )
415
+ try:
416
+ if 200 <= _response.status_code < 300:
417
+ return typing.cast(
418
+ AgentState,
419
+ construct_type(
420
+ type_=AgentState, # type: ignore
421
+ object_=_response.json(),
422
+ ),
423
+ )
424
+ if _response.status_code == 422:
425
+ raise UnprocessableEntityError(
426
+ typing.cast(
427
+ HttpValidationError,
428
+ construct_type(
429
+ type_=HttpValidationError, # type: ignore
430
+ object_=_response.json(),
431
+ ),
432
+ )
433
+ )
434
+ _response_json = _response.json()
435
+ except JSONDecodeError:
436
+ raise ApiError(status_code=_response.status_code, body=_response.text)
437
+ raise ApiError(status_code=_response.status_code, body=_response_json)
438
+
439
+ def delete(
440
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
441
+ ) -> typing.Optional[typing.Any]:
442
+ """
443
+ Delete an agent.
444
+
445
+ Parameters
446
+ ----------
447
+ agent_id : str
448
+
449
+ request_options : typing.Optional[RequestOptions]
450
+ Request-specific configuration.
451
+
452
+ Returns
453
+ -------
454
+ typing.Optional[typing.Any]
455
+ Successful Response
456
+
457
+ Examples
458
+ --------
459
+ from letta_client import Letta
460
+
461
+ client = Letta(
462
+ token="YOUR_TOKEN",
463
+ )
464
+ client.agents.delete(
465
+ agent_id="agent_id",
466
+ )
467
+ """
468
+ _response = self._client_wrapper.httpx_client.request(
469
+ f"v1/agents/{jsonable_encoder(agent_id)}",
470
+ method="DELETE",
471
+ request_options=request_options,
472
+ )
473
+ try:
474
+ if 200 <= _response.status_code < 300:
475
+ return typing.cast(
476
+ typing.Optional[typing.Any],
477
+ construct_type(
478
+ type_=typing.Optional[typing.Any], # type: ignore
479
+ object_=_response.json(),
480
+ ),
481
+ )
482
+ if _response.status_code == 422:
483
+ raise UnprocessableEntityError(
484
+ typing.cast(
485
+ HttpValidationError,
486
+ construct_type(
487
+ type_=HttpValidationError, # type: ignore
488
+ object_=_response.json(),
489
+ ),
490
+ )
491
+ )
492
+ _response_json = _response.json()
493
+ except JSONDecodeError:
494
+ raise ApiError(status_code=_response.status_code, body=_response.text)
495
+ raise ApiError(status_code=_response.status_code, body=_response_json)
496
+
497
+ def modify(
498
+ self,
499
+ agent_id: str,
500
+ *,
501
+ name: typing.Optional[str] = OMIT,
502
+ tool_ids: typing.Optional[typing.Sequence[str]] = OMIT,
503
+ source_ids: typing.Optional[typing.Sequence[str]] = OMIT,
504
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
505
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
506
+ system: typing.Optional[str] = OMIT,
507
+ tool_rules: typing.Optional[typing.Sequence[UpdateAgentToolRulesItem]] = OMIT,
508
+ llm_config: typing.Optional[LlmConfig] = OMIT,
509
+ embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
510
+ message_ids: typing.Optional[typing.Sequence[str]] = OMIT,
511
+ description: typing.Optional[str] = OMIT,
512
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
513
+ tool_exec_environment_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
514
+ project_id: typing.Optional[str] = OMIT,
515
+ template_id: typing.Optional[str] = OMIT,
516
+ base_template_id: typing.Optional[str] = OMIT,
517
+ request_options: typing.Optional[RequestOptions] = None,
518
+ ) -> AgentState:
519
+ """
520
+ Update an existing agent
521
+
522
+ Parameters
523
+ ----------
524
+ agent_id : str
525
+
526
+ name : typing.Optional[str]
527
+ The name of the agent.
528
+
529
+ tool_ids : typing.Optional[typing.Sequence[str]]
530
+ The ids of the tools used by the agent.
531
+
532
+ source_ids : typing.Optional[typing.Sequence[str]]
533
+ The ids of the sources used by the agent.
534
+
535
+ block_ids : typing.Optional[typing.Sequence[str]]
536
+ The ids of the blocks used by the agent.
537
+
538
+ tags : typing.Optional[typing.Sequence[str]]
539
+ The tags associated with the agent.
540
+
541
+ system : typing.Optional[str]
542
+ The system prompt used by the agent.
543
+
544
+ tool_rules : typing.Optional[typing.Sequence[UpdateAgentToolRulesItem]]
545
+ The tool rules governing the agent.
546
+
547
+ llm_config : typing.Optional[LlmConfig]
548
+ The LLM configuration used by the agent.
549
+
550
+ embedding_config : typing.Optional[EmbeddingConfig]
551
+ The embedding configuration used by the agent.
552
+
553
+ message_ids : typing.Optional[typing.Sequence[str]]
554
+ The ids of the messages in the agent's in-context memory.
555
+
556
+ description : typing.Optional[str]
557
+ The description of the agent.
558
+
559
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
560
+ The metadata of the agent.
561
+
562
+ tool_exec_environment_variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
563
+ The environment variables for tool execution specific to this agent.
564
+
565
+ project_id : typing.Optional[str]
566
+ The id of the project the agent belongs to.
567
+
568
+ template_id : typing.Optional[str]
569
+ The id of the template the agent belongs to.
570
+
571
+ base_template_id : typing.Optional[str]
572
+ The base template id of the agent.
573
+
574
+ request_options : typing.Optional[RequestOptions]
575
+ Request-specific configuration.
576
+
577
+ Returns
578
+ -------
579
+ AgentState
580
+ Successful Response
581
+
582
+ Examples
583
+ --------
584
+ from letta_client import Letta
585
+
586
+ client = Letta(
587
+ token="YOUR_TOKEN",
588
+ )
589
+ client.agents.modify(
590
+ agent_id="agent_id",
591
+ )
592
+ """
593
+ _response = self._client_wrapper.httpx_client.request(
594
+ f"v1/agents/{jsonable_encoder(agent_id)}",
595
+ method="PATCH",
596
+ json={
597
+ "name": name,
598
+ "tool_ids": tool_ids,
599
+ "source_ids": source_ids,
600
+ "block_ids": block_ids,
601
+ "tags": tags,
602
+ "system": system,
603
+ "tool_rules": convert_and_respect_annotation_metadata(
604
+ object_=tool_rules, annotation=typing.Sequence[UpdateAgentToolRulesItem], direction="write"
605
+ ),
606
+ "llm_config": convert_and_respect_annotation_metadata(
607
+ object_=llm_config, annotation=LlmConfig, direction="write"
608
+ ),
609
+ "embedding_config": convert_and_respect_annotation_metadata(
610
+ object_=embedding_config, annotation=EmbeddingConfig, direction="write"
611
+ ),
612
+ "message_ids": message_ids,
613
+ "description": description,
614
+ "metadata": metadata,
615
+ "tool_exec_environment_variables": tool_exec_environment_variables,
616
+ "project_id": project_id,
617
+ "template_id": template_id,
618
+ "base_template_id": base_template_id,
619
+ },
620
+ headers={
621
+ "content-type": "application/json",
622
+ },
623
+ request_options=request_options,
624
+ omit=OMIT,
625
+ )
626
+ try:
627
+ if 200 <= _response.status_code < 300:
628
+ return typing.cast(
629
+ AgentState,
630
+ construct_type(
631
+ type_=AgentState, # type: ignore
632
+ object_=_response.json(),
633
+ ),
634
+ )
635
+ if _response.status_code == 422:
636
+ raise UnprocessableEntityError(
637
+ typing.cast(
638
+ HttpValidationError,
639
+ construct_type(
640
+ type_=HttpValidationError, # type: ignore
641
+ object_=_response.json(),
642
+ ),
643
+ )
644
+ )
645
+ _response_json = _response.json()
646
+ except JSONDecodeError:
647
+ raise ApiError(status_code=_response.status_code, body=_response.text)
648
+ raise ApiError(status_code=_response.status_code, body=_response_json)
649
+
650
+ def reset_messages(
651
+ self,
652
+ agent_id: str,
653
+ *,
654
+ add_default_initial_messages: typing.Optional[bool] = None,
655
+ request_options: typing.Optional[RequestOptions] = None,
656
+ ) -> AgentState:
657
+ """
658
+ Resets the messages for an agent
659
+
660
+ Parameters
661
+ ----------
662
+ agent_id : str
663
+
664
+ add_default_initial_messages : typing.Optional[bool]
665
+ If true, adds the default initial messages after resetting.
666
+
667
+ request_options : typing.Optional[RequestOptions]
668
+ Request-specific configuration.
669
+
670
+ Returns
671
+ -------
672
+ AgentState
673
+ Successful Response
674
+
675
+ Examples
676
+ --------
677
+ from letta_client import Letta
678
+
679
+ client = Letta(
680
+ token="YOUR_TOKEN",
681
+ )
682
+ client.agents.reset_messages(
683
+ agent_id="agent_id",
684
+ )
685
+ """
686
+ _response = self._client_wrapper.httpx_client.request(
687
+ f"v1/agents/{jsonable_encoder(agent_id)}/reset-messages",
688
+ method="PATCH",
689
+ params={
690
+ "add_default_initial_messages": add_default_initial_messages,
691
+ },
692
+ request_options=request_options,
693
+ )
694
+ try:
695
+ if 200 <= _response.status_code < 300:
696
+ return typing.cast(
697
+ AgentState,
698
+ construct_type(
699
+ type_=AgentState, # type: ignore
700
+ object_=_response.json(),
701
+ ),
702
+ )
703
+ if _response.status_code == 422:
704
+ raise UnprocessableEntityError(
705
+ typing.cast(
706
+ HttpValidationError,
707
+ construct_type(
708
+ type_=HttpValidationError, # type: ignore
709
+ object_=_response.json(),
710
+ ),
711
+ )
712
+ )
713
+ _response_json = _response.json()
714
+ except JSONDecodeError:
715
+ raise ApiError(status_code=_response.status_code, body=_response.text)
716
+ raise ApiError(status_code=_response.status_code, body=_response_json)
717
+
718
+ def search(
719
+ self,
720
+ *,
721
+ search: typing.Optional[typing.Sequence[AgentsSearchRequestSearchItem]] = OMIT,
722
+ project_id: typing.Optional[str] = OMIT,
723
+ combinator: typing.Optional[typing.Literal["AND"]] = OMIT,
724
+ limit: typing.Optional[float] = OMIT,
725
+ after: typing.Optional[str] = OMIT,
726
+ request_options: typing.Optional[RequestOptions] = None,
727
+ ) -> AgentsSearchResponse:
728
+ """
729
+ <Note>This endpoint is only available on Letta Cloud.</Note>
730
+
731
+ Search deployed agents.
732
+
733
+ Parameters
734
+ ----------
735
+ search : typing.Optional[typing.Sequence[AgentsSearchRequestSearchItem]]
736
+
737
+ project_id : typing.Optional[str]
738
+
739
+ combinator : typing.Optional[typing.Literal["AND"]]
740
+
741
+ limit : typing.Optional[float]
742
+
743
+ after : typing.Optional[str]
744
+
745
+ request_options : typing.Optional[RequestOptions]
746
+ Request-specific configuration.
747
+
748
+ Returns
749
+ -------
750
+ AgentsSearchResponse
751
+ 200
752
+
753
+ Examples
754
+ --------
755
+ from letta_client import Letta
756
+
757
+ client = Letta(
758
+ token="YOUR_TOKEN",
759
+ )
760
+ client.agents.search()
761
+ """
762
+ _response = self._client_wrapper.httpx_client.request(
763
+ "v1/agents/search",
764
+ method="POST",
765
+ json={
766
+ "search": convert_and_respect_annotation_metadata(
767
+ object_=search, annotation=typing.Sequence[AgentsSearchRequestSearchItem], direction="write"
768
+ ),
769
+ "project_id": project_id,
770
+ "combinator": combinator,
771
+ "limit": limit,
772
+ "after": after,
773
+ },
774
+ headers={
775
+ "content-type": "application/json",
776
+ },
777
+ request_options=request_options,
778
+ omit=OMIT,
779
+ )
780
+ try:
781
+ if 200 <= _response.status_code < 300:
782
+ return typing.cast(
783
+ AgentsSearchResponse,
784
+ construct_type(
785
+ type_=AgentsSearchResponse, # type: ignore
786
+ object_=_response.json(),
787
+ ),
788
+ )
789
+ _response_json = _response.json()
790
+ except JSONDecodeError:
791
+ raise ApiError(status_code=_response.status_code, body=_response.text)
792
+ raise ApiError(status_code=_response.status_code, body=_response_json)
793
+
794
+
795
+ class AsyncAgentsClient:
796
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
797
+ self._client_wrapper = client_wrapper
798
+ self.context = AsyncContextClient(client_wrapper=self._client_wrapper)
799
+ self.tools = AsyncToolsClient(client_wrapper=self._client_wrapper)
800
+ self.sources = AsyncSourcesClient(client_wrapper=self._client_wrapper)
801
+ self.core_memory = AsyncCoreMemoryClient(client_wrapper=self._client_wrapper)
802
+ self.archival_memory = AsyncArchivalMemoryClient(client_wrapper=self._client_wrapper)
803
+ self.messages = AsyncMessagesClient(client_wrapper=self._client_wrapper)
804
+ self.templates = AsyncTemplatesClient(client_wrapper=self._client_wrapper)
805
+ self.memory_variables = AsyncMemoryVariablesClient(client_wrapper=self._client_wrapper)
806
+
807
+ async def list(
808
+ self,
809
+ *,
810
+ name: typing.Optional[str] = None,
811
+ tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
812
+ match_all_tags: typing.Optional[bool] = None,
813
+ before: typing.Optional[str] = None,
814
+ after: typing.Optional[str] = None,
815
+ limit: typing.Optional[int] = None,
816
+ query_text: typing.Optional[str] = None,
817
+ project_id: typing.Optional[str] = None,
818
+ template_id: typing.Optional[str] = None,
819
+ base_template_id: typing.Optional[str] = None,
820
+ request_options: typing.Optional[RequestOptions] = None,
821
+ ) -> typing.List[AgentState]:
822
+ """
823
+ List all agents associated with a given user.
824
+ This endpoint retrieves a list of all agents and their configurations associated with the specified user ID.
825
+
826
+ Parameters
827
+ ----------
828
+ name : typing.Optional[str]
829
+ Name of the agent
830
+
831
+ tags : typing.Optional[typing.Union[str, typing.Sequence[str]]]
832
+ List of tags to filter agents by
833
+
834
+ match_all_tags : typing.Optional[bool]
835
+ If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed in tags.
836
+
837
+ before : typing.Optional[str]
838
+ Cursor for pagination
839
+
840
+ after : typing.Optional[str]
841
+ Cursor for pagination
842
+
843
+ limit : typing.Optional[int]
844
+ Limit for pagination
845
+
846
+ query_text : typing.Optional[str]
847
+ Search agents by name
848
+
849
+ project_id : typing.Optional[str]
850
+ Search agents by project id
851
+
852
+ template_id : typing.Optional[str]
853
+ Search agents by template id
854
+
855
+ base_template_id : typing.Optional[str]
856
+ Search agents by base template id
857
+
858
+ request_options : typing.Optional[RequestOptions]
859
+ Request-specific configuration.
860
+
861
+ Returns
862
+ -------
863
+ typing.List[AgentState]
864
+ Successful Response
865
+
866
+ Examples
867
+ --------
868
+ import asyncio
869
+
870
+ from letta_client import AsyncLetta
871
+
872
+ client = AsyncLetta(
873
+ token="YOUR_TOKEN",
874
+ )
875
+
876
+
877
+ async def main() -> None:
878
+ await client.agents.list()
879
+
880
+
881
+ asyncio.run(main())
882
+ """
883
+ _response = await self._client_wrapper.httpx_client.request(
884
+ "v1/agents/",
885
+ method="GET",
886
+ params={
887
+ "name": name,
888
+ "tags": tags,
889
+ "match_all_tags": match_all_tags,
890
+ "before": before,
891
+ "after": after,
892
+ "limit": limit,
893
+ "query_text": query_text,
894
+ "project_id": project_id,
895
+ "template_id": template_id,
896
+ "base_template_id": base_template_id,
897
+ },
898
+ request_options=request_options,
899
+ )
900
+ try:
901
+ if 200 <= _response.status_code < 300:
902
+ return typing.cast(
903
+ typing.List[AgentState],
904
+ construct_type(
905
+ type_=typing.List[AgentState], # type: ignore
906
+ object_=_response.json(),
907
+ ),
908
+ )
909
+ if _response.status_code == 422:
910
+ raise UnprocessableEntityError(
911
+ typing.cast(
912
+ HttpValidationError,
913
+ construct_type(
914
+ type_=HttpValidationError, # type: ignore
915
+ object_=_response.json(),
916
+ ),
917
+ )
918
+ )
919
+ _response_json = _response.json()
920
+ except JSONDecodeError:
921
+ raise ApiError(status_code=_response.status_code, body=_response.text)
922
+ raise ApiError(status_code=_response.status_code, body=_response_json)
923
+
924
+ async def create(
925
+ self,
926
+ *,
927
+ name: typing.Optional[str] = OMIT,
928
+ memory_blocks: typing.Optional[typing.Sequence[CreateBlock]] = OMIT,
929
+ tools: typing.Optional[typing.Sequence[str]] = OMIT,
930
+ tool_ids: typing.Optional[typing.Sequence[str]] = OMIT,
931
+ source_ids: typing.Optional[typing.Sequence[str]] = OMIT,
932
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
933
+ tool_rules: typing.Optional[typing.Sequence[CreateAgentRequestToolRulesItem]] = OMIT,
934
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
935
+ system: typing.Optional[str] = OMIT,
936
+ agent_type: typing.Optional[AgentType] = OMIT,
937
+ llm_config: typing.Optional[LlmConfig] = OMIT,
938
+ embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
939
+ initial_message_sequence: typing.Optional[typing.Sequence[MessageCreate]] = OMIT,
940
+ include_base_tools: typing.Optional[bool] = OMIT,
941
+ include_multi_agent_tools: typing.Optional[bool] = OMIT,
942
+ description: typing.Optional[str] = OMIT,
943
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
944
+ model: typing.Optional[str] = OMIT,
945
+ embedding: typing.Optional[str] = OMIT,
946
+ context_window_limit: typing.Optional[int] = OMIT,
947
+ embedding_chunk_size: typing.Optional[int] = OMIT,
948
+ from_template: typing.Optional[str] = OMIT,
949
+ template: typing.Optional[bool] = OMIT,
950
+ project: typing.Optional[str] = OMIT,
951
+ tool_exec_environment_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
952
+ memory_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
953
+ project_id: typing.Optional[str] = OMIT,
954
+ template_id: typing.Optional[str] = OMIT,
955
+ base_template_id: typing.Optional[str] = OMIT,
956
+ request_options: typing.Optional[RequestOptions] = None,
957
+ ) -> AgentState:
958
+ """
959
+ Create a new agent with the specified configuration.
960
+
961
+ Parameters
962
+ ----------
963
+ name : typing.Optional[str]
964
+ The name of the agent.
965
+
966
+ memory_blocks : typing.Optional[typing.Sequence[CreateBlock]]
967
+ The blocks to create in the agent's in-context memory.
968
+
969
+ tools : typing.Optional[typing.Sequence[str]]
970
+ The tools used by the agent.
971
+
972
+ tool_ids : typing.Optional[typing.Sequence[str]]
973
+ The ids of the tools used by the agent.
974
+
975
+ source_ids : typing.Optional[typing.Sequence[str]]
976
+ The ids of the sources used by the agent.
977
+
978
+ block_ids : typing.Optional[typing.Sequence[str]]
979
+ The ids of the blocks used by the agent.
980
+
981
+ tool_rules : typing.Optional[typing.Sequence[CreateAgentRequestToolRulesItem]]
982
+ The tool rules governing the agent.
983
+
984
+ tags : typing.Optional[typing.Sequence[str]]
985
+ The tags associated with the agent.
986
+
987
+ system : typing.Optional[str]
988
+ The system prompt used by the agent.
989
+
990
+ agent_type : typing.Optional[AgentType]
991
+ The type of agent.
992
+
993
+ llm_config : typing.Optional[LlmConfig]
994
+ The LLM configuration used by the agent.
995
+
996
+ embedding_config : typing.Optional[EmbeddingConfig]
997
+ The embedding configuration used by the agent.
998
+
999
+ initial_message_sequence : typing.Optional[typing.Sequence[MessageCreate]]
1000
+ The initial set of messages to put in the agent's in-context memory.
1001
+
1002
+ include_base_tools : typing.Optional[bool]
1003
+ If true, attaches the Letta core tools (e.g. archival_memory and core_memory related functions).
1004
+
1005
+ include_multi_agent_tools : typing.Optional[bool]
1006
+ If true, attaches the Letta multi-agent tools (e.g. sending a message to another agent).
1007
+
1008
+ description : typing.Optional[str]
1009
+ The description of the agent.
1010
+
1011
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1012
+ The metadata of the agent.
1013
+
1014
+ model : typing.Optional[str]
1015
+ The LLM configuration handle used by the agent, specified in the format provider/model-name, as an alternative to specifying llm_config.
1016
+
1017
+ embedding : typing.Optional[str]
1018
+ The embedding configuration handle used by the agent, specified in the format provider/model-name.
1019
+
1020
+ context_window_limit : typing.Optional[int]
1021
+ The context window limit used by the agent.
1022
+
1023
+ embedding_chunk_size : typing.Optional[int]
1024
+ The embedding chunk size used by the agent.
1025
+
1026
+ from_template : typing.Optional[str]
1027
+ The template id used to configure the agent
1028
+
1029
+ template : typing.Optional[bool]
1030
+ Whether the agent is a template
1031
+
1032
+ project : typing.Optional[str]
1033
+ The project slug that the agent will be associated with.
1034
+
1035
+ tool_exec_environment_variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
1036
+ The environment variables for tool execution specific to this agent.
1037
+
1038
+ memory_variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
1039
+ The variables that should be set for the agent.
1040
+
1041
+ project_id : typing.Optional[str]
1042
+ The id of the project the agent belongs to.
1043
+
1044
+ template_id : typing.Optional[str]
1045
+ The id of the template the agent belongs to.
1046
+
1047
+ base_template_id : typing.Optional[str]
1048
+ The base template id of the agent.
1049
+
1050
+ request_options : typing.Optional[RequestOptions]
1051
+ Request-specific configuration.
1052
+
1053
+ Returns
1054
+ -------
1055
+ AgentState
1056
+ Successful Response
1057
+
1058
+ Examples
1059
+ --------
1060
+ import asyncio
1061
+
1062
+ from letta_client import AsyncLetta
1063
+
1064
+ client = AsyncLetta(
1065
+ token="YOUR_TOKEN",
1066
+ )
1067
+
1068
+
1069
+ async def main() -> None:
1070
+ await client.agents.create()
1071
+
1072
+
1073
+ asyncio.run(main())
1074
+ """
1075
+ _response = await self._client_wrapper.httpx_client.request(
1076
+ "v1/agents/",
1077
+ method="POST",
1078
+ json={
1079
+ "name": name,
1080
+ "memory_blocks": convert_and_respect_annotation_metadata(
1081
+ object_=memory_blocks, annotation=typing.Sequence[CreateBlock], direction="write"
1082
+ ),
1083
+ "tools": tools,
1084
+ "tool_ids": tool_ids,
1085
+ "source_ids": source_ids,
1086
+ "block_ids": block_ids,
1087
+ "tool_rules": convert_and_respect_annotation_metadata(
1088
+ object_=tool_rules, annotation=typing.Sequence[CreateAgentRequestToolRulesItem], direction="write"
1089
+ ),
1090
+ "tags": tags,
1091
+ "system": system,
1092
+ "agent_type": agent_type,
1093
+ "llm_config": convert_and_respect_annotation_metadata(
1094
+ object_=llm_config, annotation=LlmConfig, direction="write"
1095
+ ),
1096
+ "embedding_config": convert_and_respect_annotation_metadata(
1097
+ object_=embedding_config, annotation=EmbeddingConfig, direction="write"
1098
+ ),
1099
+ "initial_message_sequence": convert_and_respect_annotation_metadata(
1100
+ object_=initial_message_sequence, annotation=typing.Sequence[MessageCreate], direction="write"
1101
+ ),
1102
+ "include_base_tools": include_base_tools,
1103
+ "include_multi_agent_tools": include_multi_agent_tools,
1104
+ "description": description,
1105
+ "metadata": metadata,
1106
+ "model": model,
1107
+ "embedding": embedding,
1108
+ "context_window_limit": context_window_limit,
1109
+ "embedding_chunk_size": embedding_chunk_size,
1110
+ "from_template": from_template,
1111
+ "template": template,
1112
+ "project": project,
1113
+ "tool_exec_environment_variables": tool_exec_environment_variables,
1114
+ "memory_variables": memory_variables,
1115
+ "project_id": project_id,
1116
+ "template_id": template_id,
1117
+ "base_template_id": base_template_id,
1118
+ },
1119
+ headers={
1120
+ "content-type": "application/json",
1121
+ },
1122
+ request_options=request_options,
1123
+ omit=OMIT,
1124
+ )
1125
+ try:
1126
+ if 200 <= _response.status_code < 300:
1127
+ return typing.cast(
1128
+ AgentState,
1129
+ construct_type(
1130
+ type_=AgentState, # type: ignore
1131
+ object_=_response.json(),
1132
+ ),
1133
+ )
1134
+ if _response.status_code == 422:
1135
+ raise UnprocessableEntityError(
1136
+ typing.cast(
1137
+ HttpValidationError,
1138
+ construct_type(
1139
+ type_=HttpValidationError, # type: ignore
1140
+ object_=_response.json(),
1141
+ ),
1142
+ )
1143
+ )
1144
+ _response_json = _response.json()
1145
+ except JSONDecodeError:
1146
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1147
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1148
+
1149
+ async def retrieve(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AgentState:
1150
+ """
1151
+ Get the state of the agent.
1152
+
1153
+ Parameters
1154
+ ----------
1155
+ agent_id : str
1156
+
1157
+ request_options : typing.Optional[RequestOptions]
1158
+ Request-specific configuration.
1159
+
1160
+ Returns
1161
+ -------
1162
+ AgentState
1163
+ Successful Response
1164
+
1165
+ Examples
1166
+ --------
1167
+ import asyncio
1168
+
1169
+ from letta_client import AsyncLetta
1170
+
1171
+ client = AsyncLetta(
1172
+ token="YOUR_TOKEN",
1173
+ )
1174
+
1175
+
1176
+ async def main() -> None:
1177
+ await client.agents.retrieve(
1178
+ agent_id="agent_id",
1179
+ )
1180
+
1181
+
1182
+ asyncio.run(main())
1183
+ """
1184
+ _response = await self._client_wrapper.httpx_client.request(
1185
+ f"v1/agents/{jsonable_encoder(agent_id)}",
1186
+ method="GET",
1187
+ request_options=request_options,
1188
+ )
1189
+ try:
1190
+ if 200 <= _response.status_code < 300:
1191
+ return typing.cast(
1192
+ AgentState,
1193
+ construct_type(
1194
+ type_=AgentState, # type: ignore
1195
+ object_=_response.json(),
1196
+ ),
1197
+ )
1198
+ if _response.status_code == 422:
1199
+ raise UnprocessableEntityError(
1200
+ typing.cast(
1201
+ HttpValidationError,
1202
+ construct_type(
1203
+ type_=HttpValidationError, # type: ignore
1204
+ object_=_response.json(),
1205
+ ),
1206
+ )
1207
+ )
1208
+ _response_json = _response.json()
1209
+ except JSONDecodeError:
1210
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1211
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1212
+
1213
+ async def delete(
1214
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
1215
+ ) -> typing.Optional[typing.Any]:
1216
+ """
1217
+ Delete an agent.
1218
+
1219
+ Parameters
1220
+ ----------
1221
+ agent_id : str
1222
+
1223
+ request_options : typing.Optional[RequestOptions]
1224
+ Request-specific configuration.
1225
+
1226
+ Returns
1227
+ -------
1228
+ typing.Optional[typing.Any]
1229
+ Successful Response
1230
+
1231
+ Examples
1232
+ --------
1233
+ import asyncio
1234
+
1235
+ from letta_client import AsyncLetta
1236
+
1237
+ client = AsyncLetta(
1238
+ token="YOUR_TOKEN",
1239
+ )
1240
+
1241
+
1242
+ async def main() -> None:
1243
+ await client.agents.delete(
1244
+ agent_id="agent_id",
1245
+ )
1246
+
1247
+
1248
+ asyncio.run(main())
1249
+ """
1250
+ _response = await self._client_wrapper.httpx_client.request(
1251
+ f"v1/agents/{jsonable_encoder(agent_id)}",
1252
+ method="DELETE",
1253
+ request_options=request_options,
1254
+ )
1255
+ try:
1256
+ if 200 <= _response.status_code < 300:
1257
+ return typing.cast(
1258
+ typing.Optional[typing.Any],
1259
+ construct_type(
1260
+ type_=typing.Optional[typing.Any], # type: ignore
1261
+ object_=_response.json(),
1262
+ ),
1263
+ )
1264
+ if _response.status_code == 422:
1265
+ raise UnprocessableEntityError(
1266
+ typing.cast(
1267
+ HttpValidationError,
1268
+ construct_type(
1269
+ type_=HttpValidationError, # type: ignore
1270
+ object_=_response.json(),
1271
+ ),
1272
+ )
1273
+ )
1274
+ _response_json = _response.json()
1275
+ except JSONDecodeError:
1276
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1277
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1278
+
1279
+ async def modify(
1280
+ self,
1281
+ agent_id: str,
1282
+ *,
1283
+ name: typing.Optional[str] = OMIT,
1284
+ tool_ids: typing.Optional[typing.Sequence[str]] = OMIT,
1285
+ source_ids: typing.Optional[typing.Sequence[str]] = OMIT,
1286
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
1287
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
1288
+ system: typing.Optional[str] = OMIT,
1289
+ tool_rules: typing.Optional[typing.Sequence[UpdateAgentToolRulesItem]] = OMIT,
1290
+ llm_config: typing.Optional[LlmConfig] = OMIT,
1291
+ embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
1292
+ message_ids: typing.Optional[typing.Sequence[str]] = OMIT,
1293
+ description: typing.Optional[str] = OMIT,
1294
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1295
+ tool_exec_environment_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
1296
+ project_id: typing.Optional[str] = OMIT,
1297
+ template_id: typing.Optional[str] = OMIT,
1298
+ base_template_id: typing.Optional[str] = OMIT,
1299
+ request_options: typing.Optional[RequestOptions] = None,
1300
+ ) -> AgentState:
1301
+ """
1302
+ Update an existing agent
1303
+
1304
+ Parameters
1305
+ ----------
1306
+ agent_id : str
1307
+
1308
+ name : typing.Optional[str]
1309
+ The name of the agent.
1310
+
1311
+ tool_ids : typing.Optional[typing.Sequence[str]]
1312
+ The ids of the tools used by the agent.
1313
+
1314
+ source_ids : typing.Optional[typing.Sequence[str]]
1315
+ The ids of the sources used by the agent.
1316
+
1317
+ block_ids : typing.Optional[typing.Sequence[str]]
1318
+ The ids of the blocks used by the agent.
1319
+
1320
+ tags : typing.Optional[typing.Sequence[str]]
1321
+ The tags associated with the agent.
1322
+
1323
+ system : typing.Optional[str]
1324
+ The system prompt used by the agent.
1325
+
1326
+ tool_rules : typing.Optional[typing.Sequence[UpdateAgentToolRulesItem]]
1327
+ The tool rules governing the agent.
1328
+
1329
+ llm_config : typing.Optional[LlmConfig]
1330
+ The LLM configuration used by the agent.
1331
+
1332
+ embedding_config : typing.Optional[EmbeddingConfig]
1333
+ The embedding configuration used by the agent.
1334
+
1335
+ message_ids : typing.Optional[typing.Sequence[str]]
1336
+ The ids of the messages in the agent's in-context memory.
1337
+
1338
+ description : typing.Optional[str]
1339
+ The description of the agent.
1340
+
1341
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1342
+ The metadata of the agent.
1343
+
1344
+ tool_exec_environment_variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
1345
+ The environment variables for tool execution specific to this agent.
1346
+
1347
+ project_id : typing.Optional[str]
1348
+ The id of the project the agent belongs to.
1349
+
1350
+ template_id : typing.Optional[str]
1351
+ The id of the template the agent belongs to.
1352
+
1353
+ base_template_id : typing.Optional[str]
1354
+ The base template id of the agent.
1355
+
1356
+ request_options : typing.Optional[RequestOptions]
1357
+ Request-specific configuration.
1358
+
1359
+ Returns
1360
+ -------
1361
+ AgentState
1362
+ Successful Response
1363
+
1364
+ Examples
1365
+ --------
1366
+ import asyncio
1367
+
1368
+ from letta_client import AsyncLetta
1369
+
1370
+ client = AsyncLetta(
1371
+ token="YOUR_TOKEN",
1372
+ )
1373
+
1374
+
1375
+ async def main() -> None:
1376
+ await client.agents.modify(
1377
+ agent_id="agent_id",
1378
+ )
1379
+
1380
+
1381
+ asyncio.run(main())
1382
+ """
1383
+ _response = await self._client_wrapper.httpx_client.request(
1384
+ f"v1/agents/{jsonable_encoder(agent_id)}",
1385
+ method="PATCH",
1386
+ json={
1387
+ "name": name,
1388
+ "tool_ids": tool_ids,
1389
+ "source_ids": source_ids,
1390
+ "block_ids": block_ids,
1391
+ "tags": tags,
1392
+ "system": system,
1393
+ "tool_rules": convert_and_respect_annotation_metadata(
1394
+ object_=tool_rules, annotation=typing.Sequence[UpdateAgentToolRulesItem], direction="write"
1395
+ ),
1396
+ "llm_config": convert_and_respect_annotation_metadata(
1397
+ object_=llm_config, annotation=LlmConfig, direction="write"
1398
+ ),
1399
+ "embedding_config": convert_and_respect_annotation_metadata(
1400
+ object_=embedding_config, annotation=EmbeddingConfig, direction="write"
1401
+ ),
1402
+ "message_ids": message_ids,
1403
+ "description": description,
1404
+ "metadata": metadata,
1405
+ "tool_exec_environment_variables": tool_exec_environment_variables,
1406
+ "project_id": project_id,
1407
+ "template_id": template_id,
1408
+ "base_template_id": base_template_id,
1409
+ },
1410
+ headers={
1411
+ "content-type": "application/json",
1412
+ },
1413
+ request_options=request_options,
1414
+ omit=OMIT,
1415
+ )
1416
+ try:
1417
+ if 200 <= _response.status_code < 300:
1418
+ return typing.cast(
1419
+ AgentState,
1420
+ construct_type(
1421
+ type_=AgentState, # type: ignore
1422
+ object_=_response.json(),
1423
+ ),
1424
+ )
1425
+ if _response.status_code == 422:
1426
+ raise UnprocessableEntityError(
1427
+ typing.cast(
1428
+ HttpValidationError,
1429
+ construct_type(
1430
+ type_=HttpValidationError, # type: ignore
1431
+ object_=_response.json(),
1432
+ ),
1433
+ )
1434
+ )
1435
+ _response_json = _response.json()
1436
+ except JSONDecodeError:
1437
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1438
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1439
+
1440
+ async def reset_messages(
1441
+ self,
1442
+ agent_id: str,
1443
+ *,
1444
+ add_default_initial_messages: typing.Optional[bool] = None,
1445
+ request_options: typing.Optional[RequestOptions] = None,
1446
+ ) -> AgentState:
1447
+ """
1448
+ Resets the messages for an agent
1449
+
1450
+ Parameters
1451
+ ----------
1452
+ agent_id : str
1453
+
1454
+ add_default_initial_messages : typing.Optional[bool]
1455
+ If true, adds the default initial messages after resetting.
1456
+
1457
+ request_options : typing.Optional[RequestOptions]
1458
+ Request-specific configuration.
1459
+
1460
+ Returns
1461
+ -------
1462
+ AgentState
1463
+ Successful Response
1464
+
1465
+ Examples
1466
+ --------
1467
+ import asyncio
1468
+
1469
+ from letta_client import AsyncLetta
1470
+
1471
+ client = AsyncLetta(
1472
+ token="YOUR_TOKEN",
1473
+ )
1474
+
1475
+
1476
+ async def main() -> None:
1477
+ await client.agents.reset_messages(
1478
+ agent_id="agent_id",
1479
+ )
1480
+
1481
+
1482
+ asyncio.run(main())
1483
+ """
1484
+ _response = await self._client_wrapper.httpx_client.request(
1485
+ f"v1/agents/{jsonable_encoder(agent_id)}/reset-messages",
1486
+ method="PATCH",
1487
+ params={
1488
+ "add_default_initial_messages": add_default_initial_messages,
1489
+ },
1490
+ request_options=request_options,
1491
+ )
1492
+ try:
1493
+ if 200 <= _response.status_code < 300:
1494
+ return typing.cast(
1495
+ AgentState,
1496
+ construct_type(
1497
+ type_=AgentState, # type: ignore
1498
+ object_=_response.json(),
1499
+ ),
1500
+ )
1501
+ if _response.status_code == 422:
1502
+ raise UnprocessableEntityError(
1503
+ typing.cast(
1504
+ HttpValidationError,
1505
+ construct_type(
1506
+ type_=HttpValidationError, # type: ignore
1507
+ object_=_response.json(),
1508
+ ),
1509
+ )
1510
+ )
1511
+ _response_json = _response.json()
1512
+ except JSONDecodeError:
1513
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1514
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1515
+
1516
+ async def search(
1517
+ self,
1518
+ *,
1519
+ search: typing.Optional[typing.Sequence[AgentsSearchRequestSearchItem]] = OMIT,
1520
+ project_id: typing.Optional[str] = OMIT,
1521
+ combinator: typing.Optional[typing.Literal["AND"]] = OMIT,
1522
+ limit: typing.Optional[float] = OMIT,
1523
+ after: typing.Optional[str] = OMIT,
1524
+ request_options: typing.Optional[RequestOptions] = None,
1525
+ ) -> AgentsSearchResponse:
1526
+ """
1527
+ <Note>This endpoint is only available on Letta Cloud.</Note>
1528
+
1529
+ Search deployed agents.
1530
+
1531
+ Parameters
1532
+ ----------
1533
+ search : typing.Optional[typing.Sequence[AgentsSearchRequestSearchItem]]
1534
+
1535
+ project_id : typing.Optional[str]
1536
+
1537
+ combinator : typing.Optional[typing.Literal["AND"]]
1538
+
1539
+ limit : typing.Optional[float]
1540
+
1541
+ after : typing.Optional[str]
1542
+
1543
+ request_options : typing.Optional[RequestOptions]
1544
+ Request-specific configuration.
1545
+
1546
+ Returns
1547
+ -------
1548
+ AgentsSearchResponse
1549
+ 200
1550
+
1551
+ Examples
1552
+ --------
1553
+ import asyncio
1554
+
1555
+ from letta_client import AsyncLetta
1556
+
1557
+ client = AsyncLetta(
1558
+ token="YOUR_TOKEN",
1559
+ )
1560
+
1561
+
1562
+ async def main() -> None:
1563
+ await client.agents.search()
1564
+
1565
+
1566
+ asyncio.run(main())
1567
+ """
1568
+ _response = await self._client_wrapper.httpx_client.request(
1569
+ "v1/agents/search",
1570
+ method="POST",
1571
+ json={
1572
+ "search": convert_and_respect_annotation_metadata(
1573
+ object_=search, annotation=typing.Sequence[AgentsSearchRequestSearchItem], direction="write"
1574
+ ),
1575
+ "project_id": project_id,
1576
+ "combinator": combinator,
1577
+ "limit": limit,
1578
+ "after": after,
1579
+ },
1580
+ headers={
1581
+ "content-type": "application/json",
1582
+ },
1583
+ request_options=request_options,
1584
+ omit=OMIT,
1585
+ )
1586
+ try:
1587
+ if 200 <= _response.status_code < 300:
1588
+ return typing.cast(
1589
+ AgentsSearchResponse,
1590
+ construct_type(
1591
+ type_=AgentsSearchResponse, # type: ignore
1592
+ object_=_response.json(),
1593
+ ),
1594
+ )
1595
+ _response_json = _response.json()
1596
+ except JSONDecodeError:
1597
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1598
+ raise ApiError(status_code=_response.status_code, body=_response_json)