aeri-python 4.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. aeri/__init__.py +72 -0
  2. aeri/_client/_validation.py +204 -0
  3. aeri/_client/attributes.py +188 -0
  4. aeri/_client/client.py +3761 -0
  5. aeri/_client/constants.py +65 -0
  6. aeri/_client/datasets.py +302 -0
  7. aeri/_client/environment_variables.py +158 -0
  8. aeri/_client/get_client.py +149 -0
  9. aeri/_client/observe.py +661 -0
  10. aeri/_client/propagation.py +475 -0
  11. aeri/_client/resource_manager.py +510 -0
  12. aeri/_client/span.py +1519 -0
  13. aeri/_client/span_filter.py +76 -0
  14. aeri/_client/span_processor.py +206 -0
  15. aeri/_client/utils.py +132 -0
  16. aeri/_task_manager/media_manager.py +331 -0
  17. aeri/_task_manager/media_upload_consumer.py +44 -0
  18. aeri/_task_manager/media_upload_queue.py +12 -0
  19. aeri/_task_manager/score_ingestion_consumer.py +208 -0
  20. aeri/_task_manager/task_manager.py +475 -0
  21. aeri/_utils/__init__.py +19 -0
  22. aeri/_utils/environment.py +34 -0
  23. aeri/_utils/error_logging.py +47 -0
  24. aeri/_utils/parse_error.py +99 -0
  25. aeri/_utils/prompt_cache.py +188 -0
  26. aeri/_utils/request.py +137 -0
  27. aeri/_utils/serializer.py +205 -0
  28. aeri/api/.fern/metadata.json +14 -0
  29. aeri/api/__init__.py +836 -0
  30. aeri/api/annotation_queues/__init__.py +82 -0
  31. aeri/api/annotation_queues/client.py +1111 -0
  32. aeri/api/annotation_queues/raw_client.py +2288 -0
  33. aeri/api/annotation_queues/types/__init__.py +84 -0
  34. aeri/api/annotation_queues/types/annotation_queue.py +28 -0
  35. aeri/api/annotation_queues/types/annotation_queue_assignment_request.py +16 -0
  36. aeri/api/annotation_queues/types/annotation_queue_item.py +34 -0
  37. aeri/api/annotation_queues/types/annotation_queue_object_type.py +26 -0
  38. aeri/api/annotation_queues/types/annotation_queue_status.py +22 -0
  39. aeri/api/annotation_queues/types/create_annotation_queue_assignment_response.py +18 -0
  40. aeri/api/annotation_queues/types/create_annotation_queue_item_request.py +25 -0
  41. aeri/api/annotation_queues/types/create_annotation_queue_request.py +20 -0
  42. aeri/api/annotation_queues/types/delete_annotation_queue_assignment_response.py +14 -0
  43. aeri/api/annotation_queues/types/delete_annotation_queue_item_response.py +15 -0
  44. aeri/api/annotation_queues/types/paginated_annotation_queue_items.py +17 -0
  45. aeri/api/annotation_queues/types/paginated_annotation_queues.py +17 -0
  46. aeri/api/annotation_queues/types/update_annotation_queue_item_request.py +15 -0
  47. aeri/api/blob_storage_integrations/__init__.py +73 -0
  48. aeri/api/blob_storage_integrations/client.py +550 -0
  49. aeri/api/blob_storage_integrations/raw_client.py +976 -0
  50. aeri/api/blob_storage_integrations/types/__init__.py +77 -0
  51. aeri/api/blob_storage_integrations/types/blob_storage_export_frequency.py +26 -0
  52. aeri/api/blob_storage_integrations/types/blob_storage_export_mode.py +26 -0
  53. aeri/api/blob_storage_integrations/types/blob_storage_integration_deletion_response.py +14 -0
  54. aeri/api/blob_storage_integrations/types/blob_storage_integration_file_type.py +26 -0
  55. aeri/api/blob_storage_integrations/types/blob_storage_integration_response.py +64 -0
  56. aeri/api/blob_storage_integrations/types/blob_storage_integration_status_response.py +50 -0
  57. aeri/api/blob_storage_integrations/types/blob_storage_integration_type.py +26 -0
  58. aeri/api/blob_storage_integrations/types/blob_storage_integrations_response.py +15 -0
  59. aeri/api/blob_storage_integrations/types/blob_storage_sync_status.py +47 -0
  60. aeri/api/blob_storage_integrations/types/create_blob_storage_integration_request.py +91 -0
  61. aeri/api/client.py +679 -0
  62. aeri/api/comments/__init__.py +44 -0
  63. aeri/api/comments/client.py +407 -0
  64. aeri/api/comments/raw_client.py +750 -0
  65. aeri/api/comments/types/__init__.py +46 -0
  66. aeri/api/comments/types/create_comment_request.py +47 -0
  67. aeri/api/comments/types/create_comment_response.py +17 -0
  68. aeri/api/comments/types/get_comments_response.py +17 -0
  69. aeri/api/commons/__init__.py +210 -0
  70. aeri/api/commons/errors/__init__.py +56 -0
  71. aeri/api/commons/errors/access_denied_error.py +12 -0
  72. aeri/api/commons/errors/error.py +12 -0
  73. aeri/api/commons/errors/method_not_allowed_error.py +12 -0
  74. aeri/api/commons/errors/not_found_error.py +12 -0
  75. aeri/api/commons/errors/unauthorized_error.py +12 -0
  76. aeri/api/commons/types/__init__.py +190 -0
  77. aeri/api/commons/types/base_score.py +90 -0
  78. aeri/api/commons/types/base_score_v1.py +70 -0
  79. aeri/api/commons/types/boolean_score.py +26 -0
  80. aeri/api/commons/types/boolean_score_v1.py +26 -0
  81. aeri/api/commons/types/categorical_score.py +26 -0
  82. aeri/api/commons/types/categorical_score_v1.py +26 -0
  83. aeri/api/commons/types/comment.py +36 -0
  84. aeri/api/commons/types/comment_object_type.py +30 -0
  85. aeri/api/commons/types/config_category.py +15 -0
  86. aeri/api/commons/types/correction_score.py +26 -0
  87. aeri/api/commons/types/create_score_value.py +5 -0
  88. aeri/api/commons/types/dataset.py +49 -0
  89. aeri/api/commons/types/dataset_item.py +58 -0
  90. aeri/api/commons/types/dataset_run.py +63 -0
  91. aeri/api/commons/types/dataset_run_item.py +40 -0
  92. aeri/api/commons/types/dataset_run_with_items.py +19 -0
  93. aeri/api/commons/types/dataset_status.py +22 -0
  94. aeri/api/commons/types/map_value.py +11 -0
  95. aeri/api/commons/types/model.py +125 -0
  96. aeri/api/commons/types/model_price.py +14 -0
  97. aeri/api/commons/types/model_usage_unit.py +42 -0
  98. aeri/api/commons/types/numeric_score.py +17 -0
  99. aeri/api/commons/types/numeric_score_v1.py +17 -0
  100. aeri/api/commons/types/observation.py +142 -0
  101. aeri/api/commons/types/observation_level.py +30 -0
  102. aeri/api/commons/types/observation_v2.py +235 -0
  103. aeri/api/commons/types/observations_view.py +89 -0
  104. aeri/api/commons/types/pricing_tier.py +91 -0
  105. aeri/api/commons/types/pricing_tier_condition.py +68 -0
  106. aeri/api/commons/types/pricing_tier_input.py +76 -0
  107. aeri/api/commons/types/pricing_tier_operator.py +42 -0
  108. aeri/api/commons/types/score.py +201 -0
  109. aeri/api/commons/types/score_config.py +66 -0
  110. aeri/api/commons/types/score_config_data_type.py +26 -0
  111. aeri/api/commons/types/score_data_type.py +30 -0
  112. aeri/api/commons/types/score_source.py +26 -0
  113. aeri/api/commons/types/score_v1.py +131 -0
  114. aeri/api/commons/types/session.py +25 -0
  115. aeri/api/commons/types/session_with_traces.py +15 -0
  116. aeri/api/commons/types/trace.py +84 -0
  117. aeri/api/commons/types/trace_with_details.py +43 -0
  118. aeri/api/commons/types/trace_with_full_details.py +45 -0
  119. aeri/api/commons/types/usage.py +59 -0
  120. aeri/api/core/__init__.py +111 -0
  121. aeri/api/core/api_error.py +23 -0
  122. aeri/api/core/client_wrapper.py +141 -0
  123. aeri/api/core/datetime_utils.py +30 -0
  124. aeri/api/core/enum.py +20 -0
  125. aeri/api/core/file.py +70 -0
  126. aeri/api/core/force_multipart.py +18 -0
  127. aeri/api/core/http_client.py +711 -0
  128. aeri/api/core/http_response.py +55 -0
  129. aeri/api/core/http_sse/__init__.py +48 -0
  130. aeri/api/core/http_sse/_api.py +114 -0
  131. aeri/api/core/http_sse/_decoders.py +66 -0
  132. aeri/api/core/http_sse/_exceptions.py +7 -0
  133. aeri/api/core/http_sse/_models.py +17 -0
  134. aeri/api/core/jsonable_encoder.py +102 -0
  135. aeri/api/core/pydantic_utilities.py +310 -0
  136. aeri/api/core/query_encoder.py +60 -0
  137. aeri/api/core/remove_none_from_dict.py +11 -0
  138. aeri/api/core/request_options.py +35 -0
  139. aeri/api/core/serialization.py +282 -0
  140. aeri/api/dataset_items/__init__.py +52 -0
  141. aeri/api/dataset_items/client.py +499 -0
  142. aeri/api/dataset_items/raw_client.py +973 -0
  143. aeri/api/dataset_items/types/__init__.py +50 -0
  144. aeri/api/dataset_items/types/create_dataset_item_request.py +37 -0
  145. aeri/api/dataset_items/types/delete_dataset_item_response.py +17 -0
  146. aeri/api/dataset_items/types/paginated_dataset_items.py +17 -0
  147. aeri/api/dataset_run_items/__init__.py +43 -0
  148. aeri/api/dataset_run_items/client.py +323 -0
  149. aeri/api/dataset_run_items/raw_client.py +547 -0
  150. aeri/api/dataset_run_items/types/__init__.py +44 -0
  151. aeri/api/dataset_run_items/types/create_dataset_run_item_request.py +51 -0
  152. aeri/api/dataset_run_items/types/paginated_dataset_run_items.py +17 -0
  153. aeri/api/datasets/__init__.py +55 -0
  154. aeri/api/datasets/client.py +661 -0
  155. aeri/api/datasets/raw_client.py +1368 -0
  156. aeri/api/datasets/types/__init__.py +53 -0
  157. aeri/api/datasets/types/create_dataset_request.py +31 -0
  158. aeri/api/datasets/types/delete_dataset_run_response.py +14 -0
  159. aeri/api/datasets/types/paginated_dataset_runs.py +17 -0
  160. aeri/api/datasets/types/paginated_datasets.py +17 -0
  161. aeri/api/health/__init__.py +44 -0
  162. aeri/api/health/client.py +112 -0
  163. aeri/api/health/errors/__init__.py +42 -0
  164. aeri/api/health/errors/service_unavailable_error.py +13 -0
  165. aeri/api/health/raw_client.py +227 -0
  166. aeri/api/health/types/__init__.py +40 -0
  167. aeri/api/health/types/health_response.py +30 -0
  168. aeri/api/ingestion/__init__.py +169 -0
  169. aeri/api/ingestion/client.py +221 -0
  170. aeri/api/ingestion/raw_client.py +293 -0
  171. aeri/api/ingestion/types/__init__.py +169 -0
  172. aeri/api/ingestion/types/base_event.py +27 -0
  173. aeri/api/ingestion/types/create_event_body.py +14 -0
  174. aeri/api/ingestion/types/create_event_event.py +15 -0
  175. aeri/api/ingestion/types/create_generation_body.py +40 -0
  176. aeri/api/ingestion/types/create_generation_event.py +15 -0
  177. aeri/api/ingestion/types/create_observation_event.py +15 -0
  178. aeri/api/ingestion/types/create_span_body.py +19 -0
  179. aeri/api/ingestion/types/create_span_event.py +15 -0
  180. aeri/api/ingestion/types/ingestion_error.py +17 -0
  181. aeri/api/ingestion/types/ingestion_event.py +155 -0
  182. aeri/api/ingestion/types/ingestion_response.py +17 -0
  183. aeri/api/ingestion/types/ingestion_success.py +15 -0
  184. aeri/api/ingestion/types/ingestion_usage.py +8 -0
  185. aeri/api/ingestion/types/observation_body.py +53 -0
  186. aeri/api/ingestion/types/observation_type.py +54 -0
  187. aeri/api/ingestion/types/open_ai_completion_usage_schema.py +26 -0
  188. aeri/api/ingestion/types/open_ai_response_usage_schema.py +24 -0
  189. aeri/api/ingestion/types/open_ai_usage.py +28 -0
  190. aeri/api/ingestion/types/optional_observation_body.py +36 -0
  191. aeri/api/ingestion/types/score_body.py +75 -0
  192. aeri/api/ingestion/types/score_event.py +15 -0
  193. aeri/api/ingestion/types/sdk_log_body.py +14 -0
  194. aeri/api/ingestion/types/sdk_log_event.py +15 -0
  195. aeri/api/ingestion/types/trace_body.py +36 -0
  196. aeri/api/ingestion/types/trace_event.py +15 -0
  197. aeri/api/ingestion/types/update_event_body.py +14 -0
  198. aeri/api/ingestion/types/update_generation_body.py +40 -0
  199. aeri/api/ingestion/types/update_generation_event.py +15 -0
  200. aeri/api/ingestion/types/update_observation_event.py +15 -0
  201. aeri/api/ingestion/types/update_span_body.py +19 -0
  202. aeri/api/ingestion/types/update_span_event.py +15 -0
  203. aeri/api/ingestion/types/usage_details.py +10 -0
  204. aeri/api/legacy/__init__.py +61 -0
  205. aeri/api/legacy/client.py +105 -0
  206. aeri/api/legacy/metrics_v1/__init__.py +40 -0
  207. aeri/api/legacy/metrics_v1/client.py +214 -0
  208. aeri/api/legacy/metrics_v1/raw_client.py +322 -0
  209. aeri/api/legacy/metrics_v1/types/__init__.py +40 -0
  210. aeri/api/legacy/metrics_v1/types/metrics_response.py +19 -0
  211. aeri/api/legacy/observations_v1/__init__.py +43 -0
  212. aeri/api/legacy/observations_v1/client.py +523 -0
  213. aeri/api/legacy/observations_v1/raw_client.py +759 -0
  214. aeri/api/legacy/observations_v1/types/__init__.py +44 -0
  215. aeri/api/legacy/observations_v1/types/observations.py +17 -0
  216. aeri/api/legacy/observations_v1/types/observations_views.py +17 -0
  217. aeri/api/legacy/raw_client.py +13 -0
  218. aeri/api/legacy/score_v1/__init__.py +43 -0
  219. aeri/api/legacy/score_v1/client.py +329 -0
  220. aeri/api/legacy/score_v1/raw_client.py +545 -0
  221. aeri/api/legacy/score_v1/types/__init__.py +44 -0
  222. aeri/api/legacy/score_v1/types/create_score_request.py +75 -0
  223. aeri/api/legacy/score_v1/types/create_score_response.py +17 -0
  224. aeri/api/llm_connections/__init__.py +55 -0
  225. aeri/api/llm_connections/client.py +311 -0
  226. aeri/api/llm_connections/raw_client.py +541 -0
  227. aeri/api/llm_connections/types/__init__.py +53 -0
  228. aeri/api/llm_connections/types/llm_adapter.py +38 -0
  229. aeri/api/llm_connections/types/llm_connection.py +77 -0
  230. aeri/api/llm_connections/types/paginated_llm_connections.py +17 -0
  231. aeri/api/llm_connections/types/upsert_llm_connection_request.py +69 -0
  232. aeri/api/media/__init__.py +58 -0
  233. aeri/api/media/client.py +427 -0
  234. aeri/api/media/raw_client.py +739 -0
  235. aeri/api/media/types/__init__.py +56 -0
  236. aeri/api/media/types/get_media_response.py +55 -0
  237. aeri/api/media/types/get_media_upload_url_request.py +51 -0
  238. aeri/api/media/types/get_media_upload_url_response.py +28 -0
  239. aeri/api/media/types/media_content_type.py +232 -0
  240. aeri/api/media/types/patch_media_body.py +43 -0
  241. aeri/api/metrics/__init__.py +40 -0
  242. aeri/api/metrics/client.py +422 -0
  243. aeri/api/metrics/raw_client.py +530 -0
  244. aeri/api/metrics/types/__init__.py +40 -0
  245. aeri/api/metrics/types/metrics_v2response.py +19 -0
  246. aeri/api/models/__init__.py +43 -0
  247. aeri/api/models/client.py +523 -0
  248. aeri/api/models/raw_client.py +993 -0
  249. aeri/api/models/types/__init__.py +44 -0
  250. aeri/api/models/types/create_model_request.py +103 -0
  251. aeri/api/models/types/paginated_models.py +17 -0
  252. aeri/api/observations/__init__.py +43 -0
  253. aeri/api/observations/client.py +522 -0
  254. aeri/api/observations/raw_client.py +641 -0
  255. aeri/api/observations/types/__init__.py +44 -0
  256. aeri/api/observations/types/observations_v2meta.py +21 -0
  257. aeri/api/observations/types/observations_v2response.py +28 -0
  258. aeri/api/opentelemetry/__init__.py +67 -0
  259. aeri/api/opentelemetry/client.py +276 -0
  260. aeri/api/opentelemetry/raw_client.py +291 -0
  261. aeri/api/opentelemetry/types/__init__.py +65 -0
  262. aeri/api/opentelemetry/types/otel_attribute.py +27 -0
  263. aeri/api/opentelemetry/types/otel_attribute_value.py +46 -0
  264. aeri/api/opentelemetry/types/otel_resource.py +24 -0
  265. aeri/api/opentelemetry/types/otel_resource_span.py +32 -0
  266. aeri/api/opentelemetry/types/otel_scope.py +34 -0
  267. aeri/api/opentelemetry/types/otel_scope_span.py +28 -0
  268. aeri/api/opentelemetry/types/otel_span.py +76 -0
  269. aeri/api/opentelemetry/types/otel_trace_response.py +16 -0
  270. aeri/api/organizations/__init__.py +73 -0
  271. aeri/api/organizations/client.py +756 -0
  272. aeri/api/organizations/raw_client.py +1707 -0
  273. aeri/api/organizations/types/__init__.py +71 -0
  274. aeri/api/organizations/types/delete_membership_request.py +16 -0
  275. aeri/api/organizations/types/membership_deletion_response.py +17 -0
  276. aeri/api/organizations/types/membership_request.py +18 -0
  277. aeri/api/organizations/types/membership_response.py +20 -0
  278. aeri/api/organizations/types/membership_role.py +30 -0
  279. aeri/api/organizations/types/memberships_response.py +15 -0
  280. aeri/api/organizations/types/organization_api_key.py +31 -0
  281. aeri/api/organizations/types/organization_api_keys_response.py +19 -0
  282. aeri/api/organizations/types/organization_project.py +25 -0
  283. aeri/api/organizations/types/organization_projects_response.py +15 -0
  284. aeri/api/projects/__init__.py +67 -0
  285. aeri/api/projects/client.py +760 -0
  286. aeri/api/projects/raw_client.py +1577 -0
  287. aeri/api/projects/types/__init__.py +65 -0
  288. aeri/api/projects/types/api_key_deletion_response.py +18 -0
  289. aeri/api/projects/types/api_key_list.py +23 -0
  290. aeri/api/projects/types/api_key_response.py +30 -0
  291. aeri/api/projects/types/api_key_summary.py +35 -0
  292. aeri/api/projects/types/organization.py +22 -0
  293. aeri/api/projects/types/project.py +34 -0
  294. aeri/api/projects/types/project_deletion_response.py +15 -0
  295. aeri/api/projects/types/projects.py +15 -0
  296. aeri/api/prompt_version/__init__.py +4 -0
  297. aeri/api/prompt_version/client.py +157 -0
  298. aeri/api/prompt_version/raw_client.py +264 -0
  299. aeri/api/prompts/__init__.py +100 -0
  300. aeri/api/prompts/client.py +550 -0
  301. aeri/api/prompts/raw_client.py +987 -0
  302. aeri/api/prompts/types/__init__.py +96 -0
  303. aeri/api/prompts/types/base_prompt.py +42 -0
  304. aeri/api/prompts/types/chat_message.py +17 -0
  305. aeri/api/prompts/types/chat_message_type.py +15 -0
  306. aeri/api/prompts/types/chat_message_with_placeholders.py +8 -0
  307. aeri/api/prompts/types/chat_prompt.py +15 -0
  308. aeri/api/prompts/types/create_chat_prompt_request.py +37 -0
  309. aeri/api/prompts/types/create_chat_prompt_type.py +15 -0
  310. aeri/api/prompts/types/create_prompt_request.py +8 -0
  311. aeri/api/prompts/types/create_text_prompt_request.py +36 -0
  312. aeri/api/prompts/types/create_text_prompt_type.py +15 -0
  313. aeri/api/prompts/types/placeholder_message.py +16 -0
  314. aeri/api/prompts/types/placeholder_message_type.py +15 -0
  315. aeri/api/prompts/types/prompt.py +58 -0
  316. aeri/api/prompts/types/prompt_meta.py +35 -0
  317. aeri/api/prompts/types/prompt_meta_list_response.py +17 -0
  318. aeri/api/prompts/types/prompt_type.py +20 -0
  319. aeri/api/prompts/types/text_prompt.py +14 -0
  320. aeri/api/scim/__init__.py +94 -0
  321. aeri/api/scim/client.py +686 -0
  322. aeri/api/scim/raw_client.py +1528 -0
  323. aeri/api/scim/types/__init__.py +92 -0
  324. aeri/api/scim/types/authentication_scheme.py +20 -0
  325. aeri/api/scim/types/bulk_config.py +22 -0
  326. aeri/api/scim/types/empty_response.py +16 -0
  327. aeri/api/scim/types/filter_config.py +17 -0
  328. aeri/api/scim/types/resource_meta.py +17 -0
  329. aeri/api/scim/types/resource_type.py +27 -0
  330. aeri/api/scim/types/resource_types_response.py +21 -0
  331. aeri/api/scim/types/schema_extension.py +17 -0
  332. aeri/api/scim/types/schema_resource.py +19 -0
  333. aeri/api/scim/types/schemas_response.py +21 -0
  334. aeri/api/scim/types/scim_email.py +16 -0
  335. aeri/api/scim/types/scim_feature_support.py +14 -0
  336. aeri/api/scim/types/scim_name.py +14 -0
  337. aeri/api/scim/types/scim_user.py +24 -0
  338. aeri/api/scim/types/scim_users_list_response.py +25 -0
  339. aeri/api/scim/types/service_provider_config.py +36 -0
  340. aeri/api/scim/types/user_meta.py +20 -0
  341. aeri/api/score_configs/__init__.py +44 -0
  342. aeri/api/score_configs/client.py +526 -0
  343. aeri/api/score_configs/raw_client.py +1012 -0
  344. aeri/api/score_configs/types/__init__.py +46 -0
  345. aeri/api/score_configs/types/create_score_config_request.py +46 -0
  346. aeri/api/score_configs/types/score_configs.py +17 -0
  347. aeri/api/score_configs/types/update_score_config_request.py +53 -0
  348. aeri/api/scores/__init__.py +76 -0
  349. aeri/api/scores/client.py +420 -0
  350. aeri/api/scores/raw_client.py +656 -0
  351. aeri/api/scores/types/__init__.py +76 -0
  352. aeri/api/scores/types/get_scores_response.py +17 -0
  353. aeri/api/scores/types/get_scores_response_data.py +211 -0
  354. aeri/api/scores/types/get_scores_response_data_boolean.py +15 -0
  355. aeri/api/scores/types/get_scores_response_data_categorical.py +15 -0
  356. aeri/api/scores/types/get_scores_response_data_correction.py +15 -0
  357. aeri/api/scores/types/get_scores_response_data_numeric.py +15 -0
  358. aeri/api/scores/types/get_scores_response_trace_data.py +38 -0
  359. aeri/api/sessions/__init__.py +40 -0
  360. aeri/api/sessions/client.py +262 -0
  361. aeri/api/sessions/raw_client.py +500 -0
  362. aeri/api/sessions/types/__init__.py +40 -0
  363. aeri/api/sessions/types/paginated_sessions.py +17 -0
  364. aeri/api/trace/__init__.py +44 -0
  365. aeri/api/trace/client.py +728 -0
  366. aeri/api/trace/raw_client.py +1208 -0
  367. aeri/api/trace/types/__init__.py +46 -0
  368. aeri/api/trace/types/delete_trace_response.py +14 -0
  369. aeri/api/trace/types/sort.py +14 -0
  370. aeri/api/trace/types/traces.py +17 -0
  371. aeri/api/utils/__init__.py +44 -0
  372. aeri/api/utils/pagination/__init__.py +40 -0
  373. aeri/api/utils/pagination/types/__init__.py +40 -0
  374. aeri/api/utils/pagination/types/meta_response.py +38 -0
  375. aeri/batch_evaluation.py +1643 -0
  376. aeri/experiment.py +1044 -0
  377. aeri/langchain/CallbackHandler.py +1377 -0
  378. aeri/langchain/__init__.py +5 -0
  379. aeri/langchain/utils.py +212 -0
  380. aeri/logger.py +28 -0
  381. aeri/media.py +352 -0
  382. aeri/model.py +477 -0
  383. aeri/openai.py +1124 -0
  384. aeri/py.typed +0 -0
  385. aeri/span_filter.py +17 -0
  386. aeri/types.py +79 -0
  387. aeri/version.py +3 -0
  388. aeri_python-4.0.0.dist-info/METADATA +51 -0
  389. aeri_python-4.0.0.dist-info/RECORD +391 -0
  390. aeri_python-4.0.0.dist-info/WHEEL +4 -0
  391. aeri_python-4.0.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,976 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+ from json.decoder import JSONDecodeError
