letta-client 0.1.233__py3-none-any.whl → 0.1.235__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of letta-client might be problematic. Click here for more details.

Files changed (438) hide show
  1. letta_client/__init__.py +2 -0
  2. letta_client/agents/__init__.py +2 -0
  3. letta_client/agents/blocks/__init__.py +2 -0
  4. letta_client/agents/blocks/client.py +72 -313
  5. letta_client/agents/blocks/raw_client.py +654 -0
  6. letta_client/agents/client.py +349 -869
  7. letta_client/agents/context/__init__.py +2 -0
  8. letta_client/agents/context/client.py +31 -66
  9. letta_client/agents/context/raw_client.py +122 -0
  10. letta_client/agents/core_memory/__init__.py +2 -0
  11. letta_client/agents/core_memory/client.py +31 -66
  12. letta_client/agents/core_memory/raw_client.py +124 -0
  13. letta_client/agents/files/__init__.py +2 -0
  14. letta_client/agents/files/client.py +39 -178
  15. letta_client/agents/files/raw_client.py +349 -0
  16. letta_client/agents/folders/__init__.py +2 -0
  17. letta_client/agents/folders/client.py +39 -178
  18. letta_client/agents/folders/raw_client.py +327 -0
  19. letta_client/agents/groups/__init__.py +2 -0
  20. letta_client/agents/groups/client.py +31 -72
  21. letta_client/agents/groups/raw_client.py +142 -0
  22. letta_client/agents/memory_variables/__init__.py +2 -0
  23. letta_client/agents/memory_variables/client.py +31 -65
  24. letta_client/agents/memory_variables/raw_client.py +125 -0
  25. letta_client/agents/memory_variables/types/__init__.py +2 -0
  26. letta_client/agents/memory_variables/types/memory_variables_list_response.py +3 -2
  27. letta_client/agents/messages/__init__.py +2 -0
  28. letta_client/agents/messages/client.py +150 -589
  29. letta_client/agents/messages/raw_client.py +1384 -0
  30. letta_client/agents/messages/types/__init__.py +2 -0
  31. letta_client/agents/messages/types/letta_streaming_response.py +6 -5
  32. letta_client/agents/messages/types/messages_modify_request.py +3 -2
  33. letta_client/agents/messages/types/messages_modify_response.py +5 -4
  34. letta_client/agents/messages/types/messages_preview_raw_payload_request.py +1 -0
  35. letta_client/agents/passages/__init__.py +2 -0
  36. letta_client/agents/passages/client.py +89 -301
  37. letta_client/agents/passages/raw_client.py +678 -0
  38. letta_client/agents/raw_client.py +2088 -0
  39. letta_client/agents/sources/__init__.py +2 -0
  40. letta_client/agents/sources/client.py +39 -178
  41. letta_client/agents/sources/raw_client.py +327 -0
  42. letta_client/agents/templates/__init__.py +2 -0
  43. letta_client/agents/templates/client.py +57 -276
  44. letta_client/agents/templates/raw_client.py +505 -0
  45. letta_client/agents/templates/types/__init__.py +2 -0
  46. letta_client/agents/templates/types/templates_create_response.py +5 -4
  47. letta_client/agents/templates/types/templates_migrate_response.py +3 -2
  48. letta_client/agents/tools/__init__.py +2 -0
  49. letta_client/agents/tools/client.py +40 -179
  50. letta_client/agents/tools/raw_client.py +327 -0
  51. letta_client/agents/types/__init__.py +2 -0
  52. letta_client/agents/types/agents_search_request_search_item.py +4 -3
  53. letta_client/agents/types/agents_search_request_search_item_field.py +4 -3
  54. letta_client/agents/types/agents_search_request_search_item_one.py +4 -3
  55. letta_client/agents/types/agents_search_request_search_item_three.py +3 -2
  56. letta_client/agents/types/agents_search_request_search_item_two.py +3 -2
  57. letta_client/agents/types/agents_search_request_search_item_zero.py +3 -2
  58. letta_client/agents/types/agents_search_response.py +5 -4
  59. letta_client/agents/types/create_agent_request_response_format.py +1 -0
  60. letta_client/agents/types/create_agent_request_tool_rules_item.py +4 -3
  61. letta_client/agents/types/update_agent_response_format.py +1 -0
  62. letta_client/agents/types/update_agent_tool_rules_item.py +4 -3
  63. letta_client/base_client.py +41 -49
  64. letta_client/batches/__init__.py +2 -0
  65. letta_client/batches/client.py +45 -253
  66. letta_client/batches/raw_client.py +457 -0
  67. letta_client/blocks/__init__.py +2 -0
  68. letta_client/blocks/agents/__init__.py +2 -0
  69. letta_client/blocks/agents/client.py +33 -70
  70. letta_client/blocks/agents/raw_client.py +144 -0
  71. letta_client/blocks/client.py +126 -424
  72. letta_client/blocks/raw_client.py +973 -0
  73. letta_client/client_side_access_tokens/__init__.py +2 -0
  74. letta_client/client_side_access_tokens/client.py +45 -216
  75. letta_client/client_side_access_tokens/raw_client.py +435 -0
  76. letta_client/client_side_access_tokens/types/__init__.py +2 -0
  77. letta_client/client_side_access_tokens/types/client_side_access_tokens_create_request_policy_item.py +4 -3
  78. letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response.py +6 -5
  79. letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy.py +4 -3
  80. letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item.py +4 -3
  81. letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response.py +6 -5
  82. letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item.py +6 -5
  83. letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy.py +4 -3
  84. letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item.py +4 -3
  85. letta_client/core/__init__.py +5 -0
  86. letta_client/core/api_error.py +13 -5
  87. letta_client/core/client_wrapper.py +14 -5
  88. letta_client/core/force_multipart.py +16 -0
  89. letta_client/core/http_client.py +70 -26
  90. letta_client/core/http_response.py +55 -0
  91. letta_client/core/jsonable_encoder.py +0 -1
  92. letta_client/core/pydantic_utilities.py +70 -111
  93. letta_client/core/serialization.py +7 -3
  94. letta_client/core/unchecked_base_model.py +40 -4
  95. letta_client/embedding_models/__init__.py +2 -0
  96. letta_client/embedding_models/client.py +31 -65
  97. letta_client/embedding_models/raw_client.py +117 -0
  98. letta_client/errors/__init__.py +2 -0
  99. letta_client/errors/bad_request_error.py +4 -3
  100. letta_client/errors/conflict_error.py +4 -2
  101. letta_client/errors/internal_server_error.py +4 -3
  102. letta_client/errors/not_found_error.py +4 -3
  103. letta_client/errors/payment_required_error.py +4 -2
  104. letta_client/errors/unprocessable_entity_error.py +4 -2
  105. letta_client/folders/__init__.py +2 -0
  106. letta_client/folders/client.py +100 -564
  107. letta_client/folders/files/__init__.py +2 -0
  108. letta_client/folders/files/client.py +44 -189
  109. letta_client/folders/files/raw_client.py +391 -0
  110. letta_client/folders/passages/__init__.py +2 -0
  111. letta_client/folders/passages/client.py +33 -74
  112. letta_client/folders/passages/raw_client.py +162 -0
  113. letta_client/folders/raw_client.py +1084 -0
  114. letta_client/groups/__init__.py +2 -0
  115. letta_client/groups/client.py +87 -406
  116. letta_client/groups/messages/__init__.py +2 -0
  117. letta_client/groups/messages/client.py +110 -371
  118. letta_client/groups/messages/raw_client.py +881 -0
  119. letta_client/groups/messages/types/__init__.py +2 -0
  120. letta_client/groups/messages/types/letta_streaming_response.py +5 -4
  121. letta_client/groups/messages/types/messages_modify_request.py +3 -2
  122. letta_client/groups/messages/types/messages_modify_response.py +5 -4
  123. letta_client/groups/raw_client.py +807 -0
  124. letta_client/groups/types/__init__.py +2 -0
  125. letta_client/groups/types/group_create_manager_config.py +1 -0
  126. letta_client/groups/types/group_update_manager_config.py +1 -0
  127. letta_client/health/__init__.py +2 -0
  128. letta_client/health/client.py +31 -43
  129. letta_client/health/raw_client.py +85 -0
  130. letta_client/identities/__init__.py +2 -0
  131. letta_client/identities/client.py +115 -498
  132. letta_client/identities/properties/__init__.py +2 -0
  133. letta_client/identities/properties/client.py +32 -76
  134. letta_client/identities/properties/raw_client.py +152 -0
  135. letta_client/identities/raw_client.py +1010 -0
  136. letta_client/jobs/__init__.py +2 -0
  137. letta_client/jobs/client.py +67 -310
  138. letta_client/jobs/raw_client.py +624 -0
  139. letta_client/messages/__init__.py +2 -0
  140. letta_client/messages/client.py +41 -74
  141. letta_client/messages/raw_client.py +186 -0
  142. letta_client/models/__init__.py +2 -0
  143. letta_client/models/client.py +39 -73
  144. letta_client/models/raw_client.py +151 -0
  145. letta_client/projects/__init__.py +2 -0
  146. letta_client/projects/client.py +31 -53
  147. letta_client/projects/raw_client.py +125 -0
  148. letta_client/projects/types/__init__.py +2 -0
  149. letta_client/projects/types/projects_list_response.py +5 -4
  150. letta_client/projects/types/projects_list_response_projects_item.py +3 -2
  151. letta_client/providers/__init__.py +2 -0
  152. letta_client/providers/client.py +62 -335
  153. letta_client/providers/raw_client.py +664 -0
  154. letta_client/runs/__init__.py +2 -0
  155. letta_client/runs/client.py +56 -258
  156. letta_client/runs/messages/__init__.py +2 -0
  157. letta_client/runs/messages/client.py +34 -79
  158. letta_client/runs/messages/raw_client.py +209 -0
  159. letta_client/runs/raw_client.py +440 -0
  160. letta_client/runs/steps/__init__.py +2 -0
  161. letta_client/runs/steps/client.py +33 -76
  162. letta_client/runs/steps/raw_client.py +192 -0
  163. letta_client/runs/usage/__init__.py +2 -0
  164. letta_client/runs/usage/client.py +31 -66
  165. letta_client/runs/usage/raw_client.py +122 -0
  166. letta_client/sources/__init__.py +2 -0
  167. letta_client/sources/client.py +107 -625
  168. letta_client/sources/files/__init__.py +2 -0
  169. letta_client/sources/files/client.py +44 -189
  170. letta_client/sources/files/raw_client.py +391 -0
  171. letta_client/sources/passages/__init__.py +2 -0
  172. letta_client/sources/passages/client.py +33 -74
  173. letta_client/sources/passages/raw_client.py +162 -0
  174. letta_client/sources/raw_client.py +1209 -0
  175. letta_client/steps/__init__.py +2 -0
  176. letta_client/steps/client.py +65 -153
  177. letta_client/steps/feedback/__init__.py +2 -0
  178. letta_client/steps/feedback/client.py +32 -73
  179. letta_client/steps/feedback/raw_client.py +141 -0
  180. letta_client/steps/raw_client.py +355 -0
  181. letta_client/steps/types/__init__.py +2 -0
  182. letta_client/tags/__init__.py +2 -0
  183. letta_client/tags/client.py +33 -73
  184. letta_client/tags/raw_client.py +148 -0
  185. letta_client/telemetry/__init__.py +2 -0
  186. letta_client/telemetry/client.py +31 -66
  187. letta_client/telemetry/raw_client.py +118 -0
  188. letta_client/templates/__init__.py +2 -0
  189. letta_client/templates/agents/__init__.py +2 -0
  190. letta_client/templates/agents/client.py +48 -96
  191. letta_client/templates/agents/raw_client.py +227 -0
  192. letta_client/templates/agents/types/__init__.py +2 -0
  193. letta_client/templates/agents/types/agents_create_request_initial_message_sequence_item.py +4 -3
  194. letta_client/templates/agents/types/agents_create_response.py +4 -3
  195. letta_client/templates/client.py +36 -57
  196. letta_client/templates/raw_client.py +133 -0
  197. letta_client/templates/types/__init__.py +2 -0
  198. letta_client/templates/types/templates_list_response.py +5 -4
  199. letta_client/templates/types/templates_list_response_templates_item.py +3 -2
  200. letta_client/tools/__init__.py +2 -0
  201. letta_client/tools/client.py +195 -1322
  202. letta_client/tools/raw_client.py +2565 -0
  203. letta_client/tools/types/__init__.py +2 -0
  204. letta_client/tools/types/add_mcp_server_request.py +2 -1
  205. letta_client/tools/types/add_mcp_server_response_item.py +2 -1
  206. letta_client/tools/types/connect_mcp_server_request.py +2 -1
  207. letta_client/tools/types/delete_mcp_server_response_item.py +2 -1
  208. letta_client/tools/types/list_mcp_servers_response_value.py +1 -0
  209. letta_client/tools/types/streaming_response.py +5 -4
  210. letta_client/tools/types/test_mcp_server_request.py +2 -1
  211. letta_client/tools/types/update_mcp_server_request.py +2 -1
  212. letta_client/tools/types/update_mcp_server_response.py +2 -1
  213. letta_client/types/__init__.py +2 -0
  214. letta_client/types/action_model.py +6 -5
  215. letta_client/types/action_parameters_model.py +3 -2
  216. letta_client/types/action_response_model.py +3 -2
  217. letta_client/types/agent_environment_variable.py +3 -2
  218. letta_client/types/agent_schema.py +7 -6
  219. letta_client/types/agent_schema_tool_rules_item.py +2 -1
  220. letta_client/types/agent_state.py +14 -8
  221. letta_client/types/agent_state_response_format.py +1 -0
  222. letta_client/types/agent_state_tool_rules_item.py +4 -3
  223. letta_client/types/app_auth_scheme.py +4 -3
  224. letta_client/types/app_model.py +5 -4
  225. letta_client/types/assistant_message.py +3 -2
  226. letta_client/types/assistant_message_content.py +1 -0
  227. letta_client/types/audio.py +3 -2
  228. letta_client/types/auth_request.py +2 -1
  229. letta_client/types/auth_response.py +5 -4
  230. letta_client/types/auth_scheme_field.py +3 -2
  231. letta_client/types/bad_request_error_body.py +3 -2
  232. letta_client/types/base_64_image.py +2 -1
  233. letta_client/types/base_tool_rule_schema.py +3 -2
  234. letta_client/types/batch_job.py +4 -3
  235. letta_client/types/block.py +3 -2
  236. letta_client/types/block_update.py +2 -1
  237. letta_client/types/chat_completion_assistant_message_param.py +5 -4
  238. letta_client/types/chat_completion_assistant_message_param_content.py +1 -0
  239. letta_client/types/chat_completion_assistant_message_param_content_item.py +2 -1
  240. letta_client/types/chat_completion_audio_param.py +4 -3
  241. letta_client/types/chat_completion_content_part_image_param.py +4 -3
  242. letta_client/types/chat_completion_content_part_input_audio_param.py +4 -3
  243. letta_client/types/chat_completion_content_part_refusal_param.py +3 -2
  244. letta_client/types/chat_completion_content_part_text_param.py +3 -2
  245. letta_client/types/chat_completion_developer_message_param.py +4 -3
  246. letta_client/types/chat_completion_developer_message_param_content.py +1 -0
  247. letta_client/types/chat_completion_function_call_option_param.py +3 -2
  248. letta_client/types/chat_completion_function_message_param.py +3 -2
  249. letta_client/types/chat_completion_message_tool_call.py +4 -3
  250. letta_client/types/chat_completion_message_tool_call_param.py +4 -3
  251. letta_client/types/chat_completion_named_tool_choice_param.py +4 -3
  252. letta_client/types/chat_completion_prediction_content_param.py +4 -3
  253. letta_client/types/chat_completion_prediction_content_param_content.py +1 -0
  254. letta_client/types/chat_completion_stream_options_param.py +3 -2
  255. letta_client/types/chat_completion_system_message_param.py +4 -3
  256. letta_client/types/chat_completion_system_message_param_content.py +1 -0
  257. letta_client/types/chat_completion_tool_message_param.py +4 -3
  258. letta_client/types/chat_completion_tool_message_param_content.py +1 -0
  259. letta_client/types/chat_completion_tool_param.py +4 -3
  260. letta_client/types/chat_completion_user_message_param.py +4 -3
  261. letta_client/types/chat_completion_user_message_param_content.py +1 -0
  262. letta_client/types/chat_completion_user_message_param_content_item.py +2 -1
  263. letta_client/types/child_tool_rule.py +3 -2
  264. letta_client/types/child_tool_rule_schema.py +3 -2
  265. letta_client/types/code_input.py +3 -2
  266. letta_client/types/completion_create_params_non_streaming.py +10 -9
  267. letta_client/types/completion_create_params_non_streaming_function_call.py +1 -0
  268. letta_client/types/completion_create_params_non_streaming_messages_item.py +4 -3
  269. letta_client/types/completion_create_params_non_streaming_response_format.py +3 -2
  270. letta_client/types/completion_create_params_non_streaming_tool_choice.py +1 -0
  271. letta_client/types/completion_create_params_streaming.py +10 -9
  272. letta_client/types/completion_create_params_streaming_function_call.py +1 -0
  273. letta_client/types/completion_create_params_streaming_messages_item.py +4 -3
  274. letta_client/types/completion_create_params_streaming_response_format.py +3 -2
  275. letta_client/types/completion_create_params_streaming_tool_choice.py +1 -0
  276. letta_client/types/conditional_tool_rule.py +3 -2
  277. letta_client/types/conditional_tool_rule_schema.py +3 -2
  278. letta_client/types/conflict_error_body.py +3 -2
  279. letta_client/types/context_window_overview.py +4 -3
  280. letta_client/types/continue_tool_rule.py +3 -2
  281. letta_client/types/core_memory_block_schema.py +4 -3
  282. letta_client/types/create_block.py +3 -2
  283. letta_client/types/dynamic_manager.py +2 -1
  284. letta_client/types/dynamic_manager_update.py +2 -1
  285. letta_client/types/e_2_b_sandbox_config.py +2 -1
  286. letta_client/types/embedding_config.py +4 -3
  287. letta_client/types/file.py +4 -3
  288. letta_client/types/file_block.py +4 -3
  289. letta_client/types/file_file.py +3 -2
  290. letta_client/types/file_metadata.py +5 -4
  291. letta_client/types/file_stats.py +3 -2
  292. letta_client/types/folder.py +5 -4
  293. letta_client/types/function_call.py +3 -2
  294. letta_client/types/function_definition_input.py +3 -2
  295. letta_client/types/function_definition_output.py +3 -2
  296. letta_client/types/function_output.py +3 -2
  297. letta_client/types/function_tool.py +4 -3
  298. letta_client/types/generate_tool_input.py +3 -2
  299. letta_client/types/generate_tool_output.py +4 -3
  300. letta_client/types/group.py +4 -3
  301. letta_client/types/health.py +3 -2
  302. letta_client/types/hidden_reasoning_message.py +4 -3
  303. letta_client/types/http_validation_error.py +4 -3
  304. letta_client/types/identity.py +4 -3
  305. letta_client/types/identity_property.py +5 -4
  306. letta_client/types/image_content.py +3 -2
  307. letta_client/types/image_content_source.py +1 -0
  308. letta_client/types/image_url.py +4 -3
  309. letta_client/types/init_tool_rule.py +3 -2
  310. letta_client/types/input_audio.py +4 -3
  311. letta_client/types/internal_server_error_body.py +3 -2
  312. letta_client/types/job.py +4 -3
  313. letta_client/types/json_object_response_format.py +3 -2
  314. letta_client/types/json_schema.py +4 -3
  315. letta_client/types/json_schema_response_format.py +2 -1
  316. letta_client/types/letta_batch_messages.py +4 -3
  317. letta_client/types/letta_batch_request.py +4 -3
  318. letta_client/types/letta_image.py +2 -1
  319. letta_client/types/letta_message_content_union.py +4 -3
  320. letta_client/types/letta_message_union.py +5 -4
  321. letta_client/types/letta_ping.py +2 -1
  322. letta_client/types/letta_request.py +4 -3
  323. letta_client/types/letta_request_config.py +3 -2
  324. letta_client/types/letta_response.py +4 -3
  325. letta_client/types/letta_stop_reason.py +3 -2
  326. letta_client/types/letta_streaming_request.py +9 -3
  327. letta_client/types/letta_usage_statistics.py +3 -2
  328. letta_client/types/letta_user_message_content_union.py +2 -1
  329. letta_client/types/llm_config.py +6 -5
  330. letta_client/types/local_sandbox_config.py +3 -2
  331. letta_client/types/max_count_per_step_tool_rule.py +3 -2
  332. letta_client/types/max_count_per_step_tool_rule_schema.py +3 -2
  333. letta_client/types/mcp_tool.py +4 -3
  334. letta_client/types/memory.py +4 -3
  335. letta_client/types/message.py +6 -5
  336. letta_client/types/message_content_item.py +1 -0
  337. letta_client/types/message_create.py +5 -4
  338. letta_client/types/message_create_content.py +1 -0
  339. letta_client/types/message_schema.py +4 -3
  340. letta_client/types/modal_sandbox_config.py +2 -1
  341. letta_client/types/not_found_error_body.py +3 -2
  342. letta_client/types/omitted_reasoning_content.py +3 -2
  343. letta_client/types/openai_types_chat_chat_completion_message_tool_call_param_function.py +3 -2
  344. letta_client/types/openai_types_chat_chat_completion_named_tool_choice_param_function.py +3 -2
  345. letta_client/types/openai_types_chat_completion_create_params_function.py +3 -2
  346. letta_client/types/organization.py +3 -2
  347. letta_client/types/organization_create.py +2 -1
  348. letta_client/types/organization_sources_stats.py +3 -2
  349. letta_client/types/organization_update.py +2 -1
  350. letta_client/types/parameter_properties.py +3 -2
  351. letta_client/types/parameters_schema.py +4 -3
  352. letta_client/types/parent_tool_rule.py +3 -2
  353. letta_client/types/passage.py +4 -3
  354. letta_client/types/payment_required_error_body.py +3 -2
  355. letta_client/types/pip_requirement.py +3 -2
  356. letta_client/types/provider.py +5 -4
  357. letta_client/types/provider_check.py +4 -3
  358. letta_client/types/provider_trace.py +3 -2
  359. letta_client/types/reasoning_content.py +2 -1
  360. letta_client/types/reasoning_message.py +4 -3
  361. letta_client/types/redacted_reasoning_content.py +2 -1
  362. letta_client/types/required_before_exit_tool_rule.py +3 -2
  363. letta_client/types/response_format_json_object.py +3 -2
  364. letta_client/types/response_format_json_schema.py +4 -3
  365. letta_client/types/response_format_text.py +3 -2
  366. letta_client/types/round_robin_manager.py +2 -1
  367. letta_client/types/round_robin_manager_update.py +2 -1
  368. letta_client/types/run.py +4 -3
  369. letta_client/types/sandbox_config.py +4 -3
  370. letta_client/types/sandbox_config_create.py +4 -3
  371. letta_client/types/sandbox_config_create_config.py +2 -1
  372. letta_client/types/sandbox_config_update.py +3 -2
  373. letta_client/types/sandbox_config_update_config.py +2 -1
  374. letta_client/types/sandbox_environment_variable.py +3 -2
  375. letta_client/types/sandbox_environment_variable_create.py +3 -2
  376. letta_client/types/sandbox_environment_variable_update.py +2 -1
  377. letta_client/types/sleeptime_manager.py +2 -1
  378. letta_client/types/sleeptime_manager_update.py +2 -1
  379. letta_client/types/source.py +5 -4
  380. letta_client/types/source_create.py +4 -3
  381. letta_client/types/source_stats.py +4 -3
  382. letta_client/types/source_update.py +3 -2
  383. letta_client/types/sse_server_config.py +4 -3
  384. letta_client/types/stdio_server_config.py +4 -3
  385. letta_client/types/step.py +5 -4
  386. letta_client/types/streamable_http_server_config.py +4 -3
  387. letta_client/types/supervisor_manager.py +2 -1
  388. letta_client/types/supervisor_manager_update.py +2 -1
  389. letta_client/types/system_message.py +2 -1
  390. letta_client/types/tag_schema.py +3 -2
  391. letta_client/types/terminal_tool_rule.py +3 -2
  392. letta_client/types/text_content.py +2 -1
  393. letta_client/types/text_response_format.py +3 -2
  394. letta_client/types/tool.py +5 -4
  395. letta_client/types/tool_annotations.py +4 -3
  396. letta_client/types/tool_call.py +3 -2
  397. letta_client/types/tool_call_content.py +2 -1
  398. letta_client/types/tool_call_delta.py +3 -2
  399. letta_client/types/tool_call_message.py +4 -3
  400. letta_client/types/tool_call_message_tool_call.py +1 -0
  401. letta_client/types/tool_create.py +3 -2
  402. letta_client/types/tool_env_var_schema.py +3 -2
  403. letta_client/types/tool_json_schema.py +4 -3
  404. letta_client/types/tool_return.py +4 -3
  405. letta_client/types/tool_return_content.py +2 -1
  406. letta_client/types/tool_return_message.py +4 -3
  407. letta_client/types/tool_schema.py +5 -4
  408. letta_client/types/update_assistant_message.py +3 -2
  409. letta_client/types/update_assistant_message_content.py +1 -0
  410. letta_client/types/update_reasoning_message.py +3 -2
  411. letta_client/types/update_ssemcp_server.py +2 -1
  412. letta_client/types/update_stdio_mcp_server.py +3 -2
  413. letta_client/types/update_streamable_httpmcp_server.py +2 -1
  414. letta_client/types/update_system_message.py +2 -1
  415. letta_client/types/update_user_message.py +3 -2
  416. letta_client/types/update_user_message_content.py +1 -0
  417. letta_client/types/url_image.py +2 -1
  418. letta_client/types/usage_statistics.py +5 -4
  419. letta_client/types/usage_statistics_completion_token_details.py +3 -2
  420. letta_client/types/usage_statistics_prompt_token_details.py +3 -2
  421. letta_client/types/user.py +3 -2
  422. letta_client/types/user_create.py +3 -2
  423. letta_client/types/user_message.py +3 -2
  424. letta_client/types/user_message_content.py +1 -0
  425. letta_client/types/user_update.py +3 -2
  426. letta_client/types/validation_error.py +4 -3
  427. letta_client/types/voice_sleeptime_manager.py +2 -1
  428. letta_client/types/voice_sleeptime_manager_update.py +2 -1
  429. letta_client/types/web_search_options.py +4 -3
  430. letta_client/types/web_search_options_user_location.py +4 -3
  431. letta_client/types/web_search_options_user_location_approximate.py +3 -2
  432. letta_client/voice/__init__.py +2 -0
  433. letta_client/voice/client.py +33 -74
  434. letta_client/voice/raw_client.py +154 -0
  435. {letta_client-0.1.233.dist-info → letta_client-0.1.235.dist-info}/METADATA +24 -3
  436. letta_client-0.1.235.dist-info/RECORD +503 -0
  437. letta_client-0.1.233.dist-info/RECORD +0 -455
  438. {letta_client-0.1.233.dist-info → letta_client-0.1.235.dist-info}/WHEEL +0 -0
