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,1665 @@
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 ..core.request_options import RequestOptions
6
+ from ..types.tool import Tool
7
+ from ..core.jsonable_encoder import jsonable_encoder
8
+ from ..core.unchecked_base_model import construct_type
9
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
10
+ from ..types.http_validation_error import HttpValidationError
11
+ from json.decoder import JSONDecodeError
12
+ from ..core.api_error import ApiError
13
+ from ..types.tool_return_message import ToolReturnMessage
14
+ from ..types.app_model import AppModel
15
+ from ..types.action_model import ActionModel
16
+ from ..core.client_wrapper import AsyncClientWrapper
17
+
18
+ # this is used as the default value for optional parameters
19
+ OMIT = typing.cast(typing.Any, ...)
20
+
21
+
22
+ class ToolsClient:
23
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
24
+ self._client_wrapper = client_wrapper
25
+
26
+ def retrieve(self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Tool:
27
+ """
28
+ Get a tool by ID
29
+
30
+ Parameters
31
+ ----------
32
+ tool_id : str
33
+
34
+ request_options : typing.Optional[RequestOptions]
35
+ Request-specific configuration.
36
+
37
+ Returns
38
+ -------
39
+ Tool
40
+ Successful Response
41
+
42
+ Examples
43
+ --------
44
+ from letta_client import Letta
45
+
46
+ client = Letta(
47
+ token="YOUR_TOKEN",
48
+ )
49
+ client.tools.retrieve(
50
+ tool_id="tool_id",
51
+ )
52
+ """
53
+ _response = self._client_wrapper.httpx_client.request(
54
+ f"v1/tools/{jsonable_encoder(tool_id)}",
55
+ method="GET",
56
+ request_options=request_options,
57
+ )
58
+ try:
59
+ if 200 <= _response.status_code < 300:
60
+ return typing.cast(
61
+ Tool,
62
+ construct_type(
63
+ type_=Tool, # type: ignore
64
+ object_=_response.json(),
65
+ ),
66
+ )
67
+ if _response.status_code == 422:
68
+ raise UnprocessableEntityError(
69
+ typing.cast(
70
+ HttpValidationError,
71
+ construct_type(
72
+ type_=HttpValidationError, # type: ignore
73
+ object_=_response.json(),
74
+ ),
75
+ )
76
+ )
77
+ _response_json = _response.json()
78
+ except JSONDecodeError:
79
+ raise ApiError(status_code=_response.status_code, body=_response.text)
80
+ raise ApiError(status_code=_response.status_code, body=_response_json)
81
+
82
+ def delete(
83
+ self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
84
+ ) -> typing.Optional[typing.Any]:
85
+ """
86
+ Delete a tool by name
87
+
88
+ Parameters
89
+ ----------
90
+ tool_id : str
91
+
92
+ request_options : typing.Optional[RequestOptions]
93
+ Request-specific configuration.
94
+
95
+ Returns
96
+ -------
97
+ typing.Optional[typing.Any]
98
+ Successful Response
99
+
100
+ Examples
101
+ --------
102
+ from letta_client import Letta
103
+
104
+ client = Letta(
105
+ token="YOUR_TOKEN",
106
+ )
107
+ client.tools.delete(
108
+ tool_id="tool_id",
109
+ )
110
+ """
111
+ _response = self._client_wrapper.httpx_client.request(
112
+ f"v1/tools/{jsonable_encoder(tool_id)}",
113
+ method="DELETE",
114
+ request_options=request_options,
115
+ )
116
+ try:
117
+ if 200 <= _response.status_code < 300:
118
+ return typing.cast(
119
+ typing.Optional[typing.Any],
120
+ construct_type(
121
+ type_=typing.Optional[typing.Any], # type: ignore
122
+ object_=_response.json(),
123
+ ),
124
+ )
125
+ if _response.status_code == 422:
126
+ raise UnprocessableEntityError(
127
+ typing.cast(
128
+ HttpValidationError,
129
+ construct_type(
130
+ type_=HttpValidationError, # type: ignore
131
+ object_=_response.json(),
132
+ ),
133
+ )
134
+ )
135
+ _response_json = _response.json()
136
+ except JSONDecodeError:
137
+ raise ApiError(status_code=_response.status_code, body=_response.text)
138
+ raise ApiError(status_code=_response.status_code, body=_response_json)
139
+
140
+ def modify(
141
+ self,
142
+ tool_id: str,
143
+ *,
144
+ description: typing.Optional[str] = OMIT,
145
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
146
+ source_code: typing.Optional[str] = OMIT,
147
+ source_type: typing.Optional[str] = OMIT,
148
+ json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
149
+ return_char_limit: typing.Optional[int] = OMIT,
150
+ request_options: typing.Optional[RequestOptions] = None,
151
+ ) -> Tool:
152
+ """
153
+ Update an existing tool
154
+
155
+ Parameters
156
+ ----------
157
+ tool_id : str
158
+
159
+ description : typing.Optional[str]
160
+ The description of the tool.
161
+
162
+ tags : typing.Optional[typing.Sequence[str]]
163
+ Metadata tags.
164
+
165
+ source_code : typing.Optional[str]
166
+ The source code of the function.
167
+
168
+ source_type : typing.Optional[str]
169
+ The type of the source code.
170
+
171
+ json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
172
+ The JSON schema of the function (auto-generated from source_code if not provided)
173
+
174
+ return_char_limit : typing.Optional[int]
175
+ The maximum number of characters in the response.
176
+
177
+ request_options : typing.Optional[RequestOptions]
178
+ Request-specific configuration.
179
+
180
+ Returns
181
+ -------
182
+ Tool
183
+ Successful Response
184
+
185
+ Examples
186
+ --------
187
+ from letta_client import Letta
188
+
189
+ client = Letta(
190
+ token="YOUR_TOKEN",
191
+ )
192
+ client.tools.modify(
193
+ tool_id="tool_id",
194
+ )
195
+ """
196
+ _response = self._client_wrapper.httpx_client.request(
197
+ f"v1/tools/{jsonable_encoder(tool_id)}",
198
+ method="PATCH",
199
+ json={
200
+ "description": description,
201
+ "tags": tags,
202
+ "source_code": source_code,
203
+ "source_type": source_type,
204
+ "json_schema": json_schema,
205
+ "return_char_limit": return_char_limit,
206
+ },
207
+ headers={
208
+ "content-type": "application/json",
209
+ },
210
+ request_options=request_options,
211
+ omit=OMIT,
212
+ )
213
+ try:
214
+ if 200 <= _response.status_code < 300:
215
+ return typing.cast(
216
+ Tool,
217
+ construct_type(
218
+ type_=Tool, # type: ignore
219
+ object_=_response.json(),
220
+ ),
221
+ )
222
+ if _response.status_code == 422:
223
+ raise UnprocessableEntityError(
224
+ typing.cast(
225
+ HttpValidationError,
226
+ construct_type(
227
+ type_=HttpValidationError, # type: ignore
228
+ object_=_response.json(),
229
+ ),
230
+ )
231
+ )
232
+ _response_json = _response.json()
233
+ except JSONDecodeError:
234
+ raise ApiError(status_code=_response.status_code, body=_response.text)
235
+ raise ApiError(status_code=_response.status_code, body=_response_json)
236
+
237
+ def list(
238
+ self,
239
+ *,
240
+ after: typing.Optional[str] = None,
241
+ limit: typing.Optional[int] = None,
242
+ name: typing.Optional[str] = None,
243
+ request_options: typing.Optional[RequestOptions] = None,
244
+ ) -> typing.List[Tool]:
245
+ """
246
+ Get a list of all tools available to agents belonging to the org of the user
247
+
248
+ Parameters
249
+ ----------
250
+ after : typing.Optional[str]
251
+
252
+ limit : typing.Optional[int]
253
+
254
+ name : typing.Optional[str]
255
+
256
+ request_options : typing.Optional[RequestOptions]
257
+ Request-specific configuration.
258
+
259
+ Returns
260
+ -------
261
+ typing.List[Tool]
262
+ Successful Response
263
+
264
+ Examples
265
+ --------
266
+ from letta_client import Letta
267
+
268
+ client = Letta(
269
+ token="YOUR_TOKEN",
270
+ )
271
+ client.tools.list()
272
+ """
273
+ _response = self._client_wrapper.httpx_client.request(
274
+ "v1/tools/",
275
+ method="GET",
276
+ params={
277
+ "after": after,
278
+ "limit": limit,
279
+ "name": name,
280
+ },
281
+ request_options=request_options,
282
+ )
283
+ try:
284
+ if 200 <= _response.status_code < 300:
285
+ return typing.cast(
286
+ typing.List[Tool],
287
+ construct_type(
288
+ type_=typing.List[Tool], # type: ignore
289
+ object_=_response.json(),
290
+ ),
291
+ )
292
+ if _response.status_code == 422:
293
+ raise UnprocessableEntityError(
294
+ typing.cast(
295
+ HttpValidationError,
296
+ construct_type(
297
+ type_=HttpValidationError, # type: ignore
298
+ object_=_response.json(),
299
+ ),
300
+ )
301
+ )
302
+ _response_json = _response.json()
303
+ except JSONDecodeError:
304
+ raise ApiError(status_code=_response.status_code, body=_response.text)
305
+ raise ApiError(status_code=_response.status_code, body=_response_json)
306
+
307
+ def create(
308
+ self,
309
+ *,
310
+ source_code: str,
311
+ description: typing.Optional[str] = OMIT,
312
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
313
+ source_type: typing.Optional[str] = OMIT,
314
+ json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
315
+ return_char_limit: typing.Optional[int] = OMIT,
316
+ request_options: typing.Optional[RequestOptions] = None,
317
+ ) -> Tool:
318
+ """
319
+ Create a new tool
320
+
321
+ Parameters
322
+ ----------
323
+ source_code : str
324
+ The source code of the function.
325
+
326
+ description : typing.Optional[str]
327
+ The description of the tool.
328
+
329
+ tags : typing.Optional[typing.Sequence[str]]
330
+ Metadata tags.
331
+
332
+ source_type : typing.Optional[str]
333
+ The source type of the function.
334
+
335
+ json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
336
+ The JSON schema of the function (auto-generated from source_code if not provided)
337
+
338
+ return_char_limit : typing.Optional[int]
339
+ The maximum number of characters in the response.
340
+
341
+ request_options : typing.Optional[RequestOptions]
342
+ Request-specific configuration.
343
+
344
+ Returns
345
+ -------
346
+ Tool
347
+ Successful Response
348
+
349
+ Examples
350
+ --------
351
+ from letta_client import Letta
352
+
353
+ client = Letta(
354
+ token="YOUR_TOKEN",
355
+ )
356
+ client.tools.create(
357
+ source_code="source_code",
358
+ )
359
+ """
360
+ _response = self._client_wrapper.httpx_client.request(
361
+ "v1/tools/",
362
+ method="POST",
363
+ json={
364
+ "description": description,
365
+ "tags": tags,
366
+ "source_code": source_code,
367
+ "source_type": source_type,
368
+ "json_schema": json_schema,
369
+ "return_char_limit": return_char_limit,
370
+ },
371
+ request_options=request_options,
372
+ omit=OMIT,
373
+ )
374
+ try:
375
+ if 200 <= _response.status_code < 300:
376
+ return typing.cast(
377
+ Tool,
378
+ construct_type(
379
+ type_=Tool, # type: ignore
380
+ object_=_response.json(),
381
+ ),
382
+ )
383
+ if _response.status_code == 422:
384
+ raise UnprocessableEntityError(
385
+ typing.cast(
386
+ HttpValidationError,
387
+ construct_type(
388
+ type_=HttpValidationError, # type: ignore
389
+ object_=_response.json(),
390
+ ),
391
+ )
392
+ )
393
+ _response_json = _response.json()
394
+ except JSONDecodeError:
395
+ raise ApiError(status_code=_response.status_code, body=_response.text)
396
+ raise ApiError(status_code=_response.status_code, body=_response_json)
397
+
398
+ def upsert(
399
+ self,
400
+ *,
401
+ source_code: str,
402
+ description: typing.Optional[str] = OMIT,
403
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
404
+ source_type: typing.Optional[str] = OMIT,
405
+ json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
406
+ return_char_limit: typing.Optional[int] = OMIT,
407
+ request_options: typing.Optional[RequestOptions] = None,
408
+ ) -> Tool:
409
+ """
410
+ Create or update a tool
411
+
412
+ Parameters
413
+ ----------
414
+ source_code : str
415
+ The source code of the function.
416
+
417
+ description : typing.Optional[str]
418
+ The description of the tool.
419
+
420
+ tags : typing.Optional[typing.Sequence[str]]
421
+ Metadata tags.
422
+
423
+ source_type : typing.Optional[str]
424
+ The source type of the function.
425
+
426
+ json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
427
+ The JSON schema of the function (auto-generated from source_code if not provided)
428
+
429
+ return_char_limit : typing.Optional[int]
430
+ The maximum number of characters in the response.
431
+
432
+ request_options : typing.Optional[RequestOptions]
433
+ Request-specific configuration.
434
+
435
+ Returns
436
+ -------
437
+ Tool
438
+ Successful Response
439
+
440
+ Examples
441
+ --------
442
+ from letta_client import Letta
443
+
444
+ client = Letta(
445
+ token="YOUR_TOKEN",
446
+ )
447
+ client.tools.upsert(
448
+ source_code="source_code",
449
+ )
450
+ """
451
+ _response = self._client_wrapper.httpx_client.request(
452
+ "v1/tools/",
453
+ method="PUT",
454
+ json={
455
+ "description": description,
456
+ "tags": tags,
457
+ "source_code": source_code,
458
+ "source_type": source_type,
459
+ "json_schema": json_schema,
460
+ "return_char_limit": return_char_limit,
461
+ },
462
+ request_options=request_options,
463
+ omit=OMIT,
464
+ )
465
+ try:
466
+ if 200 <= _response.status_code < 300:
467
+ return typing.cast(
468
+ Tool,
469
+ construct_type(
470
+ type_=Tool, # type: ignore
471
+ object_=_response.json(),
472
+ ),
473
+ )
474
+ if _response.status_code == 422:
475
+ raise UnprocessableEntityError(
476
+ typing.cast(
477
+ HttpValidationError,
478
+ construct_type(
479
+ type_=HttpValidationError, # type: ignore
480
+ object_=_response.json(),
481
+ ),
482
+ )
483
+ )
484
+ _response_json = _response.json()
485
+ except JSONDecodeError:
486
+ raise ApiError(status_code=_response.status_code, body=_response.text)
487
+ raise ApiError(status_code=_response.status_code, body=_response_json)
488
+
489
+ def add_base_tool(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Tool]:
490
+ """
491
+ Upsert base tools
492
+
493
+ Parameters
494
+ ----------
495
+ request_options : typing.Optional[RequestOptions]
496
+ Request-specific configuration.
497
+
498
+ Returns
499
+ -------
500
+ typing.List[Tool]
501
+ Successful Response
502
+
503
+ Examples
504
+ --------
505
+ from letta_client import Letta
506
+
507
+ client = Letta(
508
+ token="YOUR_TOKEN",
509
+ )
510
+ client.tools.add_base_tool()
511
+ """
512
+ _response = self._client_wrapper.httpx_client.request(
513
+ "v1/tools/add-base-tools",
514
+ method="POST",
515
+ request_options=request_options,
516
+ )
517
+ try:
518
+ if 200 <= _response.status_code < 300:
519
+ return typing.cast(
520
+ typing.List[Tool],
521
+ construct_type(
522
+ type_=typing.List[Tool], # type: ignore
523
+ object_=_response.json(),
524
+ ),
525
+ )
526
+ if _response.status_code == 422:
527
+ raise UnprocessableEntityError(
528
+ typing.cast(
529
+ HttpValidationError,
530
+ construct_type(
531
+ type_=HttpValidationError, # type: ignore
532
+ object_=_response.json(),
533
+ ),
534
+ )
535
+ )
536
+ _response_json = _response.json()
537
+ except JSONDecodeError:
538
+ raise ApiError(status_code=_response.status_code, body=_response.text)
539
+ raise ApiError(status_code=_response.status_code, body=_response_json)
540
+
541
+ def run_tool_from_source(
542
+ self,
543
+ *,
544
+ source_code: str,
545
+ args: typing.Dict[str, typing.Optional[typing.Any]],
546
+ env_vars: typing.Optional[typing.Dict[str, str]] = OMIT,
547
+ name: typing.Optional[str] = OMIT,
548
+ source_type: typing.Optional[str] = OMIT,
549
+ request_options: typing.Optional[RequestOptions] = None,
550
+ ) -> ToolReturnMessage:
551
+ """
552
+ Attempt to build a tool from source, then run it on the provided arguments
553
+
554
+ Parameters
555
+ ----------
556
+ source_code : str
557
+ The source code of the function.
558
+
559
+ args : typing.Dict[str, typing.Optional[typing.Any]]
560
+ The arguments to pass to the tool.
561
+
562
+ env_vars : typing.Optional[typing.Dict[str, str]]
563
+ The environment variables to pass to the tool.
564
+
565
+ name : typing.Optional[str]
566
+ The name of the tool to run.
567
+
568
+ source_type : typing.Optional[str]
569
+ The type of the source code.
570
+
571
+ request_options : typing.Optional[RequestOptions]
572
+ Request-specific configuration.
573
+
574
+ Returns
575
+ -------
576
+ ToolReturnMessage
577
+ Successful Response
578
+
579
+ Examples
580
+ --------
581
+ from letta_client import Letta
582
+
583
+ client = Letta(
584
+ token="YOUR_TOKEN",
585
+ )
586
+ client.tools.run_tool_from_source(
587
+ source_code="source_code",
588
+ args={"key": "value"},
589
+ )
590
+ """
591
+ _response = self._client_wrapper.httpx_client.request(
592
+ "v1/tools/run",
593
+ method="POST",
594
+ json={
595
+ "source_code": source_code,
596
+ "args": args,
597
+ "env_vars": env_vars,
598
+ "name": name,
599
+ "source_type": source_type,
600
+ },
601
+ headers={
602
+ "content-type": "application/json",
603
+ },
604
+ request_options=request_options,
605
+ omit=OMIT,
606
+ )
607
+ try:
608
+ if 200 <= _response.status_code < 300:
609
+ return typing.cast(
610
+ ToolReturnMessage,
611
+ construct_type(
612
+ type_=ToolReturnMessage, # type: ignore
613
+ object_=_response.json(),
614
+ ),
615
+ )
616
+ if _response.status_code == 422:
617
+ raise UnprocessableEntityError(
618
+ typing.cast(
619
+ HttpValidationError,
620
+ construct_type(
621
+ type_=HttpValidationError, # type: ignore
622
+ object_=_response.json(),
623
+ ),
624
+ )
625
+ )
626
+ _response_json = _response.json()
627
+ except JSONDecodeError:
628
+ raise ApiError(status_code=_response.status_code, body=_response.text)
629
+ raise ApiError(status_code=_response.status_code, body=_response_json)
630
+
631
+ def list_composio_apps(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[AppModel]:
632
+ """
633
+ Get a list of all Composio apps
634
+
635
+ Parameters
636
+ ----------
637
+ request_options : typing.Optional[RequestOptions]
638
+ Request-specific configuration.
639
+
640
+ Returns
641
+ -------
642
+ typing.List[AppModel]
643
+ Successful Response
644
+
645
+ Examples
646
+ --------
647
+ from letta_client import Letta
648
+
649
+ client = Letta(
650
+ token="YOUR_TOKEN",
651
+ )
652
+ client.tools.list_composio_apps()
653
+ """
654
+ _response = self._client_wrapper.httpx_client.request(
655
+ "v1/tools/composio/apps",
656
+ method="GET",
657
+ request_options=request_options,
658
+ )
659
+ try:
660
+ if 200 <= _response.status_code < 300:
661
+ return typing.cast(
662
+ typing.List[AppModel],
663
+ construct_type(
664
+ type_=typing.List[AppModel], # type: ignore
665
+ object_=_response.json(),
666
+ ),
667
+ )
668
+ if _response.status_code == 422:
669
+ raise UnprocessableEntityError(
670
+ typing.cast(
671
+ HttpValidationError,
672
+ construct_type(
673
+ type_=HttpValidationError, # type: ignore
674
+ object_=_response.json(),
675
+ ),
676
+ )
677
+ )
678
+ _response_json = _response.json()
679
+ except JSONDecodeError:
680
+ raise ApiError(status_code=_response.status_code, body=_response.text)
681
+ raise ApiError(status_code=_response.status_code, body=_response_json)
682
+
683
+ def list_composio_actions_by_app(
684
+ self, composio_app_name: str, *, request_options: typing.Optional[RequestOptions] = None
685
+ ) -> typing.List[ActionModel]:
686
+ """
687
+ Get a list of all Composio actions for a specific app
688
+
689
+ Parameters
690
+ ----------
691
+ composio_app_name : str
692
+
693
+ request_options : typing.Optional[RequestOptions]
694
+ Request-specific configuration.
695
+
696
+ Returns
697
+ -------
698
+ typing.List[ActionModel]
699
+ Successful Response
700
+
701
+ Examples
702
+ --------
703
+ from letta_client import Letta
704
+
705
+ client = Letta(
706
+ token="YOUR_TOKEN",
707
+ )
708
+ client.tools.list_composio_actions_by_app(
709
+ composio_app_name="composio_app_name",
710
+ )
711
+ """
712
+ _response = self._client_wrapper.httpx_client.request(
713
+ f"v1/tools/composio/apps/{jsonable_encoder(composio_app_name)}/actions",
714
+ method="GET",
715
+ request_options=request_options,
716
+ )
717
+ try:
718
+ if 200 <= _response.status_code < 300:
719
+ return typing.cast(
720
+ typing.List[ActionModel],
721
+ construct_type(
722
+ type_=typing.List[ActionModel], # type: ignore
723
+ object_=_response.json(),
724
+ ),
725
+ )
726
+ if _response.status_code == 422:
727
+ raise UnprocessableEntityError(
728
+ typing.cast(
729
+ HttpValidationError,
730
+ construct_type(
731
+ type_=HttpValidationError, # type: ignore
732
+ object_=_response.json(),
733
+ ),
734
+ )
735
+ )
736
+ _response_json = _response.json()
737
+ except JSONDecodeError:
738
+ raise ApiError(status_code=_response.status_code, body=_response.text)
739
+ raise ApiError(status_code=_response.status_code, body=_response_json)
740
+
741
+ def add_composio_tool(
742
+ self, composio_action_name: str, *, request_options: typing.Optional[RequestOptions] = None
743
+ ) -> Tool:
744
+ """
745
+ Add a new Composio tool by action name (Composio refers to each tool as an `Action`)
746
+
747
+ Parameters
748
+ ----------
749
+ composio_action_name : str
750
+
751
+ request_options : typing.Optional[RequestOptions]
752
+ Request-specific configuration.
753
+
754
+ Returns
755
+ -------
756
+ Tool
757
+ Successful Response
758
+
759
+ Examples
760
+ --------
761
+ from letta_client import Letta
762
+
763
+ client = Letta(
764
+ token="YOUR_TOKEN",
765
+ )
766
+ client.tools.add_composio_tool(
767
+ composio_action_name="composio_action_name",
768
+ )
769
+ """
770
+ _response = self._client_wrapper.httpx_client.request(
771
+ f"v1/tools/composio/{jsonable_encoder(composio_action_name)}",
772
+ method="POST",
773
+ request_options=request_options,
774
+ )
775
+ try:
776
+ if 200 <= _response.status_code < 300:
777
+ return typing.cast(
778
+ Tool,
779
+ construct_type(
780
+ type_=Tool, # type: ignore
781
+ object_=_response.json(),
782
+ ),
783
+ )
784
+ if _response.status_code == 422:
785
+ raise UnprocessableEntityError(
786
+ typing.cast(
787
+ HttpValidationError,
788
+ construct_type(
789
+ type_=HttpValidationError, # type: ignore
790
+ object_=_response.json(),
791
+ ),
792
+ )
793
+ )
794
+ _response_json = _response.json()
795
+ except JSONDecodeError:
796
+ raise ApiError(status_code=_response.status_code, body=_response.text)
797
+ raise ApiError(status_code=_response.status_code, body=_response_json)
798
+
799
+
800
+ class AsyncToolsClient:
801
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
802
+ self._client_wrapper = client_wrapper
803
+
804
+ async def retrieve(self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Tool:
805
+ """
806
+ Get a tool by ID
807
+
808
+ Parameters
809
+ ----------
810
+ tool_id : str
811
+
812
+ request_options : typing.Optional[RequestOptions]
813
+ Request-specific configuration.
814
+
815
+ Returns
816
+ -------
817
+ Tool
818
+ Successful Response
819
+
820
+ Examples
821
+ --------
822
+ import asyncio
823
+
824
+ from letta_client import AsyncLetta
825
+
826
+ client = AsyncLetta(
827
+ token="YOUR_TOKEN",
828
+ )
829
+
830
+
831
+ async def main() -> None:
832
+ await client.tools.retrieve(
833
+ tool_id="tool_id",
834
+ )
835
+
836
+
837
+ asyncio.run(main())
838
+ """
839
+ _response = await self._client_wrapper.httpx_client.request(
840
+ f"v1/tools/{jsonable_encoder(tool_id)}",
841
+ method="GET",
842
+ request_options=request_options,
843
+ )
844
+ try:
845
+ if 200 <= _response.status_code < 300:
846
+ return typing.cast(
847
+ Tool,
848
+ construct_type(
849
+ type_=Tool, # type: ignore
850
+ object_=_response.json(),
851
+ ),
852
+ )
853
+ if _response.status_code == 422:
854
+ raise UnprocessableEntityError(
855
+ typing.cast(
856
+ HttpValidationError,
857
+ construct_type(
858
+ type_=HttpValidationError, # type: ignore
859
+ object_=_response.json(),
860
+ ),
861
+ )
862
+ )
863
+ _response_json = _response.json()
864
+ except JSONDecodeError:
865
+ raise ApiError(status_code=_response.status_code, body=_response.text)
866
+ raise ApiError(status_code=_response.status_code, body=_response_json)
867
+
868
+ async def delete(
869
+ self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
870
+ ) -> typing.Optional[typing.Any]:
871
+ """
872
+ Delete a tool by name
873
+
874
+ Parameters
875
+ ----------
876
+ tool_id : str
877
+
878
+ request_options : typing.Optional[RequestOptions]
879
+ Request-specific configuration.
880
+
881
+ Returns
882
+ -------
883
+ typing.Optional[typing.Any]
884
+ Successful Response
885
+
886
+ Examples
887
+ --------
888
+ import asyncio
889
+
890
+ from letta_client import AsyncLetta
891
+
892
+ client = AsyncLetta(
893
+ token="YOUR_TOKEN",
894
+ )
895
+
896
+
897
+ async def main() -> None:
898
+ await client.tools.delete(
899
+ tool_id="tool_id",
900
+ )
901
+
902
+
903
+ asyncio.run(main())
904
+ """
905
+ _response = await self._client_wrapper.httpx_client.request(
906
+ f"v1/tools/{jsonable_encoder(tool_id)}",
907
+ method="DELETE",
908
+ request_options=request_options,
909
+ )
910
+ try:
911
+ if 200 <= _response.status_code < 300:
912
+ return typing.cast(
913
+ typing.Optional[typing.Any],
914
+ construct_type(
915
+ type_=typing.Optional[typing.Any], # type: ignore
916
+ object_=_response.json(),
917
+ ),
918
+ )
919
+ if _response.status_code == 422:
920
+ raise UnprocessableEntityError(
921
+ typing.cast(
922
+ HttpValidationError,
923
+ construct_type(
924
+ type_=HttpValidationError, # type: ignore
925
+ object_=_response.json(),
926
+ ),
927
+ )
928
+ )
929
+ _response_json = _response.json()
930
+ except JSONDecodeError:
931
+ raise ApiError(status_code=_response.status_code, body=_response.text)
932
+ raise ApiError(status_code=_response.status_code, body=_response_json)
933
+
934
+ async def modify(
935
+ self,
936
+ tool_id: str,
937
+ *,
938
+ description: typing.Optional[str] = OMIT,
939
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
940
+ source_code: typing.Optional[str] = OMIT,
941
+ source_type: typing.Optional[str] = OMIT,
942
+ json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
943
+ return_char_limit: typing.Optional[int] = OMIT,
944
+ request_options: typing.Optional[RequestOptions] = None,
945
+ ) -> Tool:
946
+ """
947
+ Update an existing tool
948
+
949
+ Parameters
950
+ ----------
951
+ tool_id : str
952
+
953
+ description : typing.Optional[str]
954
+ The description of the tool.
955
+
956
+ tags : typing.Optional[typing.Sequence[str]]
957
+ Metadata tags.
958
+
959
+ source_code : typing.Optional[str]
960
+ The source code of the function.
961
+
962
+ source_type : typing.Optional[str]
963
+ The type of the source code.
964
+
965
+ json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
966
+ The JSON schema of the function (auto-generated from source_code if not provided)
967
+
968
+ return_char_limit : typing.Optional[int]
969
+ The maximum number of characters in the response.
970
+
971
+ request_options : typing.Optional[RequestOptions]
972
+ Request-specific configuration.
973
+
974
+ Returns
975
+ -------
976
+ Tool
977
+ Successful Response
978
+
979
+ Examples
980
+ --------
981
+ import asyncio
982
+
983
+ from letta_client import AsyncLetta
984
+
985
+ client = AsyncLetta(
986
+ token="YOUR_TOKEN",
987
+ )
988
+
989
+
990
+ async def main() -> None:
991
+ await client.tools.modify(
992
+ tool_id="tool_id",
993
+ )
994
+
995
+
996
+ asyncio.run(main())
997
+ """
998
+ _response = await self._client_wrapper.httpx_client.request(
999
+ f"v1/tools/{jsonable_encoder(tool_id)}",
1000
+ method="PATCH",
1001
+ json={
1002
+ "description": description,
1003
+ "tags": tags,
1004
+ "source_code": source_code,
1005
+ "source_type": source_type,
1006
+ "json_schema": json_schema,
1007
+ "return_char_limit": return_char_limit,
1008
+ },
1009
+ headers={
1010
+ "content-type": "application/json",
1011
+ },
1012
+ request_options=request_options,
1013
+ omit=OMIT,
1014
+ )
1015
+ try:
1016
+ if 200 <= _response.status_code < 300:
1017
+ return typing.cast(
1018
+ Tool,
1019
+ construct_type(
1020
+ type_=Tool, # type: ignore
1021
+ object_=_response.json(),
1022
+ ),
1023
+ )
1024
+ if _response.status_code == 422:
1025
+ raise UnprocessableEntityError(
1026
+ typing.cast(
1027
+ HttpValidationError,
1028
+ construct_type(
1029
+ type_=HttpValidationError, # type: ignore
1030
+ object_=_response.json(),
1031
+ ),
1032
+ )
1033
+ )
1034
+ _response_json = _response.json()
1035
+ except JSONDecodeError:
1036
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1037
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1038
+
1039
+ async def list(
1040
+ self,
1041
+ *,
1042
+ after: typing.Optional[str] = None,
1043
+ limit: typing.Optional[int] = None,
1044
+ name: typing.Optional[str] = None,
1045
+ request_options: typing.Optional[RequestOptions] = None,
1046
+ ) -> typing.List[Tool]:
1047
+ """
1048
+ Get a list of all tools available to agents belonging to the org of the user
1049
+
1050
+ Parameters
1051
+ ----------
1052
+ after : typing.Optional[str]
1053
+
1054
+ limit : typing.Optional[int]
1055
+
1056
+ name : typing.Optional[str]
1057
+
1058
+ request_options : typing.Optional[RequestOptions]
1059
+ Request-specific configuration.
1060
+
1061
+ Returns
1062
+ -------
1063
+ typing.List[Tool]
1064
+ Successful Response
1065
+
1066
+ Examples
1067
+ --------
1068
+ import asyncio
1069
+
1070
+ from letta_client import AsyncLetta
1071
+
1072
+ client = AsyncLetta(
1073
+ token="YOUR_TOKEN",
1074
+ )
1075
+
1076
+
1077
+ async def main() -> None:
1078
+ await client.tools.list()
1079
+
1080
+
1081
+ asyncio.run(main())
1082
+ """
1083
+ _response = await self._client_wrapper.httpx_client.request(
1084
+ "v1/tools/",
1085
+ method="GET",
1086
+ params={
1087
+ "after": after,
1088
+ "limit": limit,
1089
+ "name": name,
1090
+ },
1091
+ request_options=request_options,
1092
+ )
1093
+ try:
1094
+ if 200 <= _response.status_code < 300:
1095
+ return typing.cast(
1096
+ typing.List[Tool],
1097
+ construct_type(
1098
+ type_=typing.List[Tool], # type: ignore
1099
+ object_=_response.json(),
1100
+ ),
1101
+ )
1102
+ if _response.status_code == 422:
1103
+ raise UnprocessableEntityError(
1104
+ typing.cast(
1105
+ HttpValidationError,
1106
+ construct_type(
1107
+ type_=HttpValidationError, # type: ignore
1108
+ object_=_response.json(),
1109
+ ),
1110
+ )
1111
+ )
1112
+ _response_json = _response.json()
1113
+ except JSONDecodeError:
1114
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1115
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1116
+
1117
+ async def create(
1118
+ self,
1119
+ *,
1120
+ source_code: str,
1121
+ description: typing.Optional[str] = OMIT,
1122
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
1123
+ source_type: typing.Optional[str] = OMIT,
1124
+ json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1125
+ return_char_limit: typing.Optional[int] = OMIT,
1126
+ request_options: typing.Optional[RequestOptions] = None,
1127
+ ) -> Tool:
1128
+ """
1129
+ Create a new tool
1130
+
1131
+ Parameters
1132
+ ----------
1133
+ source_code : str
1134
+ The source code of the function.
1135
+
1136
+ description : typing.Optional[str]
1137
+ The description of the tool.
1138
+
1139
+ tags : typing.Optional[typing.Sequence[str]]
1140
+ Metadata tags.
1141
+
1142
+ source_type : typing.Optional[str]
1143
+ The source type of the function.
1144
+
1145
+ json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1146
+ The JSON schema of the function (auto-generated from source_code if not provided)
1147
+
1148
+ return_char_limit : typing.Optional[int]
1149
+ The maximum number of characters in the response.
1150
+
1151
+ request_options : typing.Optional[RequestOptions]
1152
+ Request-specific configuration.
1153
+
1154
+ Returns
1155
+ -------
1156
+ Tool
1157
+ Successful Response
1158
+
1159
+ Examples
1160
+ --------
1161
+ import asyncio
1162
+
1163
+ from letta_client import AsyncLetta
1164
+
1165
+ client = AsyncLetta(
1166
+ token="YOUR_TOKEN",
1167
+ )
1168
+
1169
+
1170
+ async def main() -> None:
1171
+ await client.tools.create(
1172
+ source_code="source_code",
1173
+ )
1174
+
1175
+
1176
+ asyncio.run(main())
1177
+ """
1178
+ _response = await self._client_wrapper.httpx_client.request(
1179
+ "v1/tools/",
1180
+ method="POST",
1181
+ json={
1182
+ "description": description,
1183
+ "tags": tags,
1184
+ "source_code": source_code,
1185
+ "source_type": source_type,
1186
+ "json_schema": json_schema,
1187
+ "return_char_limit": return_char_limit,
1188
+ },
1189
+ request_options=request_options,
1190
+ omit=OMIT,
1191
+ )
1192
+ try:
1193
+ if 200 <= _response.status_code < 300:
1194
+ return typing.cast(
1195
+ Tool,
1196
+ construct_type(
1197
+ type_=Tool, # type: ignore
1198
+ object_=_response.json(),
1199
+ ),
1200
+ )
1201
+ if _response.status_code == 422:
1202
+ raise UnprocessableEntityError(
1203
+ typing.cast(
1204
+ HttpValidationError,
1205
+ construct_type(
1206
+ type_=HttpValidationError, # type: ignore
1207
+ object_=_response.json(),
1208
+ ),
1209
+ )
1210
+ )
1211
+ _response_json = _response.json()
1212
+ except JSONDecodeError:
1213
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1214
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1215
+
1216
+ async def upsert(
1217
+ self,
1218
+ *,
1219
+ source_code: str,
1220
+ description: typing.Optional[str] = OMIT,
1221
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
1222
+ source_type: typing.Optional[str] = OMIT,
1223
+ json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1224
+ return_char_limit: typing.Optional[int] = OMIT,
1225
+ request_options: typing.Optional[RequestOptions] = None,
1226
+ ) -> Tool:
1227
+ """
1228
+ Create or update a tool
1229
+
1230
+ Parameters
1231
+ ----------
1232
+ source_code : str
1233
+ The source code of the function.
1234
+
1235
+ description : typing.Optional[str]
1236
+ The description of the tool.
1237
+
1238
+ tags : typing.Optional[typing.Sequence[str]]
1239
+ Metadata tags.
1240
+
1241
+ source_type : typing.Optional[str]
1242
+ The source type of the function.
1243
+
1244
+ json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1245
+ The JSON schema of the function (auto-generated from source_code if not provided)
1246
+
1247
+ return_char_limit : typing.Optional[int]
1248
+ The maximum number of characters in the response.
1249
+
1250
+ request_options : typing.Optional[RequestOptions]
1251
+ Request-specific configuration.
1252
+
1253
+ Returns
1254
+ -------
1255
+ Tool
1256
+ Successful Response
1257
+
1258
+ Examples
1259
+ --------
1260
+ import asyncio
1261
+
1262
+ from letta_client import AsyncLetta
1263
+
1264
+ client = AsyncLetta(
1265
+ token="YOUR_TOKEN",
1266
+ )
1267
+
1268
+
1269
+ async def main() -> None:
1270
+ await client.tools.upsert(
1271
+ source_code="source_code",
1272
+ )
1273
+
1274
+
1275
+ asyncio.run(main())
1276
+ """
1277
+ _response = await self._client_wrapper.httpx_client.request(
1278
+ "v1/tools/",
1279
+ method="PUT",
1280
+ json={
1281
+ "description": description,
1282
+ "tags": tags,
1283
+ "source_code": source_code,
1284
+ "source_type": source_type,
1285
+ "json_schema": json_schema,
1286
+ "return_char_limit": return_char_limit,
1287
+ },
1288
+ request_options=request_options,
1289
+ omit=OMIT,
1290
+ )
1291
+ try:
1292
+ if 200 <= _response.status_code < 300:
1293
+ return typing.cast(
1294
+ Tool,
1295
+ construct_type(
1296
+ type_=Tool, # type: ignore
1297
+ object_=_response.json(),
1298
+ ),
1299
+ )
1300
+ if _response.status_code == 422:
1301
+ raise UnprocessableEntityError(
1302
+ typing.cast(
1303
+ HttpValidationError,
1304
+ construct_type(
1305
+ type_=HttpValidationError, # type: ignore
1306
+ object_=_response.json(),
1307
+ ),
1308
+ )
1309
+ )
1310
+ _response_json = _response.json()
1311
+ except JSONDecodeError:
1312
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1313
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1314
+
1315
+ async def add_base_tool(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Tool]:
1316
+ """
1317
+ Upsert base tools
1318
+
1319
+ Parameters
1320
+ ----------
1321
+ request_options : typing.Optional[RequestOptions]
1322
+ Request-specific configuration.
1323
+
1324
+ Returns
1325
+ -------
1326
+ typing.List[Tool]
1327
+ Successful Response
1328
+
1329
+ Examples
1330
+ --------
1331
+ import asyncio
1332
+
1333
+ from letta_client import AsyncLetta
1334
+
1335
+ client = AsyncLetta(
1336
+ token="YOUR_TOKEN",
1337
+ )
1338
+
1339
+
1340
+ async def main() -> None:
1341
+ await client.tools.add_base_tool()
1342
+
1343
+
1344
+ asyncio.run(main())
1345
+ """
1346
+ _response = await self._client_wrapper.httpx_client.request(
1347
+ "v1/tools/add-base-tools",
1348
+ method="POST",
1349
+ request_options=request_options,
1350
+ )
1351
+ try:
1352
+ if 200 <= _response.status_code < 300:
1353
+ return typing.cast(
1354
+ typing.List[Tool],
1355
+ construct_type(
1356
+ type_=typing.List[Tool], # type: ignore
1357
+ object_=_response.json(),
1358
+ ),
1359
+ )
1360
+ if _response.status_code == 422:
1361
+ raise UnprocessableEntityError(
1362
+ typing.cast(
1363
+ HttpValidationError,
1364
+ construct_type(
1365
+ type_=HttpValidationError, # type: ignore
1366
+ object_=_response.json(),
1367
+ ),
1368
+ )
1369
+ )
1370
+ _response_json = _response.json()
1371
+ except JSONDecodeError:
1372
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1373
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1374
+
1375
+ async def run_tool_from_source(
1376
+ self,
1377
+ *,
1378
+ source_code: str,
1379
+ args: typing.Dict[str, typing.Optional[typing.Any]],
1380
+ env_vars: typing.Optional[typing.Dict[str, str]] = OMIT,
1381
+ name: typing.Optional[str] = OMIT,
1382
+ source_type: typing.Optional[str] = OMIT,
1383
+ request_options: typing.Optional[RequestOptions] = None,
1384
+ ) -> ToolReturnMessage:
1385
+ """
1386
+ Attempt to build a tool from source, then run it on the provided arguments
1387
+
1388
+ Parameters
1389
+ ----------
1390
+ source_code : str
1391
+ The source code of the function.
1392
+
1393
+ args : typing.Dict[str, typing.Optional[typing.Any]]
1394
+ The arguments to pass to the tool.
1395
+
1396
+ env_vars : typing.Optional[typing.Dict[str, str]]
1397
+ The environment variables to pass to the tool.
1398
+
1399
+ name : typing.Optional[str]
1400
+ The name of the tool to run.
1401
+
1402
+ source_type : typing.Optional[str]
1403
+ The type of the source code.
1404
+
1405
+ request_options : typing.Optional[RequestOptions]
1406
+ Request-specific configuration.
1407
+
1408
+ Returns
1409
+ -------
1410
+ ToolReturnMessage
1411
+ Successful Response
1412
+
1413
+ Examples
1414
+ --------
1415
+ import asyncio
1416
+
1417
+ from letta_client import AsyncLetta
1418
+
1419
+ client = AsyncLetta(
1420
+ token="YOUR_TOKEN",
1421
+ )
1422
+
1423
+
1424
+ async def main() -> None:
1425
+ await client.tools.run_tool_from_source(
1426
+ source_code="source_code",
1427
+ args={"key": "value"},
1428
+ )
1429
+
1430
+
1431
+ asyncio.run(main())
1432
+ """
1433
+ _response = await self._client_wrapper.httpx_client.request(
1434
+ "v1/tools/run",
1435
+ method="POST",
1436
+ json={
1437
+ "source_code": source_code,
1438
+ "args": args,
1439
+ "env_vars": env_vars,
1440
+ "name": name,
1441
+ "source_type": source_type,
1442
+ },
1443
+ headers={
1444
+ "content-type": "application/json",
1445
+ },
1446
+ request_options=request_options,
1447
+ omit=OMIT,
1448
+ )
1449
+ try:
1450
+ if 200 <= _response.status_code < 300:
1451
+ return typing.cast(
1452
+ ToolReturnMessage,
1453
+ construct_type(
1454
+ type_=ToolReturnMessage, # type: ignore
1455
+ object_=_response.json(),
1456
+ ),
1457
+ )
1458
+ if _response.status_code == 422:
1459
+ raise UnprocessableEntityError(
1460
+ typing.cast(
1461
+ HttpValidationError,
1462
+ construct_type(
1463
+ type_=HttpValidationError, # type: ignore
1464
+ object_=_response.json(),
1465
+ ),
1466
+ )
1467
+ )
1468
+ _response_json = _response.json()
1469
+ except JSONDecodeError:
1470
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1471
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1472
+
1473
+ async def list_composio_apps(
1474
+ self, *, request_options: typing.Optional[RequestOptions] = None
1475
+ ) -> typing.List[AppModel]:
1476
+ """
1477
+ Get a list of all Composio apps
1478
+
1479
+ Parameters
1480
+ ----------
1481
+ request_options : typing.Optional[RequestOptions]
1482
+ Request-specific configuration.
1483
+
1484
+ Returns
1485
+ -------
1486
+ typing.List[AppModel]
1487
+ Successful Response
1488
+
1489
+ Examples
1490
+ --------
1491
+ import asyncio
1492
+
1493
+ from letta_client import AsyncLetta
1494
+
1495
+ client = AsyncLetta(
1496
+ token="YOUR_TOKEN",
1497
+ )
1498
+
1499
+
1500
+ async def main() -> None:
1501
+ await client.tools.list_composio_apps()
1502
+
1503
+
1504
+ asyncio.run(main())
1505
+ """
1506
+ _response = await self._client_wrapper.httpx_client.request(
1507
+ "v1/tools/composio/apps",
1508
+ method="GET",
1509
+ request_options=request_options,
1510
+ )
1511
+ try:
1512
+ if 200 <= _response.status_code < 300:
1513
+ return typing.cast(
1514
+ typing.List[AppModel],
1515
+ construct_type(
1516
+ type_=typing.List[AppModel], # type: ignore
1517
+ object_=_response.json(),
1518
+ ),
1519
+ )
1520
+ if _response.status_code == 422:
1521
+ raise UnprocessableEntityError(
1522
+ typing.cast(
1523
+ HttpValidationError,
1524
+ construct_type(
1525
+ type_=HttpValidationError, # type: ignore
1526
+ object_=_response.json(),
1527
+ ),
1528
+ )
1529
+ )
1530
+ _response_json = _response.json()
1531
+ except JSONDecodeError:
1532
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1533
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1534
+
1535
+ async def list_composio_actions_by_app(
1536
+ self, composio_app_name: str, *, request_options: typing.Optional[RequestOptions] = None
1537
+ ) -> typing.List[ActionModel]:
1538
+ """
1539
+ Get a list of all Composio actions for a specific app
1540
+
1541
+ Parameters
1542
+ ----------
1543
+ composio_app_name : str
1544
+
1545
+ request_options : typing.Optional[RequestOptions]
1546
+ Request-specific configuration.
1547
+
1548
+ Returns
1549
+ -------
1550
+ typing.List[ActionModel]
1551
+ Successful Response
1552
+
1553
+ Examples
1554
+ --------
1555
+ import asyncio
1556
+
1557
+ from letta_client import AsyncLetta
1558
+
1559
+ client = AsyncLetta(
1560
+ token="YOUR_TOKEN",
1561
+ )
1562
+
1563
+
1564
+ async def main() -> None:
1565
+ await client.tools.list_composio_actions_by_app(
1566
+ composio_app_name="composio_app_name",
1567
+ )
1568
+
1569
+
1570
+ asyncio.run(main())
1571
+ """
1572
+ _response = await self._client_wrapper.httpx_client.request(
1573
+ f"v1/tools/composio/apps/{jsonable_encoder(composio_app_name)}/actions",
1574
+ method="GET",
1575
+ request_options=request_options,
1576
+ )
1577
+ try:
1578
+ if 200 <= _response.status_code < 300:
1579
+ return typing.cast(
1580
+ typing.List[ActionModel],
1581
+ construct_type(
1582
+ type_=typing.List[ActionModel], # type: ignore
1583
+ object_=_response.json(),
1584
+ ),
1585
+ )
1586
+ if _response.status_code == 422:
1587
+ raise UnprocessableEntityError(
1588
+ typing.cast(
1589
+ HttpValidationError,
1590
+ construct_type(
1591
+ type_=HttpValidationError, # type: ignore
1592
+ object_=_response.json(),
1593
+ ),
1594
+ )
1595
+ )
1596
+ _response_json = _response.json()
1597
+ except JSONDecodeError:
1598
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1599
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1600
+
1601
+ async def add_composio_tool(
1602
+ self, composio_action_name: str, *, request_options: typing.Optional[RequestOptions] = None
1603
+ ) -> Tool:
1604
+ """
1605
+ Add a new Composio tool by action name (Composio refers to each tool as an `Action`)
1606
+
1607
+ Parameters
1608
+ ----------
1609
+ composio_action_name : str
1610
+
1611
+ request_options : typing.Optional[RequestOptions]
1612
+ Request-specific configuration.
1613
+
1614
+ Returns
1615
+ -------
1616
+ Tool
1617
+ Successful Response
1618
+
1619
+ Examples
1620
+ --------
1621
+ import asyncio
1622
+
1623
+ from letta_client import AsyncLetta
1624
+
1625
+ client = AsyncLetta(
1626
+ token="YOUR_TOKEN",
1627
+ )
1628
+
1629
+
1630
+ async def main() -> None:
1631
+ await client.tools.add_composio_tool(
1632
+ composio_action_name="composio_action_name",
1633
+ )
1634
+
1635
+
1636
+ asyncio.run(main())
1637
+ """
1638
+ _response = await self._client_wrapper.httpx_client.request(
1639
+ f"v1/tools/composio/{jsonable_encoder(composio_action_name)}",
1640
+ method="POST",
1641
+ request_options=request_options,
1642
+ )
1643
+ try:
1644
+ if 200 <= _response.status_code < 300:
1645
+ return typing.cast(
1646
+ Tool,
1647
+ construct_type(
1648
+ type_=Tool, # type: ignore
1649
+ object_=_response.json(),
1650
+ ),
1651
+ )
1652
+ if _response.status_code == 422:
1653
+ raise UnprocessableEntityError(
1654
+ typing.cast(
1655
+ HttpValidationError,
1656
+ construct_type(
1657
+ type_=HttpValidationError, # type: ignore
1658
+ object_=_response.json(),
1659
+ ),
1660
+ )
1661
+ )
1662
+ _response_json = _response.json()
1663
+ except JSONDecodeError:
1664
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1665
+ raise ApiError(status_code=_response.status_code, body=_response_json)