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,541 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..commons.errors.access_denied_error import AccessDeniedError
7
+ from ..commons.errors.error import Error
8
+ from ..commons.errors.method_not_allowed_error import MethodNotAllowedError
9
+ from ..commons.errors.not_found_error import NotFoundError
10
+ from ..commons.errors.unauthorized_error import UnauthorizedError
11
+ from ..core.api_error import ApiError
12
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
13
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
14
+ from ..core.pydantic_utilities import parse_obj_as
15
+ from ..core.request_options import RequestOptions
16
+ from .types.llm_adapter import LlmAdapter
17
+ from .types.llm_connection import LlmConnection
18
+ from .types.paginated_llm_connections import PaginatedLlmConnections
19
+
20
+ # this is used as the default value for optional parameters
21
+ OMIT = typing.cast(typing.Any, ...)
22
+
23
+
24
+ class RawLlmConnectionsClient:
25
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
26
+ self._client_wrapper = client_wrapper
27
+
28
+ def list(
29
+ self,
30
+ *,
31
+ page: typing.Optional[int] = None,
32
+ limit: typing.Optional[int] = None,
33
+ request_options: typing.Optional[RequestOptions] = None,
34
+ ) -> HttpResponse[PaginatedLlmConnections]:
35
+ """
36
+ Get all LLM connections in a project
37
+
38
+ Parameters
39
+ ----------
40
+ page : typing.Optional[int]
41
+ page number, starts at 1
42
+
43
+ limit : typing.Optional[int]
44
+ limit of items per page
45
+
46
+ request_options : typing.Optional[RequestOptions]
47
+ Request-specific configuration.
48
+
49
+ Returns
50
+ -------
51
+ HttpResponse[PaginatedLlmConnections]
52
+ """
53
+ _response = self._client_wrapper.httpx_client.request(
54
+ "api/public/llm-connections",
55
+ method="GET",
56
+ params={
57
+ "page": page,
58
+ "limit": limit,
59
+ },
60
+ request_options=request_options,
61
+ )
62
+ try:
63
+ if 200 <= _response.status_code < 300:
64
+ _data = typing.cast(
65
+ PaginatedLlmConnections,
66
+ parse_obj_as(
67
+ type_=PaginatedLlmConnections, # type: ignore
68
+ object_=_response.json(),
69
+ ),
70
+ )
71
+ return HttpResponse(response=_response, data=_data)
72
+ if _response.status_code == 400:
73
+ raise Error(
74
+ headers=dict(_response.headers),
75
+ body=typing.cast(
76
+ typing.Any,
77
+ parse_obj_as(
78
+ type_=typing.Any, # type: ignore
79
+ object_=_response.json(),
80
+ ),
81
+ ),
82
+ )
83
+ if _response.status_code == 401:
84
+ raise UnauthorizedError(
85
+ headers=dict(_response.headers),
86
+ body=typing.cast(
87
+ typing.Any,
88
+ parse_obj_as(
89
+ type_=typing.Any, # type: ignore
90
+ object_=_response.json(),
91
+ ),
92
+ ),
93
+ )
94
+ if _response.status_code == 403:
95
+ raise AccessDeniedError(
96
+ headers=dict(_response.headers),
97
+ body=typing.cast(
98
+ typing.Any,
99
+ parse_obj_as(
100
+ type_=typing.Any, # type: ignore
101
+ object_=_response.json(),
102
+ ),
103
+ ),
104
+ )
105
+ if _response.status_code == 405:
106
+ raise MethodNotAllowedError(
107
+ headers=dict(_response.headers),
108
+ body=typing.cast(
109
+ typing.Any,
110
+ parse_obj_as(
111
+ type_=typing.Any, # type: ignore
112
+ object_=_response.json(),
113
+ ),
114
+ ),
115
+ )
116
+ if _response.status_code == 404:
117
+ raise NotFoundError(
118
+ headers=dict(_response.headers),
119
+ body=typing.cast(
120
+ typing.Any,
121
+ parse_obj_as(
122
+ type_=typing.Any, # type: ignore
123
+ object_=_response.json(),
124
+ ),
125
+ ),
126
+ )
127
+ _response_json = _response.json()
128
+ except JSONDecodeError:
129
+ raise ApiError(
130
+ status_code=_response.status_code,
131
+ headers=dict(_response.headers),
132
+ body=_response.text,
133
+ )
134
+ raise ApiError(
135
+ status_code=_response.status_code,
136
+ headers=dict(_response.headers),
137
+ body=_response_json,
138
+ )
139
+
140
+ def upsert(
141
+ self,
142
+ *,
143
+ provider: str,
144
+ adapter: LlmAdapter,
145
+ secret_key: str,
146
+ base_url: typing.Optional[str] = OMIT,
147
+ custom_models: typing.Optional[typing.Sequence[str]] = OMIT,
148
+ with_default_models: typing.Optional[bool] = OMIT,
149
+ extra_headers: typing.Optional[typing.Dict[str, str]] = OMIT,
150
+ config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
151
+ request_options: typing.Optional[RequestOptions] = None,
152
+ ) -> HttpResponse[LlmConnection]:
153
+ """
154
+ Create or update an LLM connection. The connection is upserted on provider.
155
+
156
+ Parameters
157
+ ----------
158
+ provider : str
159
+ Provider name (e.g., 'openai', 'my-gateway'). Must be unique in project, used for upserting.
160
+
161
+ adapter : LlmAdapter
162
+ The adapter used to interface with the LLM
163
+
164
+ secret_key : str
165
+ Secret key for the LLM API.
166
+
167
+ base_url : typing.Optional[str]
168
+ Custom base URL for the LLM API
169
+
170
+ custom_models : typing.Optional[typing.Sequence[str]]
171
+ List of custom model names
172
+
173
+ with_default_models : typing.Optional[bool]
174
+ Whether to include default models. Default is true.
175
+
176
+ extra_headers : typing.Optional[typing.Dict[str, str]]
177
+ Extra headers to send with requests
178
+
179
+ config : typing.Optional[typing.Dict[str, typing.Any]]
180
+ Adapter-specific configuration. Validation rules: - **Bedrock**: Required. Must be `{"region": "<aws-region>"}` (e.g., `{"region":"us-east-1"}`) - **VertexAI**: Optional. If provided, must be `{"location": "<gcp-location>"}` (e.g., `{"location":"us-central1"}`) - **Other adapters**: Not supported. Omit this field or set to null.
181
+
182
+ request_options : typing.Optional[RequestOptions]
183
+ Request-specific configuration.
184
+
185
+ Returns
186
+ -------
187
+ HttpResponse[LlmConnection]
188
+ """
189
+ _response = self._client_wrapper.httpx_client.request(
190
+ "api/public/llm-connections",
191
+ method="PUT",
192
+ json={
193
+ "provider": provider,
194
+ "adapter": adapter,
195
+ "secretKey": secret_key,
196
+ "baseURL": base_url,
197
+ "customModels": custom_models,
198
+ "withDefaultModels": with_default_models,
199
+ "extraHeaders": extra_headers,
200
+ "config": config,
201
+ },
202
+ request_options=request_options,
203
+ omit=OMIT,
204
+ )
205
+ try:
206
+ if 200 <= _response.status_code < 300:
207
+ _data = typing.cast(
208
+ LlmConnection,
209
+ parse_obj_as(
210
+ type_=LlmConnection, # type: ignore
211
+ object_=_response.json(),
212
+ ),
213
+ )
214
+ return HttpResponse(response=_response, data=_data)
215
+ if _response.status_code == 400:
216
+ raise Error(
217
+ headers=dict(_response.headers),
218
+ body=typing.cast(
219
+ typing.Any,
220
+ parse_obj_as(
221
+ type_=typing.Any, # type: ignore
222
+ object_=_response.json(),
223
+ ),
224
+ ),
225
+ )
226
+ if _response.status_code == 401:
227
+ raise UnauthorizedError(
228
+ headers=dict(_response.headers),
229
+ body=typing.cast(
230
+ typing.Any,
231
+ parse_obj_as(
232
+ type_=typing.Any, # type: ignore
233
+ object_=_response.json(),
234
+ ),
235
+ ),
236
+ )
237
+ if _response.status_code == 403:
238
+ raise AccessDeniedError(
239
+ headers=dict(_response.headers),
240
+ body=typing.cast(
241
+ typing.Any,
242
+ parse_obj_as(
243
+ type_=typing.Any, # type: ignore
244
+ object_=_response.json(),
245
+ ),
246
+ ),
247
+ )
248
+ if _response.status_code == 405:
249
+ raise MethodNotAllowedError(
250
+ headers=dict(_response.headers),
251
+ body=typing.cast(
252
+ typing.Any,
253
+ parse_obj_as(
254
+ type_=typing.Any, # type: ignore
255
+ object_=_response.json(),
256
+ ),
257
+ ),
258
+ )
259
+ if _response.status_code == 404:
260
+ raise NotFoundError(
261
+ headers=dict(_response.headers),
262
+ body=typing.cast(
263
+ typing.Any,
264
+ parse_obj_as(
265
+ type_=typing.Any, # type: ignore
266
+ object_=_response.json(),
267
+ ),
268
+ ),
269
+ )
270
+ _response_json = _response.json()
271
+ except JSONDecodeError:
272
+ raise ApiError(
273
+ status_code=_response.status_code,
274
+ headers=dict(_response.headers),
275
+ body=_response.text,
276
+ )
277
+ raise ApiError(
278
+ status_code=_response.status_code,
279
+ headers=dict(_response.headers),
280
+ body=_response_json,
281
+ )
282
+
283
+
284
+ class AsyncRawLlmConnectionsClient:
285
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
286
+ self._client_wrapper = client_wrapper
287
+
288
+ async def list(
289
+ self,
290
+ *,
291
+ page: typing.Optional[int] = None,
292
+ limit: typing.Optional[int] = None,
293
+ request_options: typing.Optional[RequestOptions] = None,
294
+ ) -> AsyncHttpResponse[PaginatedLlmConnections]:
295
+ """
296
+ Get all LLM connections in a project
297
+
298
+ Parameters
299
+ ----------
300
+ page : typing.Optional[int]
301
+ page number, starts at 1
302
+
303
+ limit : typing.Optional[int]
304
+ limit of items per page
305
+
306
+ request_options : typing.Optional[RequestOptions]
307
+ Request-specific configuration.
308
+
309
+ Returns
310
+ -------
311
+ AsyncHttpResponse[PaginatedLlmConnections]
312
+ """
313
+ _response = await self._client_wrapper.httpx_client.request(
314
+ "api/public/llm-connections",
315
+ method="GET",
316
+ params={
317
+ "page": page,
318
+ "limit": limit,
319
+ },
320
+ request_options=request_options,
321
+ )
322
+ try:
323
+ if 200 <= _response.status_code < 300:
324
+ _data = typing.cast(
325
+ PaginatedLlmConnections,
326
+ parse_obj_as(
327
+ type_=PaginatedLlmConnections, # type: ignore
328
+ object_=_response.json(),
329
+ ),
330
+ )
331
+ return AsyncHttpResponse(response=_response, data=_data)
332
+ if _response.status_code == 400:
333
+ raise Error(
334
+ headers=dict(_response.headers),
335
+ body=typing.cast(
336
+ typing.Any,
337
+ parse_obj_as(
338
+ type_=typing.Any, # type: ignore
339
+ object_=_response.json(),
340
+ ),
341
+ ),
342
+ )
343
+ if _response.status_code == 401:
344
+ raise UnauthorizedError(
345
+ headers=dict(_response.headers),
346
+ body=typing.cast(
347
+ typing.Any,
348
+ parse_obj_as(
349
+ type_=typing.Any, # type: ignore
350
+ object_=_response.json(),
351
+ ),
352
+ ),
353
+ )
354
+ if _response.status_code == 403:
355
+ raise AccessDeniedError(
356
+ headers=dict(_response.headers),
357
+ body=typing.cast(
358
+ typing.Any,
359
+ parse_obj_as(
360
+ type_=typing.Any, # type: ignore
361
+ object_=_response.json(),
362
+ ),
363
+ ),
364
+ )
365
+ if _response.status_code == 405:
366
+ raise MethodNotAllowedError(
367
+ headers=dict(_response.headers),
368
+ body=typing.cast(
369
+ typing.Any,
370
+ parse_obj_as(
371
+ type_=typing.Any, # type: ignore
372
+ object_=_response.json(),
373
+ ),
374
+ ),
375
+ )
376
+ if _response.status_code == 404:
377
+ raise NotFoundError(
378
+ headers=dict(_response.headers),
379
+ body=typing.cast(
380
+ typing.Any,
381
+ parse_obj_as(
382
+ type_=typing.Any, # type: ignore
383
+ object_=_response.json(),
384
+ ),
385
+ ),
386
+ )
387
+ _response_json = _response.json()
388
+ except JSONDecodeError:
389
+ raise ApiError(
390
+ status_code=_response.status_code,
391
+ headers=dict(_response.headers),
392
+ body=_response.text,
393
+ )
394
+ raise ApiError(
395
+ status_code=_response.status_code,
396
+ headers=dict(_response.headers),
397
+ body=_response_json,
398
+ )
399
+
400
+ async def upsert(
401
+ self,
402
+ *,
403
+ provider: str,
404
+ adapter: LlmAdapter,
405
+ secret_key: str,
406
+ base_url: typing.Optional[str] = OMIT,
407
+ custom_models: typing.Optional[typing.Sequence[str]] = OMIT,
408
+ with_default_models: typing.Optional[bool] = OMIT,
409
+ extra_headers: typing.Optional[typing.Dict[str, str]] = OMIT,
410
+ config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
411
+ request_options: typing.Optional[RequestOptions] = None,
412
+ ) -> AsyncHttpResponse[LlmConnection]:
413
+ """
414
+ Create or update an LLM connection. The connection is upserted on provider.
415
+
416
+ Parameters
417
+ ----------
418
+ provider : str
419
+ Provider name (e.g., 'openai', 'my-gateway'). Must be unique in project, used for upserting.
420
+
421
+ adapter : LlmAdapter
422
+ The adapter used to interface with the LLM
423
+
424
+ secret_key : str
425
+ Secret key for the LLM API.
426
+
427
+ base_url : typing.Optional[str]
428
+ Custom base URL for the LLM API
429
+
430
+ custom_models : typing.Optional[typing.Sequence[str]]
431
+ List of custom model names
432
+
433
+ with_default_models : typing.Optional[bool]
434
+ Whether to include default models. Default is true.
435
+
436
+ extra_headers : typing.Optional[typing.Dict[str, str]]
437
+ Extra headers to send with requests
438
+
439
+ config : typing.Optional[typing.Dict[str, typing.Any]]
440
+ Adapter-specific configuration. Validation rules: - **Bedrock**: Required. Must be `{"region": "<aws-region>"}` (e.g., `{"region":"us-east-1"}`) - **VertexAI**: Optional. If provided, must be `{"location": "<gcp-location>"}` (e.g., `{"location":"us-central1"}`) - **Other adapters**: Not supported. Omit this field or set to null.
441
+
442
+ request_options : typing.Optional[RequestOptions]
443
+ Request-specific configuration.
444
+
445
+ Returns
446
+ -------
447
+ AsyncHttpResponse[LlmConnection]
448
+ """
449
+ _response = await self._client_wrapper.httpx_client.request(
450
+ "api/public/llm-connections",
451
+ method="PUT",
452
+ json={
453
+ "provider": provider,
454
+ "adapter": adapter,
455
+ "secretKey": secret_key,
456
+ "baseURL": base_url,
457
+ "customModels": custom_models,
458
+ "withDefaultModels": with_default_models,
459
+ "extraHeaders": extra_headers,
460
+ "config": config,
461
+ },
462
+ request_options=request_options,
463
+ omit=OMIT,
464
+ )
465
+ try:
466
+ if 200 <= _response.status_code < 300:
467
+ _data = typing.cast(
468
+ LlmConnection,
469
+ parse_obj_as(
470
+ type_=LlmConnection, # type: ignore
471
+ object_=_response.json(),
472
+ ),
473
+ )
474
+ return AsyncHttpResponse(response=_response, data=_data)
475
+ if _response.status_code == 400:
476
+ raise Error(
477
+ headers=dict(_response.headers),
478
+ body=typing.cast(
479
+ typing.Any,
480
+ parse_obj_as(
481
+ type_=typing.Any, # type: ignore
482
+ object_=_response.json(),
483
+ ),
484
+ ),
485
+ )
486
+ if _response.status_code == 401:
487
+ raise UnauthorizedError(
488
+ headers=dict(_response.headers),
489
+ body=typing.cast(
490
+ typing.Any,
491
+ parse_obj_as(
492
+ type_=typing.Any, # type: ignore
493
+ object_=_response.json(),
494
+ ),
495
+ ),
496
+ )
497
+ if _response.status_code == 403:
498
+ raise AccessDeniedError(
499
+ headers=dict(_response.headers),
500
+ body=typing.cast(
501
+ typing.Any,
502
+ parse_obj_as(
503
+ type_=typing.Any, # type: ignore
504
+ object_=_response.json(),
505
+ ),
506
+ ),
507
+ )
508
+ if _response.status_code == 405:
509
+ raise MethodNotAllowedError(
510
+ headers=dict(_response.headers),
511
+ body=typing.cast(
512
+ typing.Any,
513
+ parse_obj_as(
514
+ type_=typing.Any, # type: ignore
515
+ object_=_response.json(),
516
+ ),
517
+ ),
518
+ )
519
+ if _response.status_code == 404:
520
+ raise NotFoundError(
521
+ headers=dict(_response.headers),
522
+ body=typing.cast(
523
+ typing.Any,
524
+ parse_obj_as(
525
+ type_=typing.Any, # type: ignore
526
+ object_=_response.json(),
527
+ ),
528
+ ),
529
+ )
530
+ _response_json = _response.json()
531
+ except JSONDecodeError:
532
+ raise ApiError(
533
+ status_code=_response.status_code,
534
+ headers=dict(_response.headers),
535
+ body=_response.text,
536
+ )
537
+ raise ApiError(
538
+ status_code=_response.status_code,
539
+ headers=dict(_response.headers),
540
+ body=_response_json,
541
+ )
@@ -0,0 +1,53 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .llm_adapter import LlmAdapter
10
+ from .llm_connection import LlmConnection
11
+ from .paginated_llm_connections import PaginatedLlmConnections
12
+ from .upsert_llm_connection_request import UpsertLlmConnectionRequest
13
+ _dynamic_imports: typing.Dict[str, str] = {
14
+ "LlmAdapter": ".llm_adapter",
15
+ "LlmConnection": ".llm_connection",
16
+ "PaginatedLlmConnections": ".paginated_llm_connections",
17
+ "UpsertLlmConnectionRequest": ".upsert_llm_connection_request",
18
+ }
19
+
20
+
21
+ def __getattr__(attr_name: str) -> typing.Any:
22
+ module_name = _dynamic_imports.get(attr_name)
23
+ if module_name is None:
24
+ raise AttributeError(
25
+ f"No {attr_name} found in _dynamic_imports for module name -> {__name__}"
26
+ )
27
+ try:
28
+ module = import_module(module_name, __package__)
29
+ if module_name == f".{attr_name}":
30
+ return module
31
+ else:
32
+ return getattr(module, attr_name)
33
+ except ImportError as e:
34
+ raise ImportError(
35
+ f"Failed to import {attr_name} from {module_name}: {e}"
36
+ ) from e
37
+ except AttributeError as e:
38
+ raise AttributeError(
39
+ f"Failed to get {attr_name} from {module_name}: {e}"
40
+ ) from e
41
+
42
+
43
+ def __dir__():
44
+ lazy_attrs = list(_dynamic_imports.keys())
45
+ return sorted(lazy_attrs)
46
+
47
+
48
+ __all__ = [
49
+ "LlmAdapter",
50
+ "LlmConnection",
51
+ "PaginatedLlmConnections",
52
+ "UpsertLlmConnectionRequest",
53
+ ]
@@ -0,0 +1,38 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ...core import enum
6
+
7
+ T_Result = typing.TypeVar("T_Result")
8
+
9
+
10
+ class LlmAdapter(enum.StrEnum):
11
+ ANTHROPIC = "anthropic"
12
+ OPEN_AI = "openai"
13
+ AZURE = "azure"
14
+ BEDROCK = "bedrock"
15
+ GOOGLE_VERTEX_AI = "google-vertex-ai"
16
+ GOOGLE_AI_STUDIO = "google-ai-studio"
17
+
18
+ def visit(
19
+ self,
20
+ anthropic: typing.Callable[[], T_Result],
21
+ open_ai: typing.Callable[[], T_Result],
22
+ azure: typing.Callable[[], T_Result],
23
+ bedrock: typing.Callable[[], T_Result],
24
+ google_vertex_ai: typing.Callable[[], T_Result],
25
+ google_ai_studio: typing.Callable[[], T_Result],
26
+ ) -> T_Result:
27
+ if self is LlmAdapter.ANTHROPIC:
28
+ return anthropic()
29
+ if self is LlmAdapter.OPEN_AI:
30
+ return open_ai()
31
+ if self is LlmAdapter.AZURE:
32
+ return azure()
33
+ if self is LlmAdapter.BEDROCK:
34
+ return bedrock()
35
+ if self is LlmAdapter.GOOGLE_VERTEX_AI:
36
+ return google_vertex_ai()
37
+ if self is LlmAdapter.GOOGLE_AI_STUDIO:
38
+ return google_ai_studio()