letta-client 1.0.0a6__py3-none-any.whl → 1.0.0a7__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (467) hide show
  1. {letta_sdk → letta_client}/__init__.py +8 -8
  2. {letta_sdk → letta_client}/_base_client.py +1 -1
  3. {letta_sdk → letta_client}/_client.py +124 -171
  4. {letta_sdk → letta_client}/_exceptions.py +2 -2
  5. {letta_sdk → letta_client}/_resource.py +5 -5
  6. {letta_sdk → letta_client}/_response.py +8 -6
  7. {letta_sdk → letta_client}/_streaming.py +3 -3
  8. {letta_sdk → letta_client}/_types.py +1 -1
  9. {letta_sdk → letta_client}/_utils/_logs.py +3 -3
  10. {letta_sdk → letta_client}/_utils/_resources_proxy.py +4 -4
  11. {letta_sdk → letta_client}/_version.py +2 -2
  12. {letta_sdk → letta_client}/resources/__init__.py +14 -154
  13. {letta_sdk → letta_client}/resources/agents/__init__.py +28 -42
  14. {letta_sdk → letta_client}/resources/agents/agents.py +216 -734
  15. {letta_sdk/resources/agents/core_memory → letta_client/resources/agents}/blocks.py +103 -12
  16. {letta_sdk → letta_client}/resources/agents/files.py +71 -8
  17. {letta_sdk → letta_client}/resources/agents/folders.py +90 -3
  18. letta_client/resources/agents/groups.py +242 -0
  19. {letta_sdk → letta_client}/resources/agents/messages.py +252 -480
  20. {letta_sdk → letta_client}/resources/agents/tools.py +135 -22
  21. letta_sdk/resources/jobs.py → letta_client/resources/archives.py +268 -280
  22. {letta_sdk/resources/messages → letta_client/resources/batches}/batches.py +35 -152
  23. letta_client/resources/batches/messages.py +238 -0
  24. {letta_sdk/resources/agents/core_memory → letta_client/resources/blocks}/__init__.py +14 -14
  25. letta_client/resources/blocks/agents.py +284 -0
  26. {letta_sdk/resources → letta_client/resources/blocks}/blocks.py +54 -167
  27. letta_client/resources/folders/__init__.py +47 -0
  28. letta_client/resources/folders/agents.py +234 -0
  29. letta_client/resources/folders/files.py +469 -0
  30. letta_sdk/resources/providers.py → letta_client/resources/folders/folders.py +292 -309
  31. {letta_sdk → letta_client}/resources/groups/groups.py +12 -78
  32. {letta_sdk → letta_client}/resources/groups/messages.py +165 -27
  33. letta_client/resources/identities/__init__.py +61 -0
  34. letta_client/resources/identities/agents.py +266 -0
  35. letta_client/resources/identities/blocks.py +234 -0
  36. {letta_sdk/resources → letta_client/resources/identities}/identities.py +267 -525
  37. letta_client/resources/identities/properties.py +174 -0
  38. letta_client/resources/models/__init__.py +33 -0
  39. {letta_sdk/resources → letta_client/resources/models}/embeddings.py +26 -49
  40. {letta_sdk/resources → letta_client/resources/models}/models.py +42 -117
  41. letta_client/resources/runs/__init__.py +61 -0
  42. letta_sdk/resources/archives.py → letta_client/resources/runs/messages.py +182 -153
  43. letta_client/resources/runs/runs.py +460 -0
  44. letta_sdk/resources/projects.py → letta_client/resources/runs/steps.py +93 -56
  45. letta_sdk/resources/voice_beta/chat.py → letta_client/resources/runs/usage.py +50 -57
  46. letta_client/resources/steps/__init__.py +75 -0
  47. letta_client/resources/steps/feedback.py +198 -0
  48. letta_client/resources/steps/messages.py +234 -0
  49. letta_client/resources/steps/metrics.py +167 -0
  50. letta_client/resources/steps/steps.py +511 -0
  51. letta_sdk/resources/telemetry.py → letta_client/resources/steps/trace.py +45 -56
  52. letta_client/resources/templates/__init__.py +33 -0
  53. letta_client/resources/templates/agents.py +236 -0
  54. letta_client/resources/templates/templates.py +102 -0
  55. {letta_sdk/resources/tools → letta_client/resources}/tools.py +239 -425
  56. letta_client/types/__init__.py +120 -0
  57. {letta_sdk → letta_client}/types/agent_create_params.py +5 -2
  58. {letta_sdk → letta_client}/types/agent_environment_variable.py +3 -0
  59. letta_client/types/agent_export_file_params.py +18 -0
  60. letta_sdk/types/agent_export_response.py → letta_client/types/agent_export_file_response.py +2 -2
  61. letta_sdk/types/agent_import_params.py → letta_client/types/agent_import_file_params.py +5 -2
  62. letta_sdk/types/agent_import_response.py → letta_client/types/agent_import_file_response.py +2 -2
  63. {letta_sdk → letta_client}/types/agent_list_params.py +19 -2
  64. {letta_sdk → letta_client}/types/agent_retrieve_params.py +20 -3
  65. {letta_sdk → letta_client}/types/agent_state.py +131 -3
  66. {letta_sdk → letta_client}/types/agent_type.py +1 -0
  67. {letta_sdk → letta_client}/types/agent_update_params.py +12 -0
  68. {letta_sdk → letta_client}/types/agents/__init__.py +12 -19
  69. letta_client/types/agents/approval_create_param.py +44 -0
  70. {letta_sdk → letta_client}/types/agents/approval_request_message.py +10 -2
  71. letta_client/types/agents/approval_response_message.py +63 -0
  72. {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block.py +1 -1
  73. letta_sdk/types/identity_list_blocks_params.py → letta_client/types/agents/block_list_params.py +2 -2
  74. {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block_update_params.py +1 -0
  75. letta_client/types/agents/file_list_params.py +40 -0
  76. letta_client/types/agents/folder_list_params.py +34 -0
  77. letta_sdk/types/source.py → letta_client/types/agents/folder_list_response.py +10 -6
  78. letta_client/types/agents/group_list_params.py +37 -0
  79. letta_client/types/agents/group_list_response.py +10 -0
  80. {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union.py +3 -0
  81. {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union_param.py +4 -0
  82. {letta_sdk → letta_client}/types/agents/letta_response.py +0 -4
  83. {letta_sdk → letta_client}/types/agents/message.py +93 -2
  84. {letta_sdk → letta_client}/types/agents/message_list_params.py +20 -5
  85. letta_sdk/types/agent_reset_messages_params.py → letta_client/types/agents/message_reset_params.py +2 -2
  86. {letta_sdk → letta_client}/types/agents/message_send_async_params.py +12 -3
  87. {letta_sdk → letta_client}/types/agents/message_send_params.py +12 -3
  88. letta_sdk/types/agents/message_send_stream_params.py → letta_client/types/agents/message_stream_params.py +14 -5
  89. {letta_sdk → letta_client}/types/agents/message_update_params.py +4 -0
  90. {letta_sdk → letta_client}/types/agents/omitted_reasoning_content.py +3 -0
  91. {letta_sdk → letta_client}/types/agents/omitted_reasoning_content_param.py +4 -0
  92. {letta_sdk → letta_client}/types/agents/run.py +16 -19
  93. {letta_sdk → letta_client}/types/agents/text_content.py +3 -0
  94. {letta_sdk → letta_client}/types/agents/text_content_param.py +4 -0
  95. {letta_sdk → letta_client}/types/agents/tool_call_content.py +3 -0
  96. {letta_sdk → letta_client}/types/agents/tool_call_content_param.py +4 -1
  97. {letta_sdk → letta_client}/types/agents/tool_call_message.py +6 -2
  98. letta_client/types/agents/tool_list_params.py +34 -0
  99. {letta_sdk → letta_client}/types/agents/tool_return.py +7 -3
  100. letta_client/types/agents/tool_return_param.py +25 -0
  101. letta_client/types/agents/tool_update_approval_params.py +21 -0
  102. {letta_sdk → letta_client}/types/archive.py +4 -0
  103. letta_client/types/archive_create_params.py +19 -0
  104. letta_sdk/types/archive_retrieve_params.py → letta_client/types/archive_list_params.py +2 -2
  105. letta_sdk/types/archive_retrieve_response.py → letta_client/types/archive_list_response.py +2 -2
  106. {letta_sdk → letta_client}/types/archive_update_params.py +3 -3
  107. {letta_sdk/types/messages → letta_client/types}/batch_create_params.py +15 -6
  108. letta_sdk/types/job.py → letta_client/types/batch_job.py +8 -3
  109. letta_client/types/batches/__init__.py +6 -0
  110. letta_sdk/types/messages/batch_list_messages_params.py → letta_client/types/batches/message_list_params.py +2 -2
  111. letta_sdk/types/messages/batch_list_messages_response.py → letta_client/types/batches/message_list_response.py +2 -2
  112. {letta_sdk → letta_client}/types/block_list_response.py +1 -1
  113. letta_client/types/blocks/__init__.py +6 -0
  114. letta_sdk/types/block_list_agents_params.py → letta_client/types/blocks/agent_list_params.py +22 -5
  115. letta_sdk/types/agent_list_groups_response.py → letta_client/types/blocks/agent_list_response.py +3 -3
  116. letta_client/types/child_tool_rule.py +40 -0
  117. letta_client/types/child_tool_rule_param.py +42 -0
  118. letta_client/types/folders/__init__.py +10 -0
  119. letta_sdk/types/folder_list_agents_params.py → letta_client/types/folders/agent_list_params.py +2 -2
  120. letta_sdk/types/run_list_active_response.py → letta_client/types/folders/agent_list_response.py +2 -4
  121. letta_sdk/types/folder_list_files_params.py → letta_client/types/folders/file_list_params.py +2 -2
  122. letta_client/types/folders/file_list_response.py +68 -0
  123. letta_sdk/types/source_upload_file_params.py → letta_client/types/folders/file_upload_params.py +5 -6
  124. letta_sdk/types/file_metadata.py → letta_client/types/folders/file_upload_response.py +5 -5
  125. {letta_sdk → letta_client}/types/groups/__init__.py +1 -1
  126. {letta_sdk → letta_client}/types/groups/message_send_params.py +12 -3
  127. letta_sdk/types/groups/message_send_stream_params.py → letta_client/types/groups/message_stream_params.py +14 -5
  128. {letta_sdk → letta_client}/types/groups/message_update_params.py +4 -0
  129. letta_sdk/types/health_check_response.py → letta_client/types/health_response.py +2 -2
  130. letta_client/types/identities/__init__.py +9 -0
  131. letta_sdk/types/identity_list_agents_params.py → letta_client/types/identities/agent_list_params.py +19 -3
  132. letta_client/types/identities/agent_list_response.py +10 -0
  133. letta_client/types/identities/block_list_params.py +34 -0
  134. letta_sdk/types/agents/folder_list_response.py → letta_client/types/identities/block_list_response.py +3 -3
  135. letta_sdk/types/identity_upsert_properties_params.py → letta_client/types/identities/property_upsert_params.py +3 -3
  136. letta_sdk/types/identity_modify_params.py → letta_client/types/identity_update_params.py +2 -2
  137. {letta_sdk → letta_client}/types/init_tool_rule.py +10 -1
  138. {letta_sdk → letta_client}/types/init_tool_rule_param.py +10 -1
  139. {letta_sdk → letta_client}/types/llm_config.py +6 -0
  140. {letta_sdk → letta_client}/types/llm_config_param.py +6 -0
  141. {letta_sdk/types/voice_beta → letta_client/types/models}/__init__.py +1 -1
  142. letta_sdk/types/agents/archival_memory_create_response.py → letta_client/types/models/embedding_list_response.py +3 -3
  143. {letta_sdk → letta_client}/types/run_list_params.py +29 -5
  144. letta_client/types/runs/__init__.py +10 -0
  145. letta_sdk/types/run_list_messages_params.py → letta_client/types/runs/message_list_params.py +5 -2
  146. letta_client/types/runs/message_list_response.py +10 -0
  147. letta_sdk/types/run_retrieve_stream_params.py → letta_client/types/runs/message_stream_params.py +2 -2
  148. letta_sdk/types/run_list_steps_params.py → letta_client/types/runs/step_list_params.py +9 -6
  149. letta_sdk/types/job_list_response.py → letta_client/types/runs/step_list_response.py +3 -3
  150. letta_sdk/types/run_retrieve_usage_response.py → letta_client/types/runs/usage_retrieve_response.py +3 -3
  151. {letta_sdk → letta_client}/types/step.py +6 -6
  152. letta_client/types/steps/__init__.py +8 -0
  153. letta_sdk/types/step_update_feedback_params.py → letta_client/types/steps/feedback_create_params.py +3 -3
  154. letta_sdk/types/step_list_messages_params.py → letta_client/types/steps/message_list_params.py +2 -2
  155. letta_client/types/steps/message_list_response.py +34 -0
  156. letta_sdk/types/step_retrieve_metrics_response.py → letta_client/types/steps/metric_retrieve_response.py +6 -6
  157. {letta_sdk/types/tools → letta_client/types/templates}/__init__.py +2 -0
  158. letta_sdk/types/template_create_agents_params.py → letta_client/types/templates/agent_create_params.py +4 -4
  159. {letta_sdk → letta_client}/types/tool.py +6 -0
  160. {letta_sdk → letta_client}/types/tool_create_params.py +6 -0
  161. {letta_sdk → letta_client}/types/tool_return_message.py +3 -0
  162. letta_sdk/types/tool_modify_params.py → letta_client/types/tool_update_params.py +8 -2
  163. letta_sdk/types/tool_upsert_base_response.py → letta_client/types/tool_upsert_base_tools_response.py +2 -2
  164. {letta_sdk → letta_client}/types/tool_upsert_params.py +6 -0
  165. {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/METADATA +110 -70
  166. letta_client-1.0.0a7.dist-info/RECORD +307 -0
  167. {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/licenses/LICENSE +1 -1
  168. letta_client-1.0.0a6.dist-info/RECORD +0 -420
  169. letta_sdk/resources/_internal_templates/__init__.py +0 -33
  170. letta_sdk/resources/_internal_templates/_internal_templates.py +0 -961
  171. letta_sdk/resources/_internal_templates/deployment.py +0 -268
  172. letta_sdk/resources/agents/archival_memory.py +0 -581
  173. letta_sdk/resources/agents/core_memory/core_memory.py +0 -278
  174. letta_sdk/resources/agents/sources.py +0 -332
  175. letta_sdk/resources/client_side_access_tokens.py +0 -402
  176. letta_sdk/resources/folders.py +0 -1562
  177. letta_sdk/resources/health.py +0 -135
  178. letta_sdk/resources/messages/messages.py +0 -102
  179. letta_sdk/resources/runs.py +0 -1016
  180. letta_sdk/resources/sources/__init__.py +0 -33
  181. letta_sdk/resources/sources/files.py +0 -341
  182. letta_sdk/resources/sources/sources.py +0 -1371
  183. letta_sdk/resources/steps.py +0 -784
  184. letta_sdk/resources/templates.py +0 -1310
  185. letta_sdk/resources/tools/__init__.py +0 -47
  186. letta_sdk/resources/tools/composio/__init__.py +0 -33
  187. letta_sdk/resources/tools/composio/apps.py +0 -214
  188. letta_sdk/resources/tools/composio/composio.py +0 -201
  189. letta_sdk/resources/tools/mcp/__init__.py +0 -47
  190. letta_sdk/resources/tools/mcp/mcp.py +0 -134
  191. letta_sdk/resources/tools/mcp/oauth.py +0 -214
  192. letta_sdk/resources/tools/mcp/servers/__init__.py +0 -33
  193. letta_sdk/resources/tools/mcp/servers/servers.py +0 -1785
  194. letta_sdk/resources/tools/mcp/servers/tools.py +0 -263
  195. letta_sdk/resources/voice_beta/__init__.py +0 -33
  196. letta_sdk/resources/voice_beta/voice_beta.py +0 -102
  197. letta_sdk/types/__init__.py +0 -226
  198. letta_sdk/types/_internal_templates/__init__.py +0 -7
  199. letta_sdk/types/_internal_templates/deployment_delete_response.py +0 -17
  200. letta_sdk/types/_internal_templates/deployment_list_entities_params.py +0 -15
  201. letta_sdk/types/_internal_templates/deployment_list_entities_response.py +0 -31
  202. letta_sdk/types/agent_export_params.py +0 -17
  203. letta_sdk/types/agent_list_groups_params.py +0 -13
  204. letta_sdk/types/agent_migrate_params.py +0 -19
  205. letta_sdk/types/agent_migrate_response.py +0 -11
  206. letta_sdk/types/agent_retrieve_context_response.py +0 -110
  207. letta_sdk/types/agent_search_params.py +0 -78
  208. letta_sdk/types/agent_search_response.py +0 -16
  209. letta_sdk/types/agent_summarize_params.py +0 -12
  210. letta_sdk/types/agents/approval_create_param.py +0 -22
  211. letta_sdk/types/agents/approval_response_message.py +0 -41
  212. letta_sdk/types/agents/archival_memory_create_params.py +0 -23
  213. letta_sdk/types/agents/archival_memory_list_params.py +0 -28
  214. letta_sdk/types/agents/archival_memory_list_response.py +0 -10
  215. letta_sdk/types/agents/archival_memory_search_params.py +0 -35
  216. letta_sdk/types/agents/archival_memory_search_response.py +0 -26
  217. letta_sdk/types/agents/core_memory/__init__.py +0 -7
  218. letta_sdk/types/agents/core_memory_retrieve_variables_response.py +0 -11
  219. letta_sdk/types/agents/file_list_params.py +0 -19
  220. letta_sdk/types/agents/letta_request_param.py +0 -45
  221. letta_sdk/types/agents/letta_streaming_request_param.py +0 -60
  222. letta_sdk/types/agents/memory.py +0 -92
  223. letta_sdk/types/agents/message_preview_raw_payload_params.py +0 -103
  224. letta_sdk/types/agents/message_preview_raw_payload_response.py +0 -8
  225. letta_sdk/types/agents/message_search_params.py +0 -38
  226. letta_sdk/types/agents/message_search_response.py +0 -29
  227. letta_sdk/types/agents/source_list_response.py +0 -10
  228. letta_sdk/types/agents/tool_modify_approval_params.py +0 -13
  229. letta_sdk/types/block_list_agents_response.py +0 -10
  230. letta_sdk/types/child_tool_rule.py +0 -21
  231. letta_sdk/types/child_tool_rule_param.py +0 -23
  232. letta_sdk/types/client_side_access_token_create_params.py +0 -32
  233. letta_sdk/types/client_side_access_token_create_response.py +0 -34
  234. letta_sdk/types/client_side_access_token_delete_params.py +0 -11
  235. letta_sdk/types/client_side_access_token_list_params.py +0 -23
  236. letta_sdk/types/client_side_access_token_list_response.py +0 -40
  237. letta_sdk/types/duplicate_file_handling.py +0 -7
  238. letta_sdk/types/embedding_get_total_storage_size_response.py +0 -7
  239. letta_sdk/types/file_processing_status.py +0 -7
  240. letta_sdk/types/folder_get_by_name_response.py +0 -7
  241. letta_sdk/types/folder_list_agents_response.py +0 -8
  242. letta_sdk/types/folder_list_files_response.py +0 -10
  243. letta_sdk/types/folder_list_passages_params.py +0 -34
  244. letta_sdk/types/folder_list_passages_response.py +0 -10
  245. letta_sdk/types/folder_retrieve_metadata_params.py +0 -11
  246. letta_sdk/types/folder_upload_file_params.py +0 -21
  247. letta_sdk/types/identity_list_agents_response.py +0 -10
  248. letta_sdk/types/identity_list_blocks_response.py +0 -10
  249. letta_sdk/types/internal_template_create_agent_params.py +0 -217
  250. letta_sdk/types/internal_template_create_block_params.py +0 -54
  251. letta_sdk/types/internal_template_create_group_params.py +0 -49
  252. letta_sdk/types/job_list_active_params.py +0 -28
  253. letta_sdk/types/job_list_active_response.py +0 -10
  254. letta_sdk/types/job_list_params.py +0 -31
  255. letta_sdk/types/messages/__init__.py +0 -10
  256. letta_sdk/types/messages/batch_job.py +0 -60
  257. letta_sdk/types/model_list_embedding_response.py +0 -10
  258. letta_sdk/types/organization_sources_stats.py +0 -49
  259. letta_sdk/types/passage.py +0 -56
  260. letta_sdk/types/project_list_params.py +0 -16
  261. letta_sdk/types/project_list_response.py +0 -23
  262. letta_sdk/types/provider.py +0 -42
  263. letta_sdk/types/provider_check_params.py +0 -30
  264. letta_sdk/types/provider_create_params.py +0 -33
  265. letta_sdk/types/provider_list_params.py +0 -42
  266. letta_sdk/types/provider_list_response.py +0 -10
  267. letta_sdk/types/provider_update_params.py +0 -25
  268. letta_sdk/types/run_list_active_params.py +0 -18
  269. letta_sdk/types/run_list_messages_response.py +0 -10
  270. letta_sdk/types/run_list_steps_response.py +0 -10
  271. letta_sdk/types/source_count_response.py +0 -7
  272. letta_sdk/types/source_create_params.py +0 -33
  273. letta_sdk/types/source_get_agents_response.py +0 -8
  274. letta_sdk/types/source_get_by_name_response.py +0 -7
  275. letta_sdk/types/source_get_metadata_params.py +0 -11
  276. letta_sdk/types/source_list_passages_params.py +0 -19
  277. letta_sdk/types/source_list_passages_response.py +0 -10
  278. letta_sdk/types/source_list_response.py +0 -10
  279. letta_sdk/types/source_update_params.py +0 -27
  280. letta_sdk/types/sources/__init__.py +0 -7
  281. letta_sdk/types/sources/file_list_params.py +0 -26
  282. letta_sdk/types/sources/file_list_response.py +0 -10
  283. letta_sdk/types/sources/file_retrieve_params.py +0 -14
  284. letta_sdk/types/step_list_messages_response.py +0 -34
  285. letta_sdk/types/template_create_agents_response.py +0 -12
  286. letta_sdk/types/template_create_params.py +0 -40
  287. letta_sdk/types/template_create_response.py +0 -29
  288. letta_sdk/types/template_delete_response.py +0 -9
  289. letta_sdk/types/template_fork_params.py +0 -17
  290. letta_sdk/types/template_fork_response.py +0 -29
  291. letta_sdk/types/template_get_snapshot_response.py +0 -258
  292. letta_sdk/types/template_list_params.py +0 -34
  293. letta_sdk/types/template_list_response.py +0 -35
  294. letta_sdk/types/template_list_versions_params.py +0 -16
  295. letta_sdk/types/template_list_versions_response.py +0 -29
  296. letta_sdk/types/template_rename_params.py +0 -14
  297. letta_sdk/types/template_rename_response.py +0 -9
  298. letta_sdk/types/template_save_version_params.py +0 -32
  299. letta_sdk/types/template_save_version_response.py +0 -29
  300. letta_sdk/types/template_update_description_params.py +0 -14
  301. letta_sdk/types/template_update_description_response.py +0 -9
  302. letta_sdk/types/tool_run_params.py +0 -43
  303. letta_sdk/types/tools/composio/__init__.py +0 -6
  304. letta_sdk/types/tools/composio/app_list_actions_response.py +0 -70
  305. letta_sdk/types/tools/composio/app_list_response.py +0 -103
  306. letta_sdk/types/tools/mcp/__init__.py +0 -21
  307. letta_sdk/types/tools/mcp/mcp_server_type.py +0 -7
  308. letta_sdk/types/tools/mcp/oauth_callback_params.py +0 -22
  309. letta_sdk/types/tools/mcp/server_add_params.py +0 -68
  310. letta_sdk/types/tools/mcp/server_add_response.py +0 -14
  311. letta_sdk/types/tools/mcp/server_connect_params.py +0 -68
  312. letta_sdk/types/tools/mcp/server_delete_response.py +0 -14
  313. letta_sdk/types/tools/mcp/server_list_response.py +0 -14
  314. letta_sdk/types/tools/mcp/server_resync_params.py +0 -12
  315. letta_sdk/types/tools/mcp/server_test_params.py +0 -68
  316. letta_sdk/types/tools/mcp/server_update_params.py +0 -43
  317. letta_sdk/types/tools/mcp/server_update_response.py +0 -12
  318. letta_sdk/types/tools/mcp/servers/__init__.py +0 -6
  319. letta_sdk/types/tools/mcp/servers/tool_execute_params.py +0 -15
  320. letta_sdk/types/tools/mcp/servers/tool_list_response.py +0 -85
  321. letta_sdk/types/tools/mcp/sse_server_config.py +0 -27
  322. letta_sdk/types/tools/mcp/sse_server_config_param.py +0 -29
  323. letta_sdk/types/tools/mcp/stdio_server_config.py +0 -24
  324. letta_sdk/types/tools/mcp/stdio_server_config_param.py +0 -27
  325. letta_sdk/types/tools/mcp/streamable_http_server_config.py +0 -27
  326. letta_sdk/types/tools/mcp/streamable_http_server_config_param.py +0 -29
  327. letta_sdk/types/voice_beta/chat_create_completion_params.py +0 -12
  328. {letta_sdk → letta_client}/_compat.py +0 -0
  329. {letta_sdk → letta_client}/_constants.py +0 -0
  330. {letta_sdk → letta_client}/_files.py +0 -0
  331. {letta_sdk → letta_client}/_models.py +0 -0
  332. {letta_sdk → letta_client}/_qs.py +0 -0
  333. {letta_sdk → letta_client}/_utils/__init__.py +0 -0
  334. {letta_sdk → letta_client}/_utils/_compat.py +0 -0
  335. {letta_sdk → letta_client}/_utils/_datetime_parse.py +0 -0
  336. {letta_sdk → letta_client}/_utils/_proxy.py +0 -0
  337. {letta_sdk → letta_client}/_utils/_reflection.py +0 -0
  338. {letta_sdk → letta_client}/_utils/_streams.py +0 -0
  339. {letta_sdk → letta_client}/_utils/_sync.py +0 -0
  340. {letta_sdk → letta_client}/_utils/_transform.py +0 -0
  341. {letta_sdk → letta_client}/_utils/_typing.py +0 -0
  342. {letta_sdk → letta_client}/_utils/_utils.py +0 -0
  343. {letta_sdk → letta_client}/lib/.keep +0 -0
  344. {letta_sdk → letta_client}/py.typed +0 -0
  345. {letta_sdk/resources/messages → letta_client/resources/batches}/__init__.py +6 -6
  346. {letta_sdk → letta_client}/resources/groups/__init__.py +0 -0
  347. {letta_sdk → letta_client}/resources/tags.py +0 -0
  348. {letta_sdk → letta_client}/types/agent_count_response.py +0 -0
  349. {letta_sdk → letta_client}/types/agent_list_response.py +0 -0
  350. {letta_sdk → letta_client}/types/agents/assistant_message.py +0 -0
  351. {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block_list_response.py +0 -0
  352. {letta_sdk → letta_client}/types/agents/file_close_all_response.py +0 -0
  353. {letta_sdk → letta_client}/types/agents/file_list_response.py +0 -0
  354. {letta_sdk → letta_client}/types/agents/file_open_response.py +0 -0
  355. {letta_sdk → letta_client}/types/agents/hidden_reasoning_message.py +0 -0
  356. {letta_sdk → letta_client}/types/agents/image_content.py +0 -0
  357. {letta_sdk → letta_client}/types/agents/image_content_param.py +0 -0
  358. {letta_sdk → letta_client}/types/agents/job_status.py +0 -0
  359. {letta_sdk → letta_client}/types/agents/job_type.py +0 -0
  360. {letta_sdk → letta_client}/types/agents/letta_message_union.py +0 -0
  361. {letta_sdk → letta_client}/types/agents/letta_user_message_content_union.py +0 -0
  362. {letta_sdk → letta_client}/types/agents/letta_user_message_content_union_param.py +0 -0
  363. {letta_sdk → letta_client}/types/agents/message_cancel_params.py +0 -0
  364. {letta_sdk → letta_client}/types/agents/message_cancel_response.py +0 -0
  365. {letta_sdk → letta_client}/types/agents/message_list_response.py +0 -0
  366. {letta_sdk → letta_client}/types/agents/message_role.py +0 -0
  367. {letta_sdk → letta_client}/types/agents/message_type.py +0 -0
  368. {letta_sdk → letta_client}/types/agents/message_update_response.py +0 -0
  369. {letta_sdk → letta_client}/types/agents/reasoning_content.py +0 -0
  370. {letta_sdk → letta_client}/types/agents/reasoning_content_param.py +0 -0
  371. {letta_sdk → letta_client}/types/agents/reasoning_message.py +0 -0
  372. {letta_sdk → letta_client}/types/agents/redacted_reasoning_content.py +0 -0
  373. {letta_sdk → letta_client}/types/agents/redacted_reasoning_content_param.py +0 -0
  374. {letta_sdk → letta_client}/types/agents/system_message.py +0 -0
  375. {letta_sdk → letta_client}/types/agents/tool_call.py +0 -0
  376. {letta_sdk → letta_client}/types/agents/tool_call_delta.py +0 -0
  377. {letta_sdk → letta_client}/types/agents/tool_list_response.py +0 -0
  378. {letta_sdk → letta_client}/types/agents/tool_return_content.py +0 -0
  379. {letta_sdk → letta_client}/types/agents/tool_return_content_param.py +0 -0
  380. {letta_sdk → letta_client}/types/agents/update_assistant_message_param.py +0 -0
  381. {letta_sdk → letta_client}/types/agents/update_reasoning_message_param.py +0 -0
  382. {letta_sdk → letta_client}/types/agents/update_system_message_param.py +0 -0
  383. {letta_sdk → letta_client}/types/agents/update_user_message_param.py +0 -0
  384. {letta_sdk → letta_client}/types/agents/user_message.py +0 -0
  385. {letta_sdk/types/messages → letta_client/types}/batch_list_params.py +0 -0
  386. {letta_sdk/types/messages → letta_client/types}/batch_list_response.py +0 -0
  387. {letta_sdk → letta_client}/types/block_count_response.py +0 -0
  388. {letta_sdk → letta_client}/types/block_create_params.py +0 -0
  389. {letta_sdk → letta_client}/types/block_list_params.py +0 -0
  390. {letta_sdk → letta_client}/types/block_update_params.py +0 -0
  391. {letta_sdk → letta_client}/types/conditional_tool_rule.py +0 -0
  392. {letta_sdk → letta_client}/types/conditional_tool_rule_param.py +0 -0
  393. {letta_sdk → letta_client}/types/continue_tool_rule.py +0 -0
  394. {letta_sdk → letta_client}/types/continue_tool_rule_param.py +0 -0
  395. {letta_sdk → letta_client}/types/create_block_param.py +0 -0
  396. {letta_sdk → letta_client}/types/dynamic_manager_param.py +0 -0
  397. {letta_sdk → letta_client}/types/embedding_config.py +0 -0
  398. {letta_sdk → letta_client}/types/embedding_config_param.py +0 -0
  399. {letta_sdk → letta_client}/types/folder.py +0 -0
  400. {letta_sdk → letta_client}/types/folder_count_response.py +0 -0
  401. {letta_sdk → letta_client}/types/folder_create_params.py +0 -0
  402. {letta_sdk → letta_client}/types/folder_list_params.py +0 -0
  403. {letta_sdk → letta_client}/types/folder_list_response.py +0 -0
  404. {letta_sdk → letta_client}/types/folder_update_params.py +0 -0
  405. {letta_sdk → letta_client}/types/group.py +0 -0
  406. {letta_sdk → letta_client}/types/group_count_response.py +0 -0
  407. {letta_sdk → letta_client}/types/group_create_params.py +0 -0
  408. {letta_sdk → letta_client}/types/group_list_params.py +0 -0
  409. {letta_sdk → letta_client}/types/group_list_response.py +0 -0
  410. {letta_sdk → letta_client}/types/group_update_params.py +0 -0
  411. {letta_sdk → letta_client}/types/groups/message_list_params.py +0 -0
  412. {letta_sdk → letta_client}/types/groups/message_list_response.py +0 -0
  413. {letta_sdk → letta_client}/types/groups/message_update_response.py +0 -0
  414. {letta_sdk → letta_client}/types/identity.py +0 -0
  415. {letta_sdk → letta_client}/types/identity_count_response.py +0 -0
  416. {letta_sdk → letta_client}/types/identity_create_params.py +0 -0
  417. {letta_sdk → letta_client}/types/identity_list_params.py +0 -0
  418. {letta_sdk → letta_client}/types/identity_list_response.py +0 -0
  419. {letta_sdk → letta_client}/types/identity_property.py +0 -0
  420. {letta_sdk → letta_client}/types/identity_property_param.py +0 -0
  421. {letta_sdk → letta_client}/types/identity_type.py +0 -0
  422. {letta_sdk → letta_client}/types/identity_upsert_params.py +0 -0
  423. {letta_sdk → letta_client}/types/json_object_response_format.py +0 -0
  424. {letta_sdk → letta_client}/types/json_object_response_format_param.py +0 -0
  425. {letta_sdk → letta_client}/types/json_schema_response_format.py +0 -0
  426. {letta_sdk → letta_client}/types/json_schema_response_format_param.py +0 -0
  427. {letta_sdk → letta_client}/types/letta_message_content_union_param.py +0 -0
  428. {letta_sdk → letta_client}/types/manager_type.py +0 -0
  429. {letta_sdk → letta_client}/types/max_count_per_step_tool_rule.py +0 -0
  430. {letta_sdk → letta_client}/types/max_count_per_step_tool_rule_param.py +0 -0
  431. {letta_sdk → letta_client}/types/message_create_param.py +0 -0
  432. {letta_sdk → letta_client}/types/model_list_params.py +0 -0
  433. {letta_sdk → letta_client}/types/model_list_response.py +0 -0
  434. {letta_sdk → letta_client}/types/npm_requirement.py +0 -0
  435. {letta_sdk → letta_client}/types/npm_requirement_param.py +0 -0
  436. {letta_sdk → letta_client}/types/parent_tool_rule.py +0 -0
  437. {letta_sdk → letta_client}/types/parent_tool_rule_param.py +0 -0
  438. {letta_sdk → letta_client}/types/pip_requirement.py +0 -0
  439. {letta_sdk → letta_client}/types/pip_requirement_param.py +0 -0
  440. {letta_sdk → letta_client}/types/provider_category.py +0 -0
  441. {letta_sdk → letta_client}/types/provider_trace.py +0 -0
  442. {letta_sdk → letta_client}/types/provider_type.py +0 -0
  443. {letta_sdk → letta_client}/types/required_before_exit_tool_rule.py +0 -0
  444. {letta_sdk → letta_client}/types/required_before_exit_tool_rule_param.py +0 -0
  445. {letta_sdk → letta_client}/types/requires_approval_tool_rule.py +0 -0
  446. {letta_sdk → letta_client}/types/requires_approval_tool_rule_param.py +0 -0
  447. {letta_sdk → letta_client}/types/round_robin_manager_param.py +0 -0
  448. {letta_sdk → letta_client}/types/run_list_response.py +0 -0
  449. {letta_sdk → letta_client}/types/sleeptime_manager_param.py +0 -0
  450. {letta_sdk → letta_client}/types/step_list_params.py +0 -0
  451. {letta_sdk → letta_client}/types/step_list_response.py +0 -0
  452. {letta_sdk → letta_client}/types/stop_reason_type.py +0 -0
  453. {letta_sdk → letta_client}/types/supervisor_manager_param.py +0 -0
  454. {letta_sdk → letta_client}/types/tag_list_params.py +0 -0
  455. {letta_sdk → letta_client}/types/tag_list_response.py +0 -0
  456. {letta_sdk → letta_client}/types/terminal_tool_rule.py +0 -0
  457. {letta_sdk → letta_client}/types/terminal_tool_rule_param.py +0 -0
  458. {letta_sdk → letta_client}/types/text_response_format.py +0 -0
  459. {letta_sdk → letta_client}/types/text_response_format_param.py +0 -0
  460. {letta_sdk → letta_client}/types/tool_count_params.py +0 -0
  461. {letta_sdk → letta_client}/types/tool_count_response.py +0 -0
  462. {letta_sdk → letta_client}/types/tool_list_params.py +0 -0
  463. {letta_sdk → letta_client}/types/tool_list_response.py +0 -0
  464. {letta_sdk → letta_client}/types/tool_type.py +1 -1
  465. {letta_sdk → letta_client}/types/vector_db_provider.py +0 -0
  466. {letta_sdk → letta_client}/types/voice_sleeptime_manager_param.py +0 -0
  467. {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/WHEEL +0 -0
@@ -1,1371 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- import typing_extensions
6
- from typing import Dict, Mapping, Optional, cast
7
-
8
- import httpx
9
-
10
- from .files import (
11
- FilesResource,
12
- AsyncFilesResource,
13
- FilesResourceWithRawResponse,
14
- AsyncFilesResourceWithRawResponse,
15
- FilesResourceWithStreamingResponse,
16
- AsyncFilesResourceWithStreamingResponse,
17
- )
18
- from ...types import (
19
- DuplicateFileHandling,
20
- source_create_params,
21
- source_update_params,
22
- source_upload_file_params,
23
- source_get_metadata_params,
24
- source_list_passages_params,
25
- )
26
- from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, omit, not_given
27
- from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
28
- from ..._compat import cached_property
29
- from ..._resource import SyncAPIResource, AsyncAPIResource
30
- from ..._response import (
31
- to_raw_response_wrapper,
32
- to_streamed_response_wrapper,
33
- async_to_raw_response_wrapper,
34
- async_to_streamed_response_wrapper,
35
- )
36
- from ..._base_client import make_request_options
37
- from ...types.source import Source
38
- from ...types.file_metadata import FileMetadata
39
- from ...types.source_list_response import SourceListResponse
40
- from ...types.source_count_response import SourceCountResponse
41
- from ...types.embedding_config_param import EmbeddingConfigParam
42
- from ...types.duplicate_file_handling import DuplicateFileHandling
43
- from ...types.organization_sources_stats import OrganizationSourcesStats
44
- from ...types.source_get_agents_response import SourceGetAgentsResponse
45
- from ...types.source_list_passages_response import SourceListPassagesResponse
46
-
47
- __all__ = ["SourcesResource", "AsyncSourcesResource"]
48
-
49
-
50
- class SourcesResource(SyncAPIResource):
51
- @cached_property
52
- def files(self) -> FilesResource:
53
- return FilesResource(self._client)
54
-
55
- @cached_property
56
- def with_raw_response(self) -> SourcesResourceWithRawResponse:
57
- """
58
- This property can be used as a prefix for any HTTP method call to return
59
- the raw response object instead of the parsed content.
60
-
61
- For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
62
- """
63
- return SourcesResourceWithRawResponse(self)
64
-
65
- @cached_property
66
- def with_streaming_response(self) -> SourcesResourceWithStreamingResponse:
67
- """
68
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
69
-
70
- For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
71
- """
72
- return SourcesResourceWithStreamingResponse(self)
73
-
74
- @typing_extensions.deprecated("deprecated")
75
- def create(
76
- self,
77
- *,
78
- name: str,
79
- description: Optional[str] | Omit = omit,
80
- embedding: Optional[str] | Omit = omit,
81
- embedding_chunk_size: Optional[int] | Omit = omit,
82
- embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
83
- instructions: Optional[str] | Omit = omit,
84
- metadata: Optional[Dict[str, object]] | Omit = omit,
85
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
86
- # The extra values given here take precedence over values defined on the client or passed to this method.
87
- extra_headers: Headers | None = None,
88
- extra_query: Query | None = None,
89
- extra_body: Body | None = None,
90
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
91
- ) -> Source:
92
- """
93
- Create a new data source.
94
-
95
- Args:
96
- name: The name of the source.
97
-
98
- description: The description of the source.
99
-
100
- embedding: The handle for the embedding config used by the source.
101
-
102
- embedding_chunk_size: The chunk size of the embedding.
103
-
104
- embedding_config: Configuration for embedding model connection and processing parameters.
105
-
106
- instructions: Instructions for how to use the source.
107
-
108
- metadata: Metadata associated with the source.
109
-
110
- extra_headers: Send extra headers
111
-
112
- extra_query: Add additional query parameters to the request
113
-
114
- extra_body: Add additional JSON properties to the request
115
-
116
- timeout: Override the client-level default timeout for this request, in seconds
117
- """
118
- return self._post(
119
- "/v1/sources/",
120
- body=maybe_transform(
121
- {
122
- "name": name,
123
- "description": description,
124
- "embedding": embedding,
125
- "embedding_chunk_size": embedding_chunk_size,
126
- "embedding_config": embedding_config,
127
- "instructions": instructions,
128
- "metadata": metadata,
129
- },
130
- source_create_params.SourceCreateParams,
131
- ),
132
- options=make_request_options(
133
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
134
- ),
135
- cast_to=Source,
136
- )
137
-
138
- @typing_extensions.deprecated("deprecated")
139
- def retrieve(
140
- self,
141
- source_id: str,
142
- *,
143
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
144
- # The extra values given here take precedence over values defined on the client or passed to this method.
145
- extra_headers: Headers | None = None,
146
- extra_query: Query | None = None,
147
- extra_body: Body | None = None,
148
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
149
- ) -> Source:
150
- """
151
- Get all sources
152
-
153
- Args:
154
- extra_headers: Send extra headers
155
-
156
- extra_query: Add additional query parameters to the request
157
-
158
- extra_body: Add additional JSON properties to the request
159
-
160
- timeout: Override the client-level default timeout for this request, in seconds
161
- """
162
- if not source_id:
163
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
164
- return self._get(
165
- f"/v1/sources/{source_id}",
166
- options=make_request_options(
167
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
168
- ),
169
- cast_to=Source,
170
- )
171
-
172
- @typing_extensions.deprecated("deprecated")
173
- def update(
174
- self,
175
- source_id: str,
176
- *,
177
- description: Optional[str] | Omit = omit,
178
- embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
179
- instructions: Optional[str] | Omit = omit,
180
- metadata: Optional[Dict[str, object]] | Omit = omit,
181
- name: Optional[str] | Omit = omit,
182
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
183
- # The extra values given here take precedence over values defined on the client or passed to this method.
184
- extra_headers: Headers | None = None,
185
- extra_query: Query | None = None,
186
- extra_body: Body | None = None,
187
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
188
- ) -> Source:
189
- """
190
- Update the name or documentation of an existing data source.
191
-
192
- Args:
193
- description: The description of the source.
194
-
195
- embedding_config: Configuration for embedding model connection and processing parameters.
196
-
197
- instructions: Instructions for how to use the source.
198
-
199
- metadata: Metadata associated with the source.
200
-
201
- name: The name of the source.
202
-
203
- extra_headers: Send extra headers
204
-
205
- extra_query: Add additional query parameters to the request
206
-
207
- extra_body: Add additional JSON properties to the request
208
-
209
- timeout: Override the client-level default timeout for this request, in seconds
210
- """
211
- if not source_id:
212
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
213
- return self._patch(
214
- f"/v1/sources/{source_id}",
215
- body=maybe_transform(
216
- {
217
- "description": description,
218
- "embedding_config": embedding_config,
219
- "instructions": instructions,
220
- "metadata": metadata,
221
- "name": name,
222
- },
223
- source_update_params.SourceUpdateParams,
224
- ),
225
- options=make_request_options(
226
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
227
- ),
228
- cast_to=Source,
229
- )
230
-
231
- @typing_extensions.deprecated("deprecated")
232
- def list(
233
- self,
234
- *,
235
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
236
- # The extra values given here take precedence over values defined on the client or passed to this method.
237
- extra_headers: Headers | None = None,
238
- extra_query: Query | None = None,
239
- extra_body: Body | None = None,
240
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
241
- ) -> SourceListResponse:
242
- """List all data sources created by a user."""
243
- return self._get(
244
- "/v1/sources/",
245
- options=make_request_options(
246
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
247
- ),
248
- cast_to=SourceListResponse,
249
- )
250
-
251
- @typing_extensions.deprecated("deprecated")
252
- def delete(
253
- self,
254
- source_id: str,
255
- *,
256
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
257
- # The extra values given here take precedence over values defined on the client or passed to this method.
258
- extra_headers: Headers | None = None,
259
- extra_query: Query | None = None,
260
- extra_body: Body | None = None,
261
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
262
- ) -> object:
263
- """
264
- Delete a data source.
265
-
266
- Args:
267
- extra_headers: Send extra headers
268
-
269
- extra_query: Add additional query parameters to the request
270
-
271
- extra_body: Add additional JSON properties to the request
272
-
273
- timeout: Override the client-level default timeout for this request, in seconds
274
- """
275
- if not source_id:
276
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
277
- return self._delete(
278
- f"/v1/sources/{source_id}",
279
- options=make_request_options(
280
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
281
- ),
282
- cast_to=object,
283
- )
284
-
285
- @typing_extensions.deprecated("deprecated")
286
- def count(
287
- self,
288
- *,
289
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
290
- # The extra values given here take precedence over values defined on the client or passed to this method.
291
- extra_headers: Headers | None = None,
292
- extra_query: Query | None = None,
293
- extra_body: Body | None = None,
294
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
295
- ) -> SourceCountResponse:
296
- """Count all data sources created by a user."""
297
- return self._get(
298
- "/v1/sources/count",
299
- options=make_request_options(
300
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
301
- ),
302
- cast_to=int,
303
- )
304
-
305
- @typing_extensions.deprecated("deprecated")
306
- def delete_file(
307
- self,
308
- file_id: str,
309
- *,
310
- source_id: str,
311
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
312
- # The extra values given here take precedence over values defined on the client or passed to this method.
313
- extra_headers: Headers | None = None,
314
- extra_query: Query | None = None,
315
- extra_body: Body | None = None,
316
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
317
- ) -> None:
318
- """
319
- Delete a data source.
320
-
321
- Args:
322
- extra_headers: Send extra headers
323
-
324
- extra_query: Add additional query parameters to the request
325
-
326
- extra_body: Add additional JSON properties to the request
327
-
328
- timeout: Override the client-level default timeout for this request, in seconds
329
- """
330
- if not source_id:
331
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
332
- if not file_id:
333
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
334
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
335
- return self._delete(
336
- f"/v1/sources/{source_id}/{file_id}",
337
- options=make_request_options(
338
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
339
- ),
340
- cast_to=NoneType,
341
- )
342
-
343
- @typing_extensions.deprecated("deprecated")
344
- def get_agents(
345
- self,
346
- source_id: str,
347
- *,
348
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349
- # The extra values given here take precedence over values defined on the client or passed to this method.
350
- extra_headers: Headers | None = None,
351
- extra_query: Query | None = None,
352
- extra_body: Body | None = None,
353
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
354
- ) -> SourceGetAgentsResponse:
355
- """
356
- Get all agent IDs that have the specified source attached.
357
-
358
- Args:
359
- extra_headers: Send extra headers
360
-
361
- extra_query: Add additional query parameters to the request
362
-
363
- extra_body: Add additional JSON properties to the request
364
-
365
- timeout: Override the client-level default timeout for this request, in seconds
366
- """
367
- if not source_id:
368
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
369
- return self._get(
370
- f"/v1/sources/{source_id}/agents",
371
- options=make_request_options(
372
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
373
- ),
374
- cast_to=SourceGetAgentsResponse,
375
- )
376
-
377
- @typing_extensions.deprecated("deprecated")
378
- def get_by_name(
379
- self,
380
- source_name: str,
381
- *,
382
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
383
- # The extra values given here take precedence over values defined on the client or passed to this method.
384
- extra_headers: Headers | None = None,
385
- extra_query: Query | None = None,
386
- extra_body: Body | None = None,
387
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
388
- ) -> str:
389
- """
390
- Get a source by name
391
-
392
- Args:
393
- extra_headers: Send extra headers
394
-
395
- extra_query: Add additional query parameters to the request
396
-
397
- extra_body: Add additional JSON properties to the request
398
-
399
- timeout: Override the client-level default timeout for this request, in seconds
400
- """
401
- if not source_name:
402
- raise ValueError(f"Expected a non-empty value for `source_name` but received {source_name!r}")
403
- return self._get(
404
- f"/v1/sources/name/{source_name}",
405
- options=make_request_options(
406
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
407
- ),
408
- cast_to=str,
409
- )
410
-
411
- @typing_extensions.deprecated("deprecated")
412
- def get_metadata(
413
- self,
414
- *,
415
- include_detailed_per_source_metadata: bool | Omit = omit,
416
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
417
- # The extra values given here take precedence over values defined on the client or passed to this method.
418
- extra_headers: Headers | None = None,
419
- extra_query: Query | None = None,
420
- extra_body: Body | None = None,
421
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
422
- ) -> OrganizationSourcesStats:
423
- """
424
- Get aggregated metadata for all sources in an organization.
425
-
426
- Returns structured metadata including:
427
-
428
- - Total number of sources
429
- - Total number of files across all sources
430
- - Total size of all files
431
- - Per-source breakdown with file details (file_name, file_size per file) if
432
- include_detailed_per_source_metadata is True
433
-
434
- Args:
435
- extra_headers: Send extra headers
436
-
437
- extra_query: Add additional query parameters to the request
438
-
439
- extra_body: Add additional JSON properties to the request
440
-
441
- timeout: Override the client-level default timeout for this request, in seconds
442
- """
443
- return self._get(
444
- "/v1/sources/metadata",
445
- options=make_request_options(
446
- extra_headers=extra_headers,
447
- extra_query=extra_query,
448
- extra_body=extra_body,
449
- timeout=timeout,
450
- query=maybe_transform(
451
- {"include_detailed_per_source_metadata": include_detailed_per_source_metadata},
452
- source_get_metadata_params.SourceGetMetadataParams,
453
- ),
454
- ),
455
- cast_to=OrganizationSourcesStats,
456
- )
457
-
458
- @typing_extensions.deprecated("deprecated")
459
- def list_passages(
460
- self,
461
- source_id: str,
462
- *,
463
- after: Optional[str] | Omit = omit,
464
- before: Optional[str] | Omit = omit,
465
- limit: int | Omit = omit,
466
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
467
- # The extra values given here take precedence over values defined on the client or passed to this method.
468
- extra_headers: Headers | None = None,
469
- extra_query: Query | None = None,
470
- extra_body: Body | None = None,
471
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
472
- ) -> SourceListPassagesResponse:
473
- """
474
- List all passages associated with a data source.
475
-
476
- Args:
477
- after: Message after which to retrieve the returned messages.
478
-
479
- before: Message before which to retrieve the returned messages.
480
-
481
- limit: Maximum number of messages to retrieve.
482
-
483
- extra_headers: Send extra headers
484
-
485
- extra_query: Add additional query parameters to the request
486
-
487
- extra_body: Add additional JSON properties to the request
488
-
489
- timeout: Override the client-level default timeout for this request, in seconds
490
- """
491
- if not source_id:
492
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
493
- return self._get(
494
- f"/v1/sources/{source_id}/passages",
495
- options=make_request_options(
496
- extra_headers=extra_headers,
497
- extra_query=extra_query,
498
- extra_body=extra_body,
499
- timeout=timeout,
500
- query=maybe_transform(
501
- {
502
- "after": after,
503
- "before": before,
504
- "limit": limit,
505
- },
506
- source_list_passages_params.SourceListPassagesParams,
507
- ),
508
- ),
509
- cast_to=SourceListPassagesResponse,
510
- )
511
-
512
- @typing_extensions.deprecated("deprecated")
513
- def upload_file(
514
- self,
515
- source_id: str,
516
- *,
517
- file: FileTypes,
518
- duplicate_handling: DuplicateFileHandling | Omit = omit,
519
- name: Optional[str] | Omit = omit,
520
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
521
- # The extra values given here take precedence over values defined on the client or passed to this method.
522
- extra_headers: Headers | None = None,
523
- extra_query: Query | None = None,
524
- extra_body: Body | None = None,
525
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
526
- ) -> FileMetadata:
527
- """
528
- Upload a file to a data source.
529
-
530
- Args:
531
- duplicate_handling: How to handle duplicate filenames
532
-
533
- name: Optional custom name to override the uploaded file's name
534
-
535
- extra_headers: Send extra headers
536
-
537
- extra_query: Add additional query parameters to the request
538
-
539
- extra_body: Add additional JSON properties to the request
540
-
541
- timeout: Override the client-level default timeout for this request, in seconds
542
- """
543
- if not source_id:
544
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
545
- body = deepcopy_minimal({"file": file})
546
- files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
547
- # It should be noted that the actual Content-Type header that will be
548
- # sent to the server will contain a `boundary` parameter, e.g.
549
- # multipart/form-data; boundary=---abc--
550
- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
551
- return self._post(
552
- f"/v1/sources/{source_id}/upload",
553
- body=maybe_transform(body, source_upload_file_params.SourceUploadFileParams),
554
- files=files,
555
- options=make_request_options(
556
- extra_headers=extra_headers,
557
- extra_query=extra_query,
558
- extra_body=extra_body,
559
- timeout=timeout,
560
- query=maybe_transform(
561
- {
562
- "duplicate_handling": duplicate_handling,
563
- "name": name,
564
- },
565
- source_upload_file_params.SourceUploadFileParams,
566
- ),
567
- ),
568
- cast_to=FileMetadata,
569
- )
570
-
571
-
572
- class AsyncSourcesResource(AsyncAPIResource):
573
- @cached_property
574
- def files(self) -> AsyncFilesResource:
575
- return AsyncFilesResource(self._client)
576
-
577
- @cached_property
578
- def with_raw_response(self) -> AsyncSourcesResourceWithRawResponse:
579
- """
580
- This property can be used as a prefix for any HTTP method call to return
581
- the raw response object instead of the parsed content.
582
-
583
- For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
584
- """
585
- return AsyncSourcesResourceWithRawResponse(self)
586
-
587
- @cached_property
588
- def with_streaming_response(self) -> AsyncSourcesResourceWithStreamingResponse:
589
- """
590
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
591
-
592
- For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
593
- """
594
- return AsyncSourcesResourceWithStreamingResponse(self)
595
-
596
- @typing_extensions.deprecated("deprecated")
597
- async def create(
598
- self,
599
- *,
600
- name: str,
601
- description: Optional[str] | Omit = omit,
602
- embedding: Optional[str] | Omit = omit,
603
- embedding_chunk_size: Optional[int] | Omit = omit,
604
- embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
605
- instructions: Optional[str] | Omit = omit,
606
- metadata: Optional[Dict[str, object]] | Omit = omit,
607
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
608
- # The extra values given here take precedence over values defined on the client or passed to this method.
609
- extra_headers: Headers | None = None,
610
- extra_query: Query | None = None,
611
- extra_body: Body | None = None,
612
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
613
- ) -> Source:
614
- """
615
- Create a new data source.
616
-
617
- Args:
618
- name: The name of the source.
619
-
620
- description: The description of the source.
621
-
622
- embedding: The handle for the embedding config used by the source.
623
-
624
- embedding_chunk_size: The chunk size of the embedding.
625
-
626
- embedding_config: Configuration for embedding model connection and processing parameters.
627
-
628
- instructions: Instructions for how to use the source.
629
-
630
- metadata: Metadata associated with the source.
631
-
632
- extra_headers: Send extra headers
633
-
634
- extra_query: Add additional query parameters to the request
635
-
636
- extra_body: Add additional JSON properties to the request
637
-
638
- timeout: Override the client-level default timeout for this request, in seconds
639
- """
640
- return await self._post(
641
- "/v1/sources/",
642
- body=await async_maybe_transform(
643
- {
644
- "name": name,
645
- "description": description,
646
- "embedding": embedding,
647
- "embedding_chunk_size": embedding_chunk_size,
648
- "embedding_config": embedding_config,
649
- "instructions": instructions,
650
- "metadata": metadata,
651
- },
652
- source_create_params.SourceCreateParams,
653
- ),
654
- options=make_request_options(
655
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
656
- ),
657
- cast_to=Source,
658
- )
659
-
660
- @typing_extensions.deprecated("deprecated")
661
- async def retrieve(
662
- self,
663
- source_id: str,
664
- *,
665
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
666
- # The extra values given here take precedence over values defined on the client or passed to this method.
667
- extra_headers: Headers | None = None,
668
- extra_query: Query | None = None,
669
- extra_body: Body | None = None,
670
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
671
- ) -> Source:
672
- """
673
- Get all sources
674
-
675
- Args:
676
- extra_headers: Send extra headers
677
-
678
- extra_query: Add additional query parameters to the request
679
-
680
- extra_body: Add additional JSON properties to the request
681
-
682
- timeout: Override the client-level default timeout for this request, in seconds
683
- """
684
- if not source_id:
685
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
686
- return await self._get(
687
- f"/v1/sources/{source_id}",
688
- options=make_request_options(
689
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
690
- ),
691
- cast_to=Source,
692
- )
693
-
694
- @typing_extensions.deprecated("deprecated")
695
- async def update(
696
- self,
697
- source_id: str,
698
- *,
699
- description: Optional[str] | Omit = omit,
700
- embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
701
- instructions: Optional[str] | Omit = omit,
702
- metadata: Optional[Dict[str, object]] | Omit = omit,
703
- name: Optional[str] | Omit = omit,
704
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
705
- # The extra values given here take precedence over values defined on the client or passed to this method.
706
- extra_headers: Headers | None = None,
707
- extra_query: Query | None = None,
708
- extra_body: Body | None = None,
709
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
710
- ) -> Source:
711
- """
712
- Update the name or documentation of an existing data source.
713
-
714
- Args:
715
- description: The description of the source.
716
-
717
- embedding_config: Configuration for embedding model connection and processing parameters.
718
-
719
- instructions: Instructions for how to use the source.
720
-
721
- metadata: Metadata associated with the source.
722
-
723
- name: The name of the source.
724
-
725
- extra_headers: Send extra headers
726
-
727
- extra_query: Add additional query parameters to the request
728
-
729
- extra_body: Add additional JSON properties to the request
730
-
731
- timeout: Override the client-level default timeout for this request, in seconds
732
- """
733
- if not source_id:
734
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
735
- return await self._patch(
736
- f"/v1/sources/{source_id}",
737
- body=await async_maybe_transform(
738
- {
739
- "description": description,
740
- "embedding_config": embedding_config,
741
- "instructions": instructions,
742
- "metadata": metadata,
743
- "name": name,
744
- },
745
- source_update_params.SourceUpdateParams,
746
- ),
747
- options=make_request_options(
748
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
749
- ),
750
- cast_to=Source,
751
- )
752
-
753
- @typing_extensions.deprecated("deprecated")
754
- async def list(
755
- self,
756
- *,
757
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
758
- # The extra values given here take precedence over values defined on the client or passed to this method.
759
- extra_headers: Headers | None = None,
760
- extra_query: Query | None = None,
761
- extra_body: Body | None = None,
762
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
763
- ) -> SourceListResponse:
764
- """List all data sources created by a user."""
765
- return await self._get(
766
- "/v1/sources/",
767
- options=make_request_options(
768
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
769
- ),
770
- cast_to=SourceListResponse,
771
- )
772
-
773
- @typing_extensions.deprecated("deprecated")
774
- async def delete(
775
- self,
776
- source_id: str,
777
- *,
778
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
779
- # The extra values given here take precedence over values defined on the client or passed to this method.
780
- extra_headers: Headers | None = None,
781
- extra_query: Query | None = None,
782
- extra_body: Body | None = None,
783
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
784
- ) -> object:
785
- """
786
- Delete a data source.
787
-
788
- Args:
789
- extra_headers: Send extra headers
790
-
791
- extra_query: Add additional query parameters to the request
792
-
793
- extra_body: Add additional JSON properties to the request
794
-
795
- timeout: Override the client-level default timeout for this request, in seconds
796
- """
797
- if not source_id:
798
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
799
- return await self._delete(
800
- f"/v1/sources/{source_id}",
801
- options=make_request_options(
802
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
803
- ),
804
- cast_to=object,
805
- )
806
-
807
- @typing_extensions.deprecated("deprecated")
808
- async def count(
809
- self,
810
- *,
811
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
812
- # The extra values given here take precedence over values defined on the client or passed to this method.
813
- extra_headers: Headers | None = None,
814
- extra_query: Query | None = None,
815
- extra_body: Body | None = None,
816
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
817
- ) -> SourceCountResponse:
818
- """Count all data sources created by a user."""
819
- return await self._get(
820
- "/v1/sources/count",
821
- options=make_request_options(
822
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
823
- ),
824
- cast_to=int,
825
- )
826
-
827
- @typing_extensions.deprecated("deprecated")
828
- async def delete_file(
829
- self,
830
- file_id: str,
831
- *,
832
- source_id: str,
833
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
834
- # The extra values given here take precedence over values defined on the client or passed to this method.
835
- extra_headers: Headers | None = None,
836
- extra_query: Query | None = None,
837
- extra_body: Body | None = None,
838
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
839
- ) -> None:
840
- """
841
- Delete a data source.
842
-
843
- Args:
844
- extra_headers: Send extra headers
845
-
846
- extra_query: Add additional query parameters to the request
847
-
848
- extra_body: Add additional JSON properties to the request
849
-
850
- timeout: Override the client-level default timeout for this request, in seconds
851
- """
852
- if not source_id:
853
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
854
- if not file_id:
855
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
856
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
857
- return await self._delete(
858
- f"/v1/sources/{source_id}/{file_id}",
859
- options=make_request_options(
860
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
861
- ),
862
- cast_to=NoneType,
863
- )
864
-
865
- @typing_extensions.deprecated("deprecated")
866
- async def get_agents(
867
- self,
868
- source_id: str,
869
- *,
870
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
871
- # The extra values given here take precedence over values defined on the client or passed to this method.
872
- extra_headers: Headers | None = None,
873
- extra_query: Query | None = None,
874
- extra_body: Body | None = None,
875
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
876
- ) -> SourceGetAgentsResponse:
877
- """
878
- Get all agent IDs that have the specified source attached.
879
-
880
- Args:
881
- extra_headers: Send extra headers
882
-
883
- extra_query: Add additional query parameters to the request
884
-
885
- extra_body: Add additional JSON properties to the request
886
-
887
- timeout: Override the client-level default timeout for this request, in seconds
888
- """
889
- if not source_id:
890
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
891
- return await self._get(
892
- f"/v1/sources/{source_id}/agents",
893
- options=make_request_options(
894
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
895
- ),
896
- cast_to=SourceGetAgentsResponse,
897
- )
898
-
899
- @typing_extensions.deprecated("deprecated")
900
- async def get_by_name(
901
- self,
902
- source_name: str,
903
- *,
904
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
905
- # The extra values given here take precedence over values defined on the client or passed to this method.
906
- extra_headers: Headers | None = None,
907
- extra_query: Query | None = None,
908
- extra_body: Body | None = None,
909
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
910
- ) -> str:
911
- """
912
- Get a source by name
913
-
914
- Args:
915
- extra_headers: Send extra headers
916
-
917
- extra_query: Add additional query parameters to the request
918
-
919
- extra_body: Add additional JSON properties to the request
920
-
921
- timeout: Override the client-level default timeout for this request, in seconds
922
- """
923
- if not source_name:
924
- raise ValueError(f"Expected a non-empty value for `source_name` but received {source_name!r}")
925
- return await self._get(
926
- f"/v1/sources/name/{source_name}",
927
- options=make_request_options(
928
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
929
- ),
930
- cast_to=str,
931
- )
932
-
933
- @typing_extensions.deprecated("deprecated")
934
- async def get_metadata(
935
- self,
936
- *,
937
- include_detailed_per_source_metadata: bool | Omit = omit,
938
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
939
- # The extra values given here take precedence over values defined on the client or passed to this method.
940
- extra_headers: Headers | None = None,
941
- extra_query: Query | None = None,
942
- extra_body: Body | None = None,
943
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
944
- ) -> OrganizationSourcesStats:
945
- """
946
- Get aggregated metadata for all sources in an organization.
947
-
948
- Returns structured metadata including:
949
-
950
- - Total number of sources
951
- - Total number of files across all sources
952
- - Total size of all files
953
- - Per-source breakdown with file details (file_name, file_size per file) if
954
- include_detailed_per_source_metadata is True
955
-
956
- Args:
957
- extra_headers: Send extra headers
958
-
959
- extra_query: Add additional query parameters to the request
960
-
961
- extra_body: Add additional JSON properties to the request
962
-
963
- timeout: Override the client-level default timeout for this request, in seconds
964
- """
965
- return await self._get(
966
- "/v1/sources/metadata",
967
- options=make_request_options(
968
- extra_headers=extra_headers,
969
- extra_query=extra_query,
970
- extra_body=extra_body,
971
- timeout=timeout,
972
- query=await async_maybe_transform(
973
- {"include_detailed_per_source_metadata": include_detailed_per_source_metadata},
974
- source_get_metadata_params.SourceGetMetadataParams,
975
- ),
976
- ),
977
- cast_to=OrganizationSourcesStats,
978
- )
979
-
980
- @typing_extensions.deprecated("deprecated")
981
- async def list_passages(
982
- self,
983
- source_id: str,
984
- *,
985
- after: Optional[str] | Omit = omit,
986
- before: Optional[str] | Omit = omit,
987
- limit: int | Omit = omit,
988
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
989
- # The extra values given here take precedence over values defined on the client or passed to this method.
990
- extra_headers: Headers | None = None,
991
- extra_query: Query | None = None,
992
- extra_body: Body | None = None,
993
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
994
- ) -> SourceListPassagesResponse:
995
- """
996
- List all passages associated with a data source.
997
-
998
- Args:
999
- after: Message after which to retrieve the returned messages.
1000
-
1001
- before: Message before which to retrieve the returned messages.
1002
-
1003
- limit: Maximum number of messages to retrieve.
1004
-
1005
- extra_headers: Send extra headers
1006
-
1007
- extra_query: Add additional query parameters to the request
1008
-
1009
- extra_body: Add additional JSON properties to the request
1010
-
1011
- timeout: Override the client-level default timeout for this request, in seconds
1012
- """
1013
- if not source_id:
1014
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
1015
- return await self._get(
1016
- f"/v1/sources/{source_id}/passages",
1017
- options=make_request_options(
1018
- extra_headers=extra_headers,
1019
- extra_query=extra_query,
1020
- extra_body=extra_body,
1021
- timeout=timeout,
1022
- query=await async_maybe_transform(
1023
- {
1024
- "after": after,
1025
- "before": before,
1026
- "limit": limit,
1027
- },
1028
- source_list_passages_params.SourceListPassagesParams,
1029
- ),
1030
- ),
1031
- cast_to=SourceListPassagesResponse,
1032
- )
1033
-
1034
- @typing_extensions.deprecated("deprecated")
1035
- async def upload_file(
1036
- self,
1037
- source_id: str,
1038
- *,
1039
- file: FileTypes,
1040
- duplicate_handling: DuplicateFileHandling | Omit = omit,
1041
- name: Optional[str] | Omit = omit,
1042
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1043
- # The extra values given here take precedence over values defined on the client or passed to this method.
1044
- extra_headers: Headers | None = None,
1045
- extra_query: Query | None = None,
1046
- extra_body: Body | None = None,
1047
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
1048
- ) -> FileMetadata:
1049
- """
1050
- Upload a file to a data source.
1051
-
1052
- Args:
1053
- duplicate_handling: How to handle duplicate filenames
1054
-
1055
- name: Optional custom name to override the uploaded file's name
1056
-
1057
- extra_headers: Send extra headers
1058
-
1059
- extra_query: Add additional query parameters to the request
1060
-
1061
- extra_body: Add additional JSON properties to the request
1062
-
1063
- timeout: Override the client-level default timeout for this request, in seconds
1064
- """
1065
- if not source_id:
1066
- raise ValueError(f"Expected a non-empty value for `source_id` but received {source_id!r}")
1067
- body = deepcopy_minimal({"file": file})
1068
- files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
1069
- # It should be noted that the actual Content-Type header that will be
1070
- # sent to the server will contain a `boundary` parameter, e.g.
1071
- # multipart/form-data; boundary=---abc--
1072
- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
1073
- return await self._post(
1074
- f"/v1/sources/{source_id}/upload",
1075
- body=await async_maybe_transform(body, source_upload_file_params.SourceUploadFileParams),
1076
- files=files,
1077
- options=make_request_options(
1078
- extra_headers=extra_headers,
1079
- extra_query=extra_query,
1080
- extra_body=extra_body,
1081
- timeout=timeout,
1082
- query=await async_maybe_transform(
1083
- {
1084
- "duplicate_handling": duplicate_handling,
1085
- "name": name,
1086
- },
1087
- source_upload_file_params.SourceUploadFileParams,
1088
- ),
1089
- ),
1090
- cast_to=FileMetadata,
1091
- )
1092
-
1093
-
1094
- class SourcesResourceWithRawResponse:
1095
- def __init__(self, sources: SourcesResource) -> None:
1096
- self._sources = sources
1097
-
1098
- self.create = ( # pyright: ignore[reportDeprecated]
1099
- to_raw_response_wrapper(
1100
- sources.create, # pyright: ignore[reportDeprecated],
1101
- )
1102
- )
1103
- self.retrieve = ( # pyright: ignore[reportDeprecated]
1104
- to_raw_response_wrapper(
1105
- sources.retrieve, # pyright: ignore[reportDeprecated],
1106
- )
1107
- )
1108
- self.update = ( # pyright: ignore[reportDeprecated]
1109
- to_raw_response_wrapper(
1110
- sources.update, # pyright: ignore[reportDeprecated],
1111
- )
1112
- )
1113
- self.list = ( # pyright: ignore[reportDeprecated]
1114
- to_raw_response_wrapper(
1115
- sources.list, # pyright: ignore[reportDeprecated],
1116
- )
1117
- )
1118
- self.delete = ( # pyright: ignore[reportDeprecated]
1119
- to_raw_response_wrapper(
1120
- sources.delete, # pyright: ignore[reportDeprecated],
1121
- )
1122
- )
1123
- self.count = ( # pyright: ignore[reportDeprecated]
1124
- to_raw_response_wrapper(
1125
- sources.count, # pyright: ignore[reportDeprecated],
1126
- )
1127
- )
1128
- self.delete_file = ( # pyright: ignore[reportDeprecated]
1129
- to_raw_response_wrapper(
1130
- sources.delete_file, # pyright: ignore[reportDeprecated],
1131
- )
1132
- )
1133
- self.get_agents = ( # pyright: ignore[reportDeprecated]
1134
- to_raw_response_wrapper(
1135
- sources.get_agents, # pyright: ignore[reportDeprecated],
1136
- )
1137
- )
1138
- self.get_by_name = ( # pyright: ignore[reportDeprecated]
1139
- to_raw_response_wrapper(
1140
- sources.get_by_name, # pyright: ignore[reportDeprecated],
1141
- )
1142
- )
1143
- self.get_metadata = ( # pyright: ignore[reportDeprecated]
1144
- to_raw_response_wrapper(
1145
- sources.get_metadata, # pyright: ignore[reportDeprecated],
1146
- )
1147
- )
1148
- self.list_passages = ( # pyright: ignore[reportDeprecated]
1149
- to_raw_response_wrapper(
1150
- sources.list_passages, # pyright: ignore[reportDeprecated],
1151
- )
1152
- )
1153
- self.upload_file = ( # pyright: ignore[reportDeprecated]
1154
- to_raw_response_wrapper(
1155
- sources.upload_file, # pyright: ignore[reportDeprecated],
1156
- )
1157
- )
1158
-
1159
- @cached_property
1160
- def files(self) -> FilesResourceWithRawResponse:
1161
- return FilesResourceWithRawResponse(self._sources.files)
1162
-
1163
-
1164
- class AsyncSourcesResourceWithRawResponse:
1165
- def __init__(self, sources: AsyncSourcesResource) -> None:
1166
- self._sources = sources
1167
-
1168
- self.create = ( # pyright: ignore[reportDeprecated]
1169
- async_to_raw_response_wrapper(
1170
- sources.create, # pyright: ignore[reportDeprecated],
1171
- )
1172
- )
1173
- self.retrieve = ( # pyright: ignore[reportDeprecated]
1174
- async_to_raw_response_wrapper(
1175
- sources.retrieve, # pyright: ignore[reportDeprecated],
1176
- )
1177
- )
1178
- self.update = ( # pyright: ignore[reportDeprecated]
1179
- async_to_raw_response_wrapper(
1180
- sources.update, # pyright: ignore[reportDeprecated],
1181
- )
1182
- )
1183
- self.list = ( # pyright: ignore[reportDeprecated]
1184
- async_to_raw_response_wrapper(
1185
- sources.list, # pyright: ignore[reportDeprecated],
1186
- )
1187
- )
1188
- self.delete = ( # pyright: ignore[reportDeprecated]
1189
- async_to_raw_response_wrapper(
1190
- sources.delete, # pyright: ignore[reportDeprecated],
1191
- )
1192
- )
1193
- self.count = ( # pyright: ignore[reportDeprecated]
1194
- async_to_raw_response_wrapper(
1195
- sources.count, # pyright: ignore[reportDeprecated],
1196
- )
1197
- )
1198
- self.delete_file = ( # pyright: ignore[reportDeprecated]
1199
- async_to_raw_response_wrapper(
1200
- sources.delete_file, # pyright: ignore[reportDeprecated],
1201
- )
1202
- )
1203
- self.get_agents = ( # pyright: ignore[reportDeprecated]
1204
- async_to_raw_response_wrapper(
1205
- sources.get_agents, # pyright: ignore[reportDeprecated],
1206
- )
1207
- )
1208
- self.get_by_name = ( # pyright: ignore[reportDeprecated]
1209
- async_to_raw_response_wrapper(
1210
- sources.get_by_name, # pyright: ignore[reportDeprecated],
1211
- )
1212
- )
1213
- self.get_metadata = ( # pyright: ignore[reportDeprecated]
1214
- async_to_raw_response_wrapper(
1215
- sources.get_metadata, # pyright: ignore[reportDeprecated],
1216
- )
1217
- )
1218
- self.list_passages = ( # pyright: ignore[reportDeprecated]
1219
- async_to_raw_response_wrapper(
1220
- sources.list_passages, # pyright: ignore[reportDeprecated],
1221
- )
1222
- )
1223
- self.upload_file = ( # pyright: ignore[reportDeprecated]
1224
- async_to_raw_response_wrapper(
1225
- sources.upload_file, # pyright: ignore[reportDeprecated],
1226
- )
1227
- )
1228
-
1229
- @cached_property
1230
- def files(self) -> AsyncFilesResourceWithRawResponse:
1231
- return AsyncFilesResourceWithRawResponse(self._sources.files)
1232
-
1233
-
1234
- class SourcesResourceWithStreamingResponse:
1235
- def __init__(self, sources: SourcesResource) -> None:
1236
- self._sources = sources
1237
-
1238
- self.create = ( # pyright: ignore[reportDeprecated]
1239
- to_streamed_response_wrapper(
1240
- sources.create, # pyright: ignore[reportDeprecated],
1241
- )
1242
- )
1243
- self.retrieve = ( # pyright: ignore[reportDeprecated]
1244
- to_streamed_response_wrapper(
1245
- sources.retrieve, # pyright: ignore[reportDeprecated],
1246
- )
1247
- )
1248
- self.update = ( # pyright: ignore[reportDeprecated]
1249
- to_streamed_response_wrapper(
1250
- sources.update, # pyright: ignore[reportDeprecated],
1251
- )
1252
- )
1253
- self.list = ( # pyright: ignore[reportDeprecated]
1254
- to_streamed_response_wrapper(
1255
- sources.list, # pyright: ignore[reportDeprecated],
1256
- )
1257
- )
1258
- self.delete = ( # pyright: ignore[reportDeprecated]
1259
- to_streamed_response_wrapper(
1260
- sources.delete, # pyright: ignore[reportDeprecated],
1261
- )
1262
- )
1263
- self.count = ( # pyright: ignore[reportDeprecated]
1264
- to_streamed_response_wrapper(
1265
- sources.count, # pyright: ignore[reportDeprecated],
1266
- )
1267
- )
1268
- self.delete_file = ( # pyright: ignore[reportDeprecated]
1269
- to_streamed_response_wrapper(
1270
- sources.delete_file, # pyright: ignore[reportDeprecated],
1271
- )
1272
- )
1273
- self.get_agents = ( # pyright: ignore[reportDeprecated]
1274
- to_streamed_response_wrapper(
1275
- sources.get_agents, # pyright: ignore[reportDeprecated],
1276
- )
1277
- )
1278
- self.get_by_name = ( # pyright: ignore[reportDeprecated]
1279
- to_streamed_response_wrapper(
1280
- sources.get_by_name, # pyright: ignore[reportDeprecated],
1281
- )
1282
- )
1283
- self.get_metadata = ( # pyright: ignore[reportDeprecated]
1284
- to_streamed_response_wrapper(
1285
- sources.get_metadata, # pyright: ignore[reportDeprecated],
1286
- )
1287
- )
1288
- self.list_passages = ( # pyright: ignore[reportDeprecated]
1289
- to_streamed_response_wrapper(
1290
- sources.list_passages, # pyright: ignore[reportDeprecated],
1291
- )
1292
- )
1293
- self.upload_file = ( # pyright: ignore[reportDeprecated]
1294
- to_streamed_response_wrapper(
1295
- sources.upload_file, # pyright: ignore[reportDeprecated],
1296
- )
1297
- )
1298
-
1299
- @cached_property
1300
- def files(self) -> FilesResourceWithStreamingResponse:
1301
- return FilesResourceWithStreamingResponse(self._sources.files)
1302
-
1303
-
1304
- class AsyncSourcesResourceWithStreamingResponse:
1305
- def __init__(self, sources: AsyncSourcesResource) -> None:
1306
- self._sources = sources
1307
-
1308
- self.create = ( # pyright: ignore[reportDeprecated]
1309
- async_to_streamed_response_wrapper(
1310
- sources.create, # pyright: ignore[reportDeprecated],
1311
- )
1312
- )
1313
- self.retrieve = ( # pyright: ignore[reportDeprecated]
1314
- async_to_streamed_response_wrapper(
1315
- sources.retrieve, # pyright: ignore[reportDeprecated],
1316
- )
1317
- )
1318
- self.update = ( # pyright: ignore[reportDeprecated]
1319
- async_to_streamed_response_wrapper(
1320
- sources.update, # pyright: ignore[reportDeprecated],
1321
- )
1322
- )
1323
- self.list = ( # pyright: ignore[reportDeprecated]
1324
- async_to_streamed_response_wrapper(
1325
- sources.list, # pyright: ignore[reportDeprecated],
1326
- )
1327
- )
1328
- self.delete = ( # pyright: ignore[reportDeprecated]
1329
- async_to_streamed_response_wrapper(
1330
- sources.delete, # pyright: ignore[reportDeprecated],
1331
- )
1332
- )
1333
- self.count = ( # pyright: ignore[reportDeprecated]
1334
- async_to_streamed_response_wrapper(
1335
- sources.count, # pyright: ignore[reportDeprecated],
1336
- )
1337
- )
1338
- self.delete_file = ( # pyright: ignore[reportDeprecated]
1339
- async_to_streamed_response_wrapper(
1340
- sources.delete_file, # pyright: ignore[reportDeprecated],
1341
- )
1342
- )
1343
- self.get_agents = ( # pyright: ignore[reportDeprecated]
1344
- async_to_streamed_response_wrapper(
1345
- sources.get_agents, # pyright: ignore[reportDeprecated],
1346
- )
1347
- )
1348
- self.get_by_name = ( # pyright: ignore[reportDeprecated]
1349
- async_to_streamed_response_wrapper(
1350
- sources.get_by_name, # pyright: ignore[reportDeprecated],
1351
- )
1352
- )
1353
- self.get_metadata = ( # pyright: ignore[reportDeprecated]
1354
- async_to_streamed_response_wrapper(
1355
- sources.get_metadata, # pyright: ignore[reportDeprecated],
1356
- )
1357
- )
1358
- self.list_passages = ( # pyright: ignore[reportDeprecated]
1359
- async_to_streamed_response_wrapper(
1360
- sources.list_passages, # pyright: ignore[reportDeprecated],
1361
- )
1362
- )
1363
- self.upload_file = ( # pyright: ignore[reportDeprecated]
1364
- async_to_streamed_response_wrapper(
1365
- sources.upload_file, # pyright: ignore[reportDeprecated],
1366
- )
1367
- )
1368
-
1369
- @cached_property
1370
- def files(self) -> AsyncFilesResourceWithStreamingResponse:
1371
- return AsyncFilesResourceWithStreamingResponse(self._sources.files)