6
+
7
+ from ..commons.errors.access_denied_error import AccessDeniedError
8
+ from ..commons.errors.error import Error
9
+ from ..commons.errors.method_not_allowed_error import MethodNotAllowedError
10
+ from ..commons.errors.not_found_error import NotFoundError
11
+ from ..commons.errors.unauthorized_error import UnauthorizedError
12
+ from ..core.api_error import ApiError
13
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
14
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
15
+ from ..core.jsonable_encoder import jsonable_encoder
16
+ from ..core.pydantic_utilities import parse_obj_as
17
+ from ..core.request_options import RequestOptions
18
+ from .types.blob_storage_export_frequency import BlobStorageExportFrequency
19
+ from .types.blob_storage_export_mode import BlobStorageExportMode
20
+ from .types.blob_storage_integration_deletion_response import (
21
+ BlobStorageIntegrationDeletionResponse,
22
+ )
23
+ from .types.blob_storage_integration_file_type import BlobStorageIntegrationFileType
24
+ from .types.blob_storage_integration_response import BlobStorageIntegrationResponse
25
+ from .types.blob_storage_integration_status_response import (
26
+ BlobStorageIntegrationStatusResponse,
27
+ )
28
+ from .types.blob_storage_integration_type import BlobStorageIntegrationType
29
+ from .types.blob_storage_integrations_response import BlobStorageIntegrationsResponse
30
+
31
+ # this is used as the default value for optional parameters
32
+ OMIT = typing.cast(typing.Any, ...)
33
+
34
+
35
+ class RawBlobStorageIntegrationsClient:
36
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
37
+ self._client_wrapper = client_wrapper
38
+
39
+ def get_blob_storage_integrations(
40
+ self, *, request_options: typing.Optional[RequestOptions] = None
41
+ ) -> HttpResponse[BlobStorageIntegrationsResponse]:
42
+ """
43
+ Get all blob storage integrations for the organization (requires organization-scoped API key)
44
+
45
+ Parameters
46
+ ----------
47
+ request_options : typing.Optional[RequestOptions]
48
+ Request-specific configuration.
49
+
50
+ Returns
51
+ -------
52
+ HttpResponse[BlobStorageIntegrationsResponse]
53
+ """
54
+ _response = self._client_wrapper.httpx_client.request(
55
+ "api/public/integrations/blob-storage",
56
+ method="GET",
57
+ request_options=request_options,
58
+ )
59
+ try:
60
+ if 200 <= _response.status_code < 300:
61
+ _data = typing.cast(
62
+ BlobStorageIntegrationsResponse,
63
+ parse_obj_as(
64
+ type_=BlobStorageIntegrationsResponse, # type: ignore
65
+ object_=_response.json(),
66
+ ),
67
+ )
68
+ return HttpResponse(response=_response, data=_data)
69
+ if _response.status_code == 400:
70
+ raise Error(
71
+ headers=dict(_response.headers),
72
+ body=typing.cast(
73
+ typing.Any,
74
+ parse_obj_as(
75
+ type_=typing.Any, # type: ignore
76
+ object_=_response.json(),
77
+ ),
78
+ ),
79
+ )
80
+ if _response.status_code == 401:
81
+ raise UnauthorizedError(
82
+ headers=dict(_response.headers),
83
+ body=typing.cast(
84
+ typing.Any,
85
+ parse_obj_as(
86
+ type_=typing.Any, # type: ignore
87
+ object_=_response.json(),
88
+ ),
89
+ ),
90
+ )
91
+ if _response.status_code == 403:
92
+ raise AccessDeniedError(
93
+ headers=dict(_response.headers),
94
+ body=typing.cast(
95
+ typing.Any,
96
+ parse_obj_as(
97
+ type_=typing.Any, # type: ignore
98
+ object_=_response.json(),
99
+ ),
100
+ ),
101
+ )
102
+ if _response.status_code == 405:
103
+ raise MethodNotAllowedError(
104
+ headers=dict(_response.headers),
105
+ body=typing.cast(
106
+ typing.Any,
107
+ parse_obj_as(
108
+ type_=typing.Any, # type: ignore
109
+ object_=_response.json(),
110
+ ),
111
+ ),
112
+ )
113
+ if _response.status_code == 404:
114
+ raise NotFoundError(
115
+ headers=dict(_response.headers),
116
+ body=typing.cast(
117
+ typing.Any,
118
+ parse_obj_as(
119
+ type_=typing.Any, # type: ignore
120
+ object_=_response.json(),
121
+ ),
122
+ ),
123
+ )
124
+ _response_json = _response.json()
125
+ except JSONDecodeError:
126
+ raise ApiError(
127
+ status_code=_response.status_code,
128
+ headers=dict(_response.headers),
129
+ body=_response.text,
130
+ )
131
+ raise ApiError(
132
+ status_code=_response.status_code,
133
+ headers=dict(_response.headers),
134
+ body=_response_json,
135
+ )
136
+
137
+ def upsert_blob_storage_integration(
138
+ self,
139
+ *,
140
+ project_id: str,
141
+ type: BlobStorageIntegrationType,
142
+ bucket_name: str,
143
+ region: str,
144
+ export_frequency: BlobStorageExportFrequency,
145
+ enabled: bool,
146
+ force_path_style: bool,
147
+ file_type: BlobStorageIntegrationFileType,
148
+ export_mode: BlobStorageExportMode,
149
+ endpoint: typing.Optional[str] = OMIT,
150
+ access_key_id: typing.Optional[str] = OMIT,
151
+ secret_access_key: typing.Optional[str] = OMIT,
152
+ prefix: typing.Optional[str] = OMIT,
153
+ export_start_date: typing.Optional[dt.datetime] = OMIT,
154
+ request_options: typing.Optional[RequestOptions] = None,
155
+ ) -> HttpResponse[BlobStorageIntegrationResponse]:
156
+ """
157
+ Create or update a blob storage integration for a specific project (requires organization-scoped API key). The configuration is validated by performing a test upload to the bucket.
158
+
159
+ Parameters
160
+ ----------
161
+ project_id : str
162
+ ID of the project in which to configure the blob storage integration
163
+
164
+ type : BlobStorageIntegrationType
165
+
166
+ bucket_name : str
167
+ Name of the storage bucket
168
+
169
+ region : str
170
+ Storage region
171
+
172
+ export_frequency : BlobStorageExportFrequency
173
+
174
+ enabled : bool
175
+ Whether the integration is active
176
+
177
+ force_path_style : bool
178
+ Use path-style URLs for S3 requests
179
+
180
+ file_type : BlobStorageIntegrationFileType
181
+
182
+ export_mode : BlobStorageExportMode
183
+
184
+ endpoint : typing.Optional[str]
185
+ Custom endpoint URL (required for S3_COMPATIBLE type)
186
+
187
+ access_key_id : typing.Optional[str]
188
+ Access key ID for authentication
189
+
190
+ secret_access_key : typing.Optional[str]
191
+ Secret access key for authentication (will be encrypted when stored)
192
+
193
+ prefix : typing.Optional[str]
194
+ Path prefix for exported files (must end with forward slash if provided)
195
+
196
+ export_start_date : typing.Optional[dt.datetime]
197
+ Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
198
+
199
+ request_options : typing.Optional[RequestOptions]
200
+ Request-specific configuration.
201
+
202
+ Returns
203
+ -------
204
+ HttpResponse[BlobStorageIntegrationResponse]
205
+ """
206
+ _response = self._client_wrapper.httpx_client.request(
207
+ "api/public/integrations/blob-storage",
208
+ method="PUT",
209
+ json={
210
+ "projectId": project_id,
211
+ "type": type,
212
+ "bucketName": bucket_name,
213
+ "endpoint": endpoint,
214
+ "region": region,
215
+ "accessKeyId": access_key_id,
216
+ "secretAccessKey": secret_access_key,
217
+ "prefix": prefix,
218
+ "exportFrequency": export_frequency,
219
+ "enabled": enabled,
220
+ "forcePathStyle": force_path_style,
221
+ "fileType": file_type,
222
+ "exportMode": export_mode,
223
+ "exportStartDate": export_start_date,
224
+ },
225
+ request_options=request_options,
226
+ omit=OMIT,
227
+ )
228
+ try:
229
+ if 200 <= _response.status_code < 300:
230
+ _data = typing.cast(
231
+ BlobStorageIntegrationResponse,
232
+ parse_obj_as(
233
+ type_=BlobStorageIntegrationResponse, # type: ignore
234
+ object_=_response.json(),
235
+ ),
236
+ )
237
+ return HttpResponse(response=_response, data=_data)
238
+ if _response.status_code == 400:
239
+ raise Error(
240
+ headers=dict(_response.headers),
241
+ body=typing.cast(
242
+ typing.Any,
243
+ parse_obj_as(
244
+ type_=typing.Any, # type: ignore
245
+ object_=_response.json(),
246
+ ),
247
+ ),
248
+ )
249
+ if _response.status_code == 401:
250
+ raise UnauthorizedError(
251
+ headers=dict(_response.headers),
252
+ body=typing.cast(
253
+ typing.Any,
254
+ parse_obj_as(
255
+ type_=typing.Any, # type: ignore
256
+ object_=_response.json(),
257
+ ),
258
+ ),
259
+ )
260
+ if _response.status_code == 403:
261
+ raise AccessDeniedError(
262
+ headers=dict(_response.headers),
263
+ body=typing.cast(
264
+ typing.Any,
265
+ parse_obj_as(
266
+ type_=typing.Any, # type: ignore
267
+ object_=_response.json(),
268
+ ),
269
+ ),
270
+ )
271
+ if _response.status_code == 405:
272
+ raise MethodNotAllowedError(
273
+ headers=dict(_response.headers),
274
+ body=typing.cast(
275
+ typing.Any,
276
+ parse_obj_as(
277
+ type_=typing.Any, # type: ignore
278
+ object_=_response.json(),
279
+ ),
280
+ ),
281
+ )
282
+ if _response.status_code == 404:
283
+ raise NotFoundError(
284
+ headers=dict(_response.headers),
285
+ body=typing.cast(
286
+ typing.Any,
287
+ parse_obj_as(
288
+ type_=typing.Any, # type: ignore
289
+ object_=_response.json(),
290
+ ),
291
+ ),
292
+ )
293
+ _response_json = _response.json()
294
+ except JSONDecodeError:
295
+ raise ApiError(
296
+ status_code=_response.status_code,
297
+ headers=dict(_response.headers),
298
+ body=_response.text,
299
+ )
300
+ raise ApiError(
301
+ status_code=_response.status_code,
302
+ headers=dict(_response.headers),
303
+ body=_response_json,
304
+ )
305
+
306
+ def get_blob_storage_integration_status(
307
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
308
+ ) -> HttpResponse[BlobStorageIntegrationStatusResponse]:
309
+ """
310
+ Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)
311
+
312
+ Parameters
313
+ ----------
314
+ id : str
315
+
316
+ request_options : typing.Optional[RequestOptions]
317
+ Request-specific configuration.
318
+
319
+ Returns
320
+ -------
321
+ HttpResponse[BlobStorageIntegrationStatusResponse]
322
+ """
323
+ _response = self._client_wrapper.httpx_client.request(
324
+ f"api/public/integrations/blob-storage/{jsonable_encoder(id)}",
325
+ method="GET",
326
+ request_options=request_options,
327
+ )
328
+ try:
329
+ if 200 <= _response.status_code < 300:
330
+ _data = typing.cast(
331
+ BlobStorageIntegrationStatusResponse,
332
+ parse_obj_as(
333
+ type_=BlobStorageIntegrationStatusResponse, # type: ignore
334
+ object_=_response.json(),
335
+ ),
336
+ )
337
+ return HttpResponse(response=_response, data=_data)
338
+ if _response.status_code == 400:
339
+ raise Error(
340
+ headers=dict(_response.headers),
341
+ body=typing.cast(
342
+ typing.Any,
343
+ parse_obj_as(
344
+ type_=typing.Any, # type: ignore
345
+ object_=_response.json(),
346
+ ),
347
+ ),
348
+ )
349
+ if _response.status_code == 401:
350
+ raise UnauthorizedError(
351
+ headers=dict(_response.headers),
352
+ body=typing.cast(
353
+ typing.Any,
354
+ parse_obj_as(
355
+ type_=typing.Any, # type: ignore
356
+ object_=_response.json(),
357
+ ),
358
+ ),
359
+ )
360
+ if _response.status_code == 403:
361
+ raise AccessDeniedError(
362
+ headers=dict(_response.headers),
363
+ body=typing.cast(
364
+ typing.Any,
365
+ parse_obj_as(
366
+ type_=typing.Any, # type: ignore
367
+ object_=_response.json(),
368
+ ),
369
+ ),
370
+ )
371
+ if _response.status_code == 405:
372
+ raise MethodNotAllowedError(
373
+ headers=dict(_response.headers),
374
+ body=typing.cast(
375
+ typing.Any,
376
+ parse_obj_as(
377
+ type_=typing.Any, # type: ignore
378
+ object_=_response.json(),
379
+ ),
380
+ ),
381
+ )
382
+ if _response.status_code == 404:
383
+ raise NotFoundError(
384
+ headers=dict(_response.headers),
385
+ body=typing.cast(
386
+ typing.Any,
387
+ parse_obj_as(
388
+ type_=typing.Any, # type: ignore
389
+ object_=_response.json(),
390
+ ),
391
+ ),
392
+ )
393
+ _response_json = _response.json()
394
+ except JSONDecodeError:
395
+ raise ApiError(
396
+ status_code=_response.status_code,
397
+ headers=dict(_response.headers),
398
+ body=_response.text,
399
+ )
400
+ raise ApiError(
401
+ status_code=_response.status_code,
402
+ headers=dict(_response.headers),
403
+ body=_response_json,
404
+ )
405
+
406
+ def delete_blob_storage_integration(
407
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
408
+ ) -> HttpResponse[BlobStorageIntegrationDeletionResponse]:
409
+ """
410
+ Delete a blob storage integration by ID (requires organization-scoped API key)
411
+
412
+ Parameters
413
+ ----------
414
+ id : str
415
+
416
+ request_options : typing.Optional[RequestOptions]
417
+ Request-specific configuration.
418
+
419
+ Returns
420
+ -------
421
+ HttpResponse[BlobStorageIntegrationDeletionResponse]
422
+ """
423
+ _response = self._client_wrapper.httpx_client.request(
424
+ f"api/public/integrations/blob-storage/{jsonable_encoder(id)}",
425
+ method="DELETE",
426
+ request_options=request_options,
427
+ )
428
+ try:
429
+ if 200 <= _response.status_code < 300:
430
+ _data = typing.cast(
431
+ BlobStorageIntegrationDeletionResponse,
432
+ parse_obj_as(
433
+ type_=BlobStorageIntegrationDeletionResponse, # type: ignore
434
+ object_=_response.json(),
435
+ ),
436
+ )
437
+ return HttpResponse(response=_response, data=_data)
438
+ if _response.status_code == 400:
439
+ raise Error(
440
+ headers=dict(_response.headers),
441
+ body=typing.cast(
442
+ typing.Any,
443
+ parse_obj_as(
444
+ type_=typing.Any, # type: ignore
445
+ object_=_response.json(),
446
+ ),
447
+ ),
448
+ )
449
+ if _response.status_code == 401:
450
+ raise UnauthorizedError(
451
+ headers=dict(_response.headers),
452
+ body=typing.cast(
453
+ typing.Any,
454
+ parse_obj_as(
455
+ type_=typing.Any, # type: ignore
456
+ object_=_response.json(),
457
+ ),
458
+ ),
459
+ )
460
+ if _response.status_code == 403:
461
+ raise AccessDeniedError(
462
+ headers=dict(_response.headers),
463
+ body=typing.cast(
464
+ typing.Any,
465
+ parse_obj_as(
466
+ type_=typing.Any, # type: ignore
467
+ object_=_response.json(),
468
+ ),
469
+ ),
470
+ )
471
+ if _response.status_code == 405:
472
+ raise MethodNotAllowedError(
473
+ headers=dict(_response.headers),
474
+ body=typing.cast(
475
+ typing.Any,
476
+ parse_obj_as(
477
+ type_=typing.Any, # type: ignore
478
+ object_=_response.json(),
479
+ ),
480
+ ),
481
+ )
482
+ if _response.status_code == 404:
483
+ raise NotFoundError(
484
+ headers=dict(_response.headers),
485
+ body=typing.cast(
486
+ typing.Any,
487
+ parse_obj_as(
488
+ type_=typing.Any, # type: ignore
489
+ object_=_response.json(),
490
+ ),
491
+ ),
492
+ )
493
+ _response_json = _response.json()
494
+ except JSONDecodeError:
495
+ raise ApiError(
496
+ status_code=_response.status_code,
497
+ headers=dict(_response.headers),
498
+ body=_response.text,
499
+ )
500
+ raise ApiError(
501
+ status_code=_response.status_code,
502
+ headers=dict(_response.headers),
503
+ body=_response_json,
504
+ )
505
+
506
+
507
+ class AsyncRawBlobStorageIntegrationsClient:
508
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
509
+ self._client_wrapper = client_wrapper
510
+
511
+ async def get_blob_storage_integrations(
512
+ self, *, request_options: typing.Optional[RequestOptions] = None
513
+ ) -> AsyncHttpResponse[BlobStorageIntegrationsResponse]:
514
+ """
515
+ Get all blob storage integrations for the organization (requires organization-scoped API key)
516
+
517
+ Parameters
518
+ ----------
519
+ request_options : typing.Optional[RequestOptions]
520
+ Request-specific configuration.
521
+
522
+ Returns
523
+ -------
524
+ AsyncHttpResponse[BlobStorageIntegrationsResponse]
525
+ """
526
+ _response = await self._client_wrapper.httpx_client.request(
527
+ "api/public/integrations/blob-storage",
528
+ method="GET",
529
+ request_options=request_options,
530
+ )
531
+ try:
532
+ if 200 <= _response.status_code < 300:
533
+ _data = typing.cast(
534
+ BlobStorageIntegrationsResponse,
535
+ parse_obj_as(
536
+ type_=BlobStorageIntegrationsResponse, # type: ignore
537
+ object_=_response.json(),
538
+ ),
539
+ )
540
+ return AsyncHttpResponse(response=_response, data=_data)
541
+ if _response.status_code == 400:
542
+ raise Error(
543
+ headers=dict(_response.headers),
544
+ body=typing.cast(
545
+ typing.Any,
546
+ parse_obj_as(
547
+ type_=typing.Any, # type: ignore
548
+ object_=_response.json(),
549
+ ),
550
+ ),
551
+ )
552
+ if _response.status_code == 401:
553
+ raise UnauthorizedError(
554
+ headers=dict(_response.headers),
555
+ body=typing.cast(
556
+ typing.Any,
557
+ parse_obj_as(
558
+ type_=typing.Any, # type: ignore
559
+ object_=_response.json(),
560
+ ),
561
+ ),
562
+ )
563
+ if _response.status_code == 403:
564
+ raise AccessDeniedError(
565
+ headers=dict(_response.headers),
566
+ body=typing.cast(
567
+ typing.Any,
568
+ parse_obj_as(
569
+ type_=typing.Any, # type: ignore
570
+ object_=_response.json(),
571
+ ),
572
+ ),
573
+ )
574
+ if _response.status_code == 405:
575
+ raise MethodNotAllowedError(
576
+ headers=dict(_response.headers),
577
+ body=typing.cast(
578
+ typing.Any,
579
+ parse_obj_as(
580
+ type_=typing.Any, # type: ignore
581
+ object_=_response.json(),
582
+ ),
583
+ ),
584
+ )
585
+ if _response.status_code == 404:
586
+ raise NotFoundError(
587
+ headers=dict(_response.headers),
588
+ body=typing.cast(
589
+ typing.Any,
590
+ parse_obj_as(
591
+ type_=typing.Any, # type: ignore
592
+ object_=_response.json(),
593
+ ),
594
+ ),
595
+ )
596
+ _response_json = _response.json()
597
+ except JSONDecodeError:
598
+ raise ApiError(
599
+ status_code=_response.status_code,
600
+ headers=dict(_response.headers),
601
+ body=_response.text,
602
+ )
603
+ raise ApiError(
604
+ status_code=_response.status_code,
605
+ headers=dict(_response.headers),
606
+ body=_response_json,
607
+ )
608
+
609
+ async def upsert_blob_storage_integration(
610
+ self,
611
+ *,
612
+ project_id: str,
613
+ type: BlobStorageIntegrationType,
614
+ bucket_name: str,
615
+ region: str,
616
+ export_frequency: BlobStorageExportFrequency,
617
+ enabled: bool,
618
+ force_path_style: bool,
619
+ file_type: BlobStorageIntegrationFileType,
620
+ export_mode: BlobStorageExportMode,
621
+ endpoint: typing.Optional[str] = OMIT,
622
+ access_key_id: typing.Optional[str] = OMIT,
623
+ secret_access_key: typing.Optional[str] = OMIT,
624
+ prefix: typing.Optional[str] = OMIT,
625
+ export_start_date: typing.Optional[dt.datetime] = OMIT,
626
+ request_options: typing.Optional[RequestOptions] = None,
627
+ ) -> AsyncHttpResponse[BlobStorageIntegrationResponse]:
628
+ """
629
+ Create or update a blob storage integration for a specific project (requires organization-scoped API key). The configuration is validated by performing a test upload to the bucket.
630
+
631
+ Parameters
632
+ ----------
633
+ project_id : str
634
+ ID of the project in which to configure the blob storage integration
635
+
636
+ type : BlobStorageIntegrationType
637
+
638
+ bucket_name : str
639
+ Name of the storage bucket
640
+
641
+ region : str
642
+ Storage region
643
+
644
+ export_frequency : BlobStorageExportFrequency
645
+
646
+ enabled : bool
647
+ Whether the integration is active
648
+
649
+ force_path_style : bool
650
+ Use path-style URLs for S3 requests
651
+
652
+ file_type : BlobStorageIntegrationFileType
653
+
654
+ export_mode : BlobStorageExportMode
655
+
656
+ endpoint : typing.Optional[str]
657
+ Custom endpoint URL (required for S3_COMPATIBLE type)
658
+
659
+ access_key_id : typing.Optional[str]
660
+ Access key ID for authentication
661
+
662
+ secret_access_key : typing.Optional[str]
663
+ Secret access key for authentication (will be encrypted when stored)
664
+
665
+ prefix : typing.Optional[str]
666
+ Path prefix for exported files (must end with forward slash if provided)
667
+
668
+ export_start_date : typing.Optional[dt.datetime]
669
+ Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
670
+
671
+ request_options : typing.Optional[RequestOptions]
672
+ Request-specific configuration.
673
+
674
+ Returns
675
+ -------
676
+ AsyncHttpResponse[BlobStorageIntegrationResponse]
677
+ """
678
+ _response = await self._client_wrapper.httpx_client.request(
679
+ "api/public/integrations/blob-storage",
680
+ method="PUT",
681
+ json={
682
+ "projectId": project_id,
683
+ "type": type,
684
+ "bucketName": bucket_name,
685
+ "endpoint": endpoint,
686
+ "region": region,
687
+ "accessKeyId": access_key_id,
688
+ "secretAccessKey": secret_access_key,
689
+ "prefix": prefix,
690
+ "exportFrequency": export_frequency,
691
+ "enabled": enabled,
692
+ "forcePathStyle": force_path_style,
693
+ "fileType": file_type,
694
+ "exportMode": export_mode,
695
+ "exportStartDate": export_start_date,
696
+ },
697
+ request_options=request_options,
698
+ omit=OMIT,
699
+ )
700
+ try:
701
+ if 200 <= _response.status_code < 300:
702
+ _data = typing.cast(
703
+ BlobStorageIntegrationResponse,
704
+ parse_obj_as(
705
+ type_=BlobStorageIntegrationResponse, # type: ignore
706
+ object_=_response.json(),
707
+ ),
708
+ )
709
+ return AsyncHttpResponse(response=_response, data=_data)
710
+ if _response.status_code == 400:
711
+ raise Error(
712
+ headers=dict(_response.headers),
713
+ body=typing.cast(
714
+ typing.Any,
715
+ parse_obj_as(
716
+ type_=typing.Any, # type: ignore
717
+ object_=_response.json(),
718
+ ),
719
+ ),
720
+ )
721
+ if _response.status_code == 401:
722
+ raise UnauthorizedError(
723
+ headers=dict(_response.headers),
724
+ body=typing.cast(
725
+ typing.Any,
726
+ parse_obj_as(
727
+ type_=typing.Any, # type: ignore
728
+ object_=_response.json(),
729
+ ),
730
+ ),
731
+ )
732
+ if _response.status_code == 403:
733
+ raise AccessDeniedError(
734
+ headers=dict(_response.headers),
735
+ body=typing.cast(
736
+ typing.Any,
737
+ parse_obj_as(
738
+ type_=typing.Any, # type: ignore
739
+ object_=_response.json(),
740
+ ),
741
+ ),
742
+ )
743
+ if _response.status_code == 405:
744
+ raise MethodNotAllowedError(
745
+ headers=dict(_response.headers),
746
+ body=typing.cast(
747
+ typing.Any,
748
+ parse_obj_as(
749
+ type_=typing.Any, # type: ignore
750
+ object_=_response.json(),
751
+ ),
752
+ ),
753
+ )
754
+ if _response.status_code == 404:
755
+ raise NotFoundError(
756
+ headers=dict(_response.headers),
757
+ body=typing.cast(
758
+ typing.Any,
759
+ parse_obj_as(
760
+ type_=typing.Any, # type: ignore
761
+ object_=_response.json(),
762
+ ),
763
+ ),
764
+ )
765
+ _response_json = _response.json()
766
+ except JSONDecodeError:
767
+ raise ApiError(
768
+ status_code=_response.status_code,
769
+ headers=dict(_response.headers),
770
+ body=_response.text,
771
+ )
772
+ raise ApiError(
773
+ status_code=_response.status_code,
774
+ headers=dict(_response.headers),
775
+ body=_response_json,
776
+ )
777
+
778
+ async def get_blob_storage_integration_status(
779
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
780
+ ) -> AsyncHttpResponse[BlobStorageIntegrationStatusResponse]:
781
+ """
782
+ Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)
783
+
784
+ Parameters
785
+ ----------
786
+ id : str
787
+
788
+ request_options : typing.Optional[RequestOptions]
789
+ Request-specific configuration.
790
+
791
+ Returns
792
+ -------
793
+ AsyncHttpResponse[BlobStorageIntegrationStatusResponse]
794
+ """
795
+ _response = await self._client_wrapper.httpx_client.request(
796
+ f"api/public/integrations/blob-storage/{jsonable_encoder(id)}",
797
+ method="GET",
798
+ request_options=request_options,
799
+ )
800
+ try:
801
+ if 200 <= _response.status_code < 300:
802
+ _data = typing.cast(
803
+ BlobStorageIntegrationStatusResponse,
804
+ parse_obj_as(
805
+ type_=BlobStorageIntegrationStatusResponse, # type: ignore
806
+ object_=_response.json(),
807
+ ),
808
+ )
809
+ return AsyncHttpResponse(response=_response, data=_data)
810
+ if _response.status_code == 400:
811
+ raise Error(
812
+ headers=dict(_response.headers),
813
+ body=typing.cast(
814
+ typing.Any,
815
+ parse_obj_as(
816
+ type_=typing.Any, # type: ignore
817
+ object_=_response.json(),
818
+ ),
819
+ ),
820
+ )
821
+ if _response.status_code == 401:
822
+ raise UnauthorizedError(
823
+ headers=dict(_response.headers),
824
+ body=typing.cast(
825
+ typing.Any,
826
+ parse_obj_as(
827
+ type_=typing.Any, # type: ignore
828
+ object_=_response.json(),
829
+ ),
830
+ ),
831
+ )
832
+ if _response.status_code == 403:
833
+ raise AccessDeniedError(
834
+ headers=dict(_response.headers),
835
+ body=typing.cast(
836
+ typing.Any,
837
+ parse_obj_as(
838
+ type_=typing.Any, # type: ignore
839
+ object_=_response.json(),
840
+ ),
841
+ ),
842
+ )
843
+ if _response.status_code == 405:
844
+ raise MethodNotAllowedError(
845
+ headers=dict(_response.headers),
846
+ body=typing.cast(
847
+ typing.Any,
848
+ parse_obj_as(
849
+ type_=typing.Any, # type: ignore
850
+ object_=_response.json(),
851
+ ),
852
+ ),
853
+ )
854
+ if _response.status_code == 404:
855
+ raise NotFoundError(
856
+ headers=dict(_response.headers),
857
+ body=typing.cast(
858
+ typing.Any,
859
+ parse_obj_as(
860
+ type_=typing.Any, # type: ignore
861
+ object_=_response.json(),
862
+ ),
863
+ ),
864
+ )
865
+ _response_json = _response.json()
866
+ except JSONDecodeError:
867
+ raise ApiError(
868
+ status_code=_response.status_code,
869
+ headers=dict(_response.headers),
870
+ body=_response.text,
871
+ )
872
+ raise ApiError(
873
+ status_code=_response.status_code,
874
+ headers=dict(_response.headers),
875
+ body=_response_json,
876
+ )
877
+
878
+ async def delete_blob_storage_integration(
879
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
880
+ ) -> AsyncHttpResponse[BlobStorageIntegrationDeletionResponse]:
881
+ """
882
+ Delete a blob storage integration by ID (requires organization-scoped API key)
883
+
884
+ Parameters
885
+ ----------
886
+ id : str
887
+
888
+ request_options : typing.Optional[RequestOptions]
889
+ Request-specific configuration.
890
+
891
+ Returns
892
+ -------
893
+ AsyncHttpResponse[BlobStorageIntegrationDeletionResponse]
894
+ """
895
+ _response = await self._client_wrapper.httpx_client.request(
896
+ f"api/public/integrations/blob-storage/{jsonable_encoder(id)}",
897
+ method="DELETE",
898
+ request_options=request_options,
899
+ )
900
+ try:
901
+ if 200 <= _response.status_code < 300:
902
+ _data = typing.cast(
903
+ BlobStorageIntegrationDeletionResponse,
904
+ parse_obj_as(
905
+ type_=BlobStorageIntegrationDeletionResponse, # type: ignore
906
+ object_=_response.json(),
907
+ ),
908
+ )
909
+ return AsyncHttpResponse(response=_response, data=_data)
910
+ if _response.status_code == 400:
911
+ raise Error(
912
+ headers=dict(_response.headers),
913
+ body=typing.cast(
914
+ typing.Any,
915
+ parse_obj_as(
916
+ type_=typing.Any, # type: ignore
917
+ object_=_response.json(),
918
+ ),
919
+ ),
920
+ )
921
+ if _response.status_code == 401:
922
+ raise UnauthorizedError(
923
+ headers=dict(_response.headers),
924
+ body=typing.cast(
925
+ typing.Any,
926
+ parse_obj_as(
927
+ type_=typing.Any, # type: ignore
928
+ object_=_response.json(),
929
+ ),
930
+ ),
931
+ )
932
+ if _response.status_code == 403:
933
+ raise AccessDeniedError(
934
+ headers=dict(_response.headers),
935
+ body=typing.cast(
936
+ typing.Any,
937
+ parse_obj_as(
938
+ type_=typing.Any, # type: ignore
939
+ object_=_response.json(),
940
+ ),
941
+ ),
942
+ )
943
+ if _response.status_code == 405:
944
+ raise MethodNotAllowedError(
945
+ headers=dict(_response.headers),
946
+ body=typing.cast(
947
+ typing.Any,
948
+ parse_obj_as(
949
+ type_=typing.Any, # type: ignore
950
+ object_=_response.json(),
951
+ ),
952
+ ),
953
+ )
954
+ if _response.status_code == 404:
955
+ raise NotFoundError(
956
+ headers=dict(_response.headers),
957
+ body=typing.cast(
958
+ typing.Any,
959
+ parse_obj_as(
960
+ type_=typing.Any, # type: ignore
961
+ object_=_response.json(),
962
+ ),
963
+ ),
964
+ )
965
+ _response_json = _response.json()
966
+ except JSONDecodeError:
967
+ raise ApiError(
968
+ status_code=_response.status_code,
969
+ headers=dict(_response.headers),
970
+ body=_response.text,
971
+ )
972
+ raise ApiError(
973
+ status_code=_response.status_code,
974
+ headers=dict(_response.headers),
975
+ body=_response_json,
976
+ )