@@ -0,0 +1,1010 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.jsonable_encoder import jsonable_encoder
10
+ from ..core.request_options import RequestOptions
11
+ from ..core.serialization import convert_and_respect_annotation_metadata
12
+ from ..core.unchecked_base_model import construct_type
13
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
14
+ from ..types.http_validation_error import HttpValidationError
15
+ from ..types.identity import Identity
16
+ from ..types.identity_property import IdentityProperty
17
+ from ..types.identity_type import IdentityType
18
+
19
+ # this is used as the default value for optional parameters
20
+ OMIT = typing.cast(typing.Any, ...)
21
+
22
+
23
+ class RawIdentitiesClient:
24
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
25
+ self._client_wrapper = client_wrapper
26
+
27
+ def list(
28
+ self,
29
+ *,
30
+ name: typing.Optional[str] = None,
31
+ project_id: typing.Optional[str] = None,
32
+ identifier_key: typing.Optional[str] = None,
33
+ identity_type: typing.Optional[IdentityType] = None,
34
+ before: typing.Optional[str] = None,
35
+ after: typing.Optional[str] = None,
36
+ limit: typing.Optional[int] = None,
37
+ request_options: typing.Optional[RequestOptions] = None,
38
+ ) -> HttpResponse[typing.List[Identity]]:
39
+ """
40
+ Get a list of all identities in the database
41
+
42
+ Parameters
43
+ ----------
44
+ name : typing.Optional[str]
45
+
46
+ project_id : typing.Optional[str]
47
+
48
+ identifier_key : typing.Optional[str]
49
+
50
+ identity_type : typing.Optional[IdentityType]
51
+
52
+ before : typing.Optional[str]
53
+
54
+ after : typing.Optional[str]
55
+
56
+ limit : typing.Optional[int]
57
+
58
+ request_options : typing.Optional[RequestOptions]
59
+ Request-specific configuration.
60
+
61
+ Returns
62
+ -------
63
+ HttpResponse[typing.List[Identity]]
64
+ Successful Response
65
+ """
66
+ _response = self._client_wrapper.httpx_client.request(
67
+ "v1/identities/",
68
+ method="GET",
69
+ params={
70
+ "name": name,
71
+ "project_id": project_id,
72
+ "identifier_key": identifier_key,
73
+ "identity_type": identity_type,
74
+ "before": before,
75
+ "after": after,
76
+ "limit": limit,
77
+ },
78
+ request_options=request_options,
79
+ )
80
+ try:
81
+ if 200 <= _response.status_code < 300:
82
+ _data = typing.cast(
83
+ typing.List[Identity],
84
+ construct_type(
85
+ type_=typing.List[Identity], # type: ignore
86
+ object_=_response.json(),
87
+ ),
88
+ )
89
+ return HttpResponse(response=_response, data=_data)
90
+ if _response.status_code == 422:
91
+ raise UnprocessableEntityError(
92
+ headers=dict(_response.headers),
93
+ body=typing.cast(
94
+ HttpValidationError,
95
+ construct_type(
96
+ type_=HttpValidationError, # type: ignore
97
+ object_=_response.json(),
98
+ ),
99
+ ),
100
+ )
101
+ _response_json = _response.json()
102
+ except JSONDecodeError:
103
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
104
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
105
+
106
+ def create(
107
+ self,
108
+ *,
109
+ identifier_key: str,
110
+ name: str,
111
+ identity_type: IdentityType,
112
+ project_id: typing.Optional[str] = OMIT,
113
+ agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
114
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
115
+ properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
116
+ request_options: typing.Optional[RequestOptions] = None,
117
+ ) -> HttpResponse[Identity]:
118
+ """
119
+ Parameters
120
+ ----------
121
+ identifier_key : str
122
+ External, user-generated identifier key of the identity.
123
+
124
+ name : str
125
+ The name of the identity.
126
+
127
+ identity_type : IdentityType
128
+ The type of the identity.
129
+
130
+ project_id : typing.Optional[str]
131
+ The project id of the identity, if applicable.
132
+
133
+ agent_ids : typing.Optional[typing.Sequence[str]]
134
+ The agent ids that are associated with the identity.
135
+
136
+ block_ids : typing.Optional[typing.Sequence[str]]
137
+ The IDs of the blocks associated with the identity.
138
+
139
+ properties : typing.Optional[typing.Sequence[IdentityProperty]]
140
+ List of properties associated with the identity.
141
+
142
+ request_options : typing.Optional[RequestOptions]
143
+ Request-specific configuration.
144
+
145
+ Returns
146
+ -------
147
+ HttpResponse[Identity]
148
+ Successful Response
149
+ """
150
+ _response = self._client_wrapper.httpx_client.request(
151
+ "v1/identities/",
152
+ method="POST",
153
+ json={
154
+ "identifier_key": identifier_key,
155
+ "name": name,
156
+ "identity_type": identity_type,
157
+ "project_id": project_id,
158
+ "agent_ids": agent_ids,
159
+ "block_ids": block_ids,
160
+ "properties": convert_and_respect_annotation_metadata(
161
+ object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
162
+ ),
163
+ },
164
+ headers={
165
+ "content-type": "application/json",
166
+ },
167
+ request_options=request_options,
168
+ omit=OMIT,
169
+ )
170
+ try:
171
+ if 200 <= _response.status_code < 300:
172
+ _data = typing.cast(
173
+ Identity,
174
+ construct_type(
175
+ type_=Identity, # type: ignore
176
+ object_=_response.json(),
177
+ ),
178
+ )
179
+ return HttpResponse(response=_response, data=_data)
180
+ if _response.status_code == 422:
181
+ raise UnprocessableEntityError(
182
+ headers=dict(_response.headers),
183
+ body=typing.cast(
184
+ HttpValidationError,
185
+ construct_type(
186
+ type_=HttpValidationError, # type: ignore
187
+ object_=_response.json(),
188
+ ),
189
+ ),
190
+ )
191
+ _response_json = _response.json()
192
+ except JSONDecodeError:
193
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
194
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
195
+
196
+ def upsert(
197
+ self,
198
+ *,
199
+ identifier_key: str,
200
+ name: str,
201
+ identity_type: IdentityType,
202
+ project_id: typing.Optional[str] = OMIT,
203
+ agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
204
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
205
+ properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
206
+ request_options: typing.Optional[RequestOptions] = None,
207
+ ) -> HttpResponse[Identity]:
208
+ """
209
+ Parameters
210
+ ----------
211
+ identifier_key : str
212
+ External, user-generated identifier key of the identity.
213
+
214
+ name : str
215
+ The name of the identity.
216
+
217
+ identity_type : IdentityType
218
+ The type of the identity.
219
+
220
+ project_id : typing.Optional[str]
221
+ The project id of the identity, if applicable.
222
+
223
+ agent_ids : typing.Optional[typing.Sequence[str]]
224
+ The agent ids that are associated with the identity.
225
+
226
+ block_ids : typing.Optional[typing.Sequence[str]]
227
+ The IDs of the blocks associated with the identity.
228
+
229
+ properties : typing.Optional[typing.Sequence[IdentityProperty]]
230
+ List of properties associated with the identity.
231
+
232
+ request_options : typing.Optional[RequestOptions]
233
+ Request-specific configuration.
234
+
235
+ Returns
236
+ -------
237
+ HttpResponse[Identity]
238
+ Successful Response
239
+ """
240
+ _response = self._client_wrapper.httpx_client.request(
241
+ "v1/identities/",
242
+ method="PUT",
243
+ json={
244
+ "identifier_key": identifier_key,
245
+ "name": name,
246
+ "identity_type": identity_type,
247
+ "project_id": project_id,
248
+ "agent_ids": agent_ids,
249
+ "block_ids": block_ids,
250
+ "properties": convert_and_respect_annotation_metadata(
251
+ object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
252
+ ),
253
+ },
254
+ headers={
255
+ "content-type": "application/json",
256
+ },
257
+ request_options=request_options,
258
+ omit=OMIT,
259
+ )
260
+ try:
261
+ if 200 <= _response.status_code < 300:
262
+ _data = typing.cast(
263
+ Identity,
264
+ construct_type(
265
+ type_=Identity, # type: ignore
266
+ object_=_response.json(),
267
+ ),
268
+ )
269
+ return HttpResponse(response=_response, data=_data)
270
+ if _response.status_code == 422:
271
+ raise UnprocessableEntityError(
272
+ headers=dict(_response.headers),
273
+ body=typing.cast(
274
+ HttpValidationError,
275
+ construct_type(
276
+ type_=HttpValidationError, # type: ignore
277
+ object_=_response.json(),
278
+ ),
279
+ ),
280
+ )
281
+ _response_json = _response.json()
282
+ except JSONDecodeError:
283
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
284
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
285
+
286
+ def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[int]:
287
+ """
288
+ Get count of all identities for a user
289
+
290
+ Parameters
291
+ ----------
292
+ request_options : typing.Optional[RequestOptions]
293
+ Request-specific configuration.
294
+
295
+ Returns
296
+ -------
297
+ HttpResponse[int]
298
+ Successful Response
299
+ """
300
+ _response = self._client_wrapper.httpx_client.request(
301
+ "v1/identities/count",
302
+ method="GET",
303
+ request_options=request_options,
304
+ )
305
+ try:
306
+ if 200 <= _response.status_code < 300:
307
+ _data = typing.cast(
308
+ int,
309
+ construct_type(
310
+ type_=int, # type: ignore
311
+ object_=_response.json(),
312
+ ),
313
+ )
314
+ return HttpResponse(response=_response, data=_data)
315
+ if _response.status_code == 422:
316
+ raise UnprocessableEntityError(
317
+ headers=dict(_response.headers),
318
+ body=typing.cast(
319
+ HttpValidationError,
320
+ construct_type(
321
+ type_=HttpValidationError, # type: ignore
322
+ object_=_response.json(),
323
+ ),
324
+ ),
325
+ )
326
+ _response_json = _response.json()
327
+ except JSONDecodeError:
328
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
329
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
330
+
331
+ def retrieve(
332
+ self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None
333
+ ) -> HttpResponse[Identity]:
334
+ """
335
+ Parameters
336
+ ----------
337
+ identity_id : str
338
+
339
+ request_options : typing.Optional[RequestOptions]
340
+ Request-specific configuration.
341
+
342
+ Returns
343
+ -------
344
+ HttpResponse[Identity]
345
+ Successful Response
346
+ """
347
+ _response = self._client_wrapper.httpx_client.request(
348
+ f"v1/identities/{jsonable_encoder(identity_id)}",
349
+ method="GET",
350
+ request_options=request_options,
351
+ )
352
+ try:
353
+ if 200 <= _response.status_code < 300:
354
+ _data = typing.cast(
355
+ Identity,
356
+ construct_type(
357
+ type_=Identity, # type: ignore
358
+ object_=_response.json(),
359
+ ),
360
+ )
361
+ return HttpResponse(response=_response, data=_data)
362
+ if _response.status_code == 422:
363
+ raise UnprocessableEntityError(
364
+ headers=dict(_response.headers),
365
+ body=typing.cast(
366
+ HttpValidationError,
367
+ construct_type(
368
+ type_=HttpValidationError, # type: ignore
369
+ object_=_response.json(),
370
+ ),
371
+ ),
372
+ )
373
+ _response_json = _response.json()
374
+ except JSONDecodeError:
375
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
376
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
377
+
378
+ def delete(
379
+ self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None
380
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
381
+ """
382
+ Delete an identity by its identifier key
383
+
384
+ Parameters
385
+ ----------
386
+ identity_id : str
387
+
388
+ request_options : typing.Optional[RequestOptions]
389
+ Request-specific configuration.
390
+
391
+ Returns
392
+ -------
393
+ HttpResponse[typing.Optional[typing.Any]]
394
+ Successful Response
395
+ """
396
+ _response = self._client_wrapper.httpx_client.request(
397
+ f"v1/identities/{jsonable_encoder(identity_id)}",
398
+ method="DELETE",
399
+ request_options=request_options,
400
+ )
401
+ try:
402
+ if _response is None or not _response.text.strip():
403
+ return HttpResponse(response=_response, data=None)
404
+ if 200 <= _response.status_code < 300:
405
+ _data = typing.cast(
406
+ typing.Optional[typing.Any],
407
+ construct_type(
408
+ type_=typing.Optional[typing.Any], # type: ignore
409
+ object_=_response.json(),
410
+ ),
411
+ )
412
+ return HttpResponse(response=_response, data=_data)
413
+ if _response.status_code == 422:
414
+ raise UnprocessableEntityError(
415
+ headers=dict(_response.headers),
416
+ body=typing.cast(
417
+ HttpValidationError,
418
+ construct_type(
419
+ type_=HttpValidationError, # type: ignore
420
+ object_=_response.json(),
421
+ ),
422
+ ),
423
+ )
424
+ _response_json = _response.json()
425
+ except JSONDecodeError:
426
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
427
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
428
+
429
+ def modify(
430
+ self,
431
+ identity_id: str,
432
+ *,
433
+ identifier_key: typing.Optional[str] = OMIT,
434
+ name: typing.Optional[str] = OMIT,
435
+ identity_type: typing.Optional[IdentityType] = OMIT,
436
+ agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
437
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
438
+ properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
439
+ request_options: typing.Optional[RequestOptions] = None,
440
+ ) -> HttpResponse[Identity]:
441
+ """
442
+ Parameters
443
+ ----------
444
+ identity_id : str
445
+
446
+ identifier_key : typing.Optional[str]
447
+ External, user-generated identifier key of the identity.
448
+
449
+ name : typing.Optional[str]
450
+ The name of the identity.
451
+
452
+ identity_type : typing.Optional[IdentityType]
453
+ The type of the identity.
454
+
455
+ agent_ids : typing.Optional[typing.Sequence[str]]
456
+ The agent ids that are associated with the identity.
457
+
458
+ block_ids : typing.Optional[typing.Sequence[str]]
459
+ The IDs of the blocks associated with the identity.
460
+
461
+ properties : typing.Optional[typing.Sequence[IdentityProperty]]
462
+ List of properties associated with the identity.
463
+
464
+ request_options : typing.Optional[RequestOptions]
465
+ Request-specific configuration.
466
+
467
+ Returns
468
+ -------
469
+ HttpResponse[Identity]
470
+ Successful Response
471
+ """
472
+ _response = self._client_wrapper.httpx_client.request(
473
+ f"v1/identities/{jsonable_encoder(identity_id)}",
474
+ method="PATCH",
475
+ json={
476
+ "identifier_key": identifier_key,
477
+ "name": name,
478
+ "identity_type": identity_type,
479
+ "agent_ids": agent_ids,
480
+ "block_ids": block_ids,
481
+ "properties": convert_and_respect_annotation_metadata(
482
+ object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
483
+ ),
484
+ },
485
+ headers={
486
+ "content-type": "application/json",
487
+ },
488
+ request_options=request_options,
489
+ omit=OMIT,
490
+ )
491
+ try:
492
+ if 200 <= _response.status_code < 300:
493
+ _data = typing.cast(
494
+ Identity,
495
+ construct_type(
496
+ type_=Identity, # type: ignore
497
+ object_=_response.json(),
498
+ ),
499
+ )
500
+ return HttpResponse(response=_response, data=_data)
501
+ if _response.status_code == 422:
502
+ raise UnprocessableEntityError(
503
+ headers=dict(_response.headers),
504
+ body=typing.cast(
505
+ HttpValidationError,
506
+ construct_type(
507
+ type_=HttpValidationError, # type: ignore
508
+ object_=_response.json(),
509
+ ),
510
+ ),
511
+ )
512
+ _response_json = _response.json()
513
+ except JSONDecodeError:
514
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
515
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
516
+
517
+
518
+ class AsyncRawIdentitiesClient:
519
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
520
+ self._client_wrapper = client_wrapper
521
+
522
+ async def list(
523
+ self,
524
+ *,
525
+ name: typing.Optional[str] = None,
526
+ project_id: typing.Optional[str] = None,
527
+ identifier_key: typing.Optional[str] = None,
528
+ identity_type: typing.Optional[IdentityType] = None,
529
+ before: typing.Optional[str] = None,
530
+ after: typing.Optional[str] = None,
531
+ limit: typing.Optional[int] = None,
532
+ request_options: typing.Optional[RequestOptions] = None,
533
+ ) -> AsyncHttpResponse[typing.List[Identity]]:
534
+ """
535
+ Get a list of all identities in the database
536
+
537
+ Parameters
538
+ ----------
539
+ name : typing.Optional[str]
540
+
541
+ project_id : typing.Optional[str]
542
+
543
+ identifier_key : typing.Optional[str]
544
+
545
+ identity_type : typing.Optional[IdentityType]
546
+
547
+ before : typing.Optional[str]
548
+
549
+ after : typing.Optional[str]
550
+
551
+ limit : typing.Optional[int]
552
+
553
+ request_options : typing.Optional[RequestOptions]
554
+ Request-specific configuration.
555
+
556
+ Returns
557
+ -------
558
+ AsyncHttpResponse[typing.List[Identity]]
559
+ Successful Response
560
+ """
561
+ _response = await self._client_wrapper.httpx_client.request(
562
+ "v1/identities/",
563
+ method="GET",
564
+ params={
565
+ "name": name,
566
+ "project_id": project_id,
567
+ "identifier_key": identifier_key,
568
+ "identity_type": identity_type,
569
+ "before": before,
570
+ "after": after,
571
+ "limit": limit,
572
+ },
573
+ request_options=request_options,
574
+ )
575
+ try:
576
+ if 200 <= _response.status_code < 300:
577
+ _data = typing.cast(
578
+ typing.List[Identity],
579
+ construct_type(
580
+ type_=typing.List[Identity], # type: ignore
581
+ object_=_response.json(),
582
+ ),
583
+ )
584
+ return AsyncHttpResponse(response=_response, data=_data)
585
+ if _response.status_code == 422:
586
+ raise UnprocessableEntityError(
587
+ headers=dict(_response.headers),
588
+ body=typing.cast(
589
+ HttpValidationError,
590
+ construct_type(
591
+ type_=HttpValidationError, # type: ignore
592
+ object_=_response.json(),
593
+ ),
594
+ ),
595
+ )
596
+ _response_json = _response.json()
597
+ except JSONDecodeError:
598
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
599
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
600
+
601
+ async def create(
602
+ self,
603
+ *,
604
+ identifier_key: str,
605
+ name: str,
606
+ identity_type: IdentityType,
607
+ project_id: typing.Optional[str] = OMIT,
608
+ agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
609
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
610
+ properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
611
+ request_options: typing.Optional[RequestOptions] = None,
612
+ ) -> AsyncHttpResponse[Identity]:
613
+ """
614
+ Parameters
615
+ ----------
616
+ identifier_key : str
617
+ External, user-generated identifier key of the identity.
618
+
619
+ name : str
620
+ The name of the identity.
621
+
622
+ identity_type : IdentityType
623
+ The type of the identity.
624
+
625
+ project_id : typing.Optional[str]
626
+ The project id of the identity, if applicable.
627
+
628
+ agent_ids : typing.Optional[typing.Sequence[str]]
629
+ The agent ids that are associated with the identity.
630
+
631
+ block_ids : typing.Optional[typing.Sequence[str]]
632
+ The IDs of the blocks associated with the identity.
633
+
634
+ properties : typing.Optional[typing.Sequence[IdentityProperty]]
635
+ List of properties associated with the identity.
636
+
637
+ request_options : typing.Optional[RequestOptions]
638
+ Request-specific configuration.
639
+
640
+ Returns
641
+ -------
642
+ AsyncHttpResponse[Identity]
643
+ Successful Response
644
+ """
645
+ _response = await self._client_wrapper.httpx_client.request(
646
+ "v1/identities/",
647
+ method="POST",
648
+ json={
649
+ "identifier_key": identifier_key,
650
+ "name": name,
651
+ "identity_type": identity_type,
652
+ "project_id": project_id,
653
+ "agent_ids": agent_ids,
654
+ "block_ids": block_ids,
655
+ "properties": convert_and_respect_annotation_metadata(
656
+ object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
657
+ ),
658
+ },
659
+ headers={
660
+ "content-type": "application/json",
661
+ },
662
+ request_options=request_options,
663
+ omit=OMIT,
664
+ )
665
+ try:
666
+ if 200 <= _response.status_code < 300:
667
+ _data = typing.cast(
668
+ Identity,
669
+ construct_type(
670
+ type_=Identity, # type: ignore
671
+ object_=_response.json(),
672
+ ),
673
+ )
674
+ return AsyncHttpResponse(response=_response, data=_data)
675
+ if _response.status_code == 422:
676
+ raise UnprocessableEntityError(
677
+ headers=dict(_response.headers),
678
+ body=typing.cast(
679
+ HttpValidationError,
680
+ construct_type(
681
+ type_=HttpValidationError, # type: ignore
682
+ object_=_response.json(),
683
+ ),
684
+ ),
685
+ )
686
+ _response_json = _response.json()
687
+ except JSONDecodeError:
688
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
689
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
690
+
691
+ async def upsert(
692
+ self,
693
+ *,
694
+ identifier_key: str,
695
+ name: str,
696
+ identity_type: IdentityType,
697
+ project_id: typing.Optional[str] = OMIT,
698
+ agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
699
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
700
+ properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
701
+ request_options: typing.Optional[RequestOptions] = None,
702
+ ) -> AsyncHttpResponse[Identity]:
703
+ """
704
+ Parameters
705
+ ----------
706
+ identifier_key : str
707
+ External, user-generated identifier key of the identity.
708
+
709
+ name : str
710
+ The name of the identity.
711
+
712
+ identity_type : IdentityType
713
+ The type of the identity.
714
+
715
+ project_id : typing.Optional[str]
716
+ The project id of the identity, if applicable.
717
+
718
+ agent_ids : typing.Optional[typing.Sequence[str]]
719
+ The agent ids that are associated with the identity.
720
+
721
+ block_ids : typing.Optional[typing.Sequence[str]]
722
+ The IDs of the blocks associated with the identity.
723
+
724
+ properties : typing.Optional[typing.Sequence[IdentityProperty]]
725
+ List of properties associated with the identity.
726
+
727
+ request_options : typing.Optional[RequestOptions]
728
+ Request-specific configuration.
729
+
730
+ Returns
731
+ -------
732
+ AsyncHttpResponse[Identity]
733
+ Successful Response
734
+ """
735
+ _response = await self._client_wrapper.httpx_client.request(
736
+ "v1/identities/",
737
+ method="PUT",
738
+ json={
739
+ "identifier_key": identifier_key,
740
+ "name": name,
741
+ "identity_type": identity_type,
742
+ "project_id": project_id,
743
+ "agent_ids": agent_ids,
744
+ "block_ids": block_ids,
745
+ "properties": convert_and_respect_annotation_metadata(
746
+ object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
747
+ ),
748
+ },
749
+ headers={
750
+ "content-type": "application/json",
751
+ },
752
+ request_options=request_options,
753
+ omit=OMIT,
754
+ )
755
+ try:
756
+ if 200 <= _response.status_code < 300:
757
+ _data = typing.cast(
758
+ Identity,
759
+ construct_type(
760
+ type_=Identity, # type: ignore
761
+ object_=_response.json(),
762
+ ),
763
+ )
764
+ return AsyncHttpResponse(response=_response, data=_data)
765
+ if _response.status_code == 422:
766
+ raise UnprocessableEntityError(
767
+ headers=dict(_response.headers),
768
+ body=typing.cast(
769
+ HttpValidationError,
770
+ construct_type(
771
+ type_=HttpValidationError, # type: ignore
772
+ object_=_response.json(),
773
+ ),
774
+ ),
775
+ )
776
+ _response_json = _response.json()
777
+ except JSONDecodeError:
778
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
779
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
780
+
781
+ async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> AsyncHttpResponse[int]:
782
+ """
783
+ Get count of all identities for a user
784
+
785
+ Parameters
786
+ ----------
787
+ request_options : typing.Optional[RequestOptions]
788
+ Request-specific configuration.
789
+
790
+ Returns
791
+ -------
792
+ AsyncHttpResponse[int]
793
+ Successful Response
794
+ """
795
+ _response = await self._client_wrapper.httpx_client.request(
796
+ "v1/identities/count",
797
+ method="GET",
798
+ request_options=request_options,
799
+ )
800
+ try:
801
+ if 200 <= _response.status_code < 300:
802
+ _data = typing.cast(
803
+ int,
804
+ construct_type(
805
+ type_=int, # type: ignore
806
+ object_=_response.json(),
807
+ ),
808
+ )
809
+ return AsyncHttpResponse(response=_response, data=_data)
810
+ if _response.status_code == 422:
811
+ raise UnprocessableEntityError(
812
+ headers=dict(_response.headers),
813
+ body=typing.cast(
814
+ HttpValidationError,
815
+ construct_type(
816
+ type_=HttpValidationError, # type: ignore
817
+ object_=_response.json(),
818
+ ),
819
+ ),
820
+ )
821
+ _response_json = _response.json()
822
+ except JSONDecodeError:
823
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
824
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
825
+
826
+ async def retrieve(
827
+ self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None
828
+ ) -> AsyncHttpResponse[Identity]:
829
+ """
830
+ Parameters
831
+ ----------
832
+ identity_id : str
833
+
834
+ request_options : typing.Optional[RequestOptions]
835
+ Request-specific configuration.
836
+
837
+ Returns
838
+ -------
839
+ AsyncHttpResponse[Identity]
840
+ Successful Response
841
+ """
842
+ _response = await self._client_wrapper.httpx_client.request(
843
+ f"v1/identities/{jsonable_encoder(identity_id)}",
844
+ method="GET",
845
+ request_options=request_options,
846
+ )
847
+ try:
848
+ if 200 <= _response.status_code < 300:
849
+ _data = typing.cast(
850
+ Identity,
851
+ construct_type(
852
+ type_=Identity, # type: ignore
853
+ object_=_response.json(),
854
+ ),
855
+ )
856
+ return AsyncHttpResponse(response=_response, data=_data)
857
+ if _response.status_code == 422:
858
+ raise UnprocessableEntityError(
859
+ headers=dict(_response.headers),
860
+ body=typing.cast(
861
+ HttpValidationError,
862
+ construct_type(
863
+ type_=HttpValidationError, # type: ignore
864
+ object_=_response.json(),
865
+ ),
866
+ ),
867
+ )
868
+ _response_json = _response.json()
869
+ except JSONDecodeError:
870
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
871
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
872
+
873
+ async def delete(
874
+ self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None
875
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
876
+ """
877
+ Delete an identity by its identifier key
878
+
879
+ Parameters
880
+ ----------
881
+ identity_id : str
882
+
883
+ request_options : typing.Optional[RequestOptions]
884
+ Request-specific configuration.
885
+
886
+ Returns
887
+ -------
888
+ AsyncHttpResponse[typing.Optional[typing.Any]]
889
+ Successful Response
890
+ """
891
+ _response = await self._client_wrapper.httpx_client.request(
892
+ f"v1/identities/{jsonable_encoder(identity_id)}",
893
+ method="DELETE",
894
+ request_options=request_options,
895
+ )
896
+ try:
897
+ if _response is None or not _response.text.strip():
898
+ return AsyncHttpResponse(response=_response, data=None)
899
+ if 200 <= _response.status_code < 300:
900
+ _data = typing.cast(
901
+ typing.Optional[typing.Any],
902
+ construct_type(
903
+ type_=typing.Optional[typing.Any], # type: ignore
904
+ object_=_response.json(),
905
+ ),
906
+ )
907
+ return AsyncHttpResponse(response=_response, data=_data)
908
+ if _response.status_code == 422:
909
+ raise UnprocessableEntityError(
910
+ headers=dict(_response.headers),
911
+ body=typing.cast(
912
+ HttpValidationError,
913
+ construct_type(
914
+ type_=HttpValidationError, # type: ignore
915
+ object_=_response.json(),
916
+ ),
917
+ ),
918
+ )
919
+ _response_json = _response.json()
920
+ except JSONDecodeError:
921
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
922
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
923
+
924
+ async def modify(
925
+ self,
926
+ identity_id: str,
927
+ *,
928
+ identifier_key: typing.Optional[str] = OMIT,
929
+ name: typing.Optional[str] = OMIT,
930
+ identity_type: typing.Optional[IdentityType] = OMIT,
931
+ agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
932
+ block_ids: typing.Optional[typing.Sequence[str]] = OMIT,
933
+ properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
934
+ request_options: typing.Optional[RequestOptions] = None,
935
+ ) -> AsyncHttpResponse[Identity]:
936
+ """
937
+ Parameters
938
+ ----------
939
+ identity_id : str
940
+
941
+ identifier_key : typing.Optional[str]
942
+ External, user-generated identifier key of the identity.
943
+
944
+ name : typing.Optional[str]
945
+ The name of the identity.
946
+
947
+ identity_type : typing.Optional[IdentityType]
948
+ The type of the identity.
949
+
950
+ agent_ids : typing.Optional[typing.Sequence[str]]
951
+ The agent ids that are associated with the identity.
952
+
953
+ block_ids : typing.Optional[typing.Sequence[str]]
954
+ The IDs of the blocks associated with the identity.
955
+
956
+ properties : typing.Optional[typing.Sequence[IdentityProperty]]
957
+ List of properties associated with the identity.
958
+
959
+ request_options : typing.Optional[RequestOptions]
960
+ Request-specific configuration.
961
+
962
+ Returns
963
+ -------
964
+ AsyncHttpResponse[Identity]
965
+ Successful Response
966
+ """
967
+ _response = await self._client_wrapper.httpx_client.request(
968
+ f"v1/identities/{jsonable_encoder(identity_id)}",
969
+ method="PATCH",
970
+ json={
971
+ "identifier_key": identifier_key,
972
+ "name": name,
973
+ "identity_type": identity_type,
974
+ "agent_ids": agent_ids,
975
+ "block_ids": block_ids,
976
+ "properties": convert_and_respect_annotation_metadata(
977
+ object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
978
+ ),
979
+ },
980
+ headers={
981
+ "content-type": "application/json",
982
+ },
983
+ request_options=request_options,
984
+ omit=OMIT,
985
+ )
986
+ try:
987
+ if 200 <= _response.status_code < 300:
988
+ _data = typing.cast(
989
+ Identity,
990
+ construct_type(
991
+ type_=Identity, # type: ignore
992
+ object_=_response.json(),
993
+ ),
994
+ )
995
+ return AsyncHttpResponse(response=_response, data=_data)
996
+ if _response.status_code == 422:
997
+ raise UnprocessableEntityError(
998
+ headers=dict(_response.headers),
999
+ body=typing.cast(
1000
+ HttpValidationError,
1001
+ construct_type(
1002
+ type_=HttpValidationError, # type: ignore
1003
+ object_=_response.json(),
1004
+ ),
1005
+ ),
1006
+ )
1007
+ _response_json = _response.json()
1008
+ except JSONDecodeError:
1009
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1010
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)