mirascope 2.0.0a5__py3-none-any.whl → 2.0.1__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 (349) hide show
  1. mirascope/__init__.py +10 -1
  2. mirascope/_stubs.py +363 -0
  3. mirascope/api/__init__.py +8 -0
  4. mirascope/api/_generated/__init__.py +285 -2
  5. mirascope/api/_generated/annotations/__init__.py +33 -0
  6. mirascope/api/_generated/annotations/client.py +506 -0
  7. mirascope/api/_generated/annotations/raw_client.py +1414 -0
  8. mirascope/api/_generated/annotations/types/__init__.py +31 -0
  9. mirascope/api/_generated/annotations/types/annotations_create_request_label.py +5 -0
  10. mirascope/api/_generated/annotations/types/annotations_create_response.py +48 -0
  11. mirascope/api/_generated/annotations/types/annotations_create_response_label.py +5 -0
  12. mirascope/api/_generated/annotations/types/annotations_get_response.py +48 -0
  13. mirascope/api/_generated/annotations/types/annotations_get_response_label.py +5 -0
  14. mirascope/api/_generated/annotations/types/annotations_list_request_label.py +5 -0
  15. mirascope/api/_generated/annotations/types/annotations_list_response.py +21 -0
  16. mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item.py +50 -0
  17. mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item_label.py +5 -0
  18. mirascope/api/_generated/annotations/types/annotations_update_request_label.py +5 -0
  19. mirascope/api/_generated/annotations/types/annotations_update_response.py +48 -0
  20. mirascope/api/_generated/annotations/types/annotations_update_response_label.py +5 -0
  21. mirascope/api/_generated/api_keys/__init__.py +12 -2
  22. mirascope/api/_generated/api_keys/client.py +77 -0
  23. mirascope/api/_generated/api_keys/raw_client.py +422 -39
  24. mirascope/api/_generated/api_keys/types/__init__.py +7 -1
  25. mirascope/api/_generated/api_keys/types/api_keys_create_response.py +4 -12
  26. mirascope/api/_generated/api_keys/types/api_keys_get_response.py +4 -12
  27. mirascope/api/_generated/api_keys/types/api_keys_list_all_for_org_response_item.py +40 -0
  28. mirascope/api/_generated/api_keys/types/api_keys_list_response_item.py +4 -12
  29. mirascope/api/_generated/client.py +42 -0
  30. mirascope/api/_generated/core/client_wrapper.py +2 -14
  31. mirascope/api/_generated/core/datetime_utils.py +1 -3
  32. mirascope/api/_generated/core/file.py +2 -5
  33. mirascope/api/_generated/core/http_client.py +36 -112
  34. mirascope/api/_generated/core/jsonable_encoder.py +1 -3
  35. mirascope/api/_generated/core/pydantic_utilities.py +19 -74
  36. mirascope/api/_generated/core/query_encoder.py +1 -3
  37. mirascope/api/_generated/core/serialization.py +4 -10
  38. mirascope/api/_generated/docs/client.py +2 -6
  39. mirascope/api/_generated/docs/raw_client.py +51 -5
  40. mirascope/api/_generated/environment.py +3 -3
  41. mirascope/api/_generated/environments/__init__.py +6 -0
  42. mirascope/api/_generated/environments/client.py +117 -0
  43. mirascope/api/_generated/environments/raw_client.py +530 -51
  44. mirascope/api/_generated/environments/types/__init__.py +10 -0
  45. mirascope/api/_generated/environments/types/environments_create_response.py +1 -3
  46. mirascope/api/_generated/environments/types/environments_get_analytics_response.py +60 -0
  47. mirascope/api/_generated/environments/types/environments_get_analytics_response_top_functions_item.py +24 -0
  48. mirascope/api/_generated/environments/types/environments_get_analytics_response_top_models_item.py +22 -0
  49. mirascope/api/_generated/environments/types/environments_get_response.py +1 -3
  50. mirascope/api/_generated/environments/types/environments_list_response_item.py +1 -3
  51. mirascope/api/_generated/environments/types/environments_update_response.py +1 -3
  52. mirascope/api/_generated/errors/__init__.py +8 -0
  53. mirascope/api/_generated/errors/bad_request_error.py +1 -2
  54. mirascope/api/_generated/errors/conflict_error.py +1 -2
  55. mirascope/api/_generated/errors/forbidden_error.py +1 -5
  56. mirascope/api/_generated/errors/internal_server_error.py +1 -6
  57. mirascope/api/_generated/errors/not_found_error.py +1 -5
  58. mirascope/api/_generated/errors/payment_required_error.py +15 -0
  59. mirascope/api/_generated/errors/service_unavailable_error.py +14 -0
  60. mirascope/api/_generated/errors/too_many_requests_error.py +15 -0
  61. mirascope/api/_generated/errors/unauthorized_error.py +11 -0
  62. mirascope/api/_generated/functions/__init__.py +39 -0
  63. mirascope/api/_generated/functions/client.py +647 -0
  64. mirascope/api/_generated/functions/raw_client.py +1890 -0
  65. mirascope/api/_generated/functions/types/__init__.py +53 -0
  66. mirascope/api/_generated/functions/types/functions_create_request_dependencies_value.py +20 -0
  67. mirascope/api/_generated/functions/types/functions_create_response.py +37 -0
  68. mirascope/api/_generated/functions/types/functions_create_response_dependencies_value.py +20 -0
  69. mirascope/api/_generated/functions/types/functions_find_by_hash_response.py +39 -0
  70. mirascope/api/_generated/functions/types/functions_find_by_hash_response_dependencies_value.py +20 -0
  71. mirascope/api/_generated/functions/types/functions_get_by_env_response.py +53 -0
  72. mirascope/api/_generated/functions/types/functions_get_by_env_response_dependencies_value.py +22 -0
  73. mirascope/api/_generated/functions/types/functions_get_response.py +37 -0
  74. mirascope/api/_generated/functions/types/functions_get_response_dependencies_value.py +20 -0
  75. mirascope/api/_generated/functions/types/functions_list_by_env_response.py +25 -0
  76. mirascope/api/_generated/functions/types/functions_list_by_env_response_functions_item.py +56 -0
  77. mirascope/api/_generated/functions/types/functions_list_by_env_response_functions_item_dependencies_value.py +22 -0
  78. mirascope/api/_generated/functions/types/functions_list_response.py +21 -0
  79. mirascope/api/_generated/functions/types/functions_list_response_functions_item.py +41 -0
  80. mirascope/api/_generated/functions/types/functions_list_response_functions_item_dependencies_value.py +20 -0
  81. mirascope/api/_generated/health/client.py +2 -6
  82. mirascope/api/_generated/health/raw_client.py +51 -5
  83. mirascope/api/_generated/health/types/health_check_response.py +1 -3
  84. mirascope/api/_generated/organization_invitations/__init__.py +33 -0
  85. mirascope/api/_generated/organization_invitations/client.py +546 -0
  86. mirascope/api/_generated/organization_invitations/raw_client.py +1519 -0
  87. mirascope/api/_generated/organization_invitations/types/__init__.py +53 -0
  88. mirascope/api/_generated/organization_invitations/types/organization_invitations_accept_response.py +34 -0
  89. mirascope/api/_generated/organization_invitations/types/organization_invitations_accept_response_role.py +7 -0
  90. mirascope/api/_generated/organization_invitations/types/organization_invitations_create_request_role.py +7 -0
  91. mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response.py +48 -0
  92. mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response_role.py +7 -0
  93. mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response_status.py +7 -0
  94. mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response.py +48 -0
  95. mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response_role.py +7 -0
  96. mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response_status.py +7 -0
  97. mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item.py +48 -0
  98. mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item_role.py +7 -0
  99. mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item_status.py +7 -0
  100. mirascope/api/_generated/organization_memberships/__init__.py +19 -0
  101. mirascope/api/_generated/organization_memberships/client.py +302 -0
  102. mirascope/api/_generated/organization_memberships/raw_client.py +736 -0
  103. mirascope/api/_generated/organization_memberships/types/__init__.py +27 -0
  104. mirascope/api/_generated/organization_memberships/types/organization_memberships_list_response_item.py +33 -0
  105. mirascope/api/_generated/organization_memberships/types/organization_memberships_list_response_item_role.py +7 -0
  106. mirascope/api/_generated/organization_memberships/types/organization_memberships_update_request_role.py +7 -0
  107. mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response.py +31 -0
  108. mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response_role.py +7 -0
  109. mirascope/api/_generated/organizations/__init__.py +26 -0
  110. mirascope/api/_generated/organizations/client.py +465 -0
  111. mirascope/api/_generated/organizations/raw_client.py +1799 -108
  112. mirascope/api/_generated/organizations/types/__init__.py +48 -0
  113. mirascope/api/_generated/organizations/types/organizations_create_payment_intent_response.py +24 -0
  114. mirascope/api/_generated/organizations/types/organizations_create_response.py +4 -3
  115. mirascope/api/_generated/organizations/types/organizations_create_response_role.py +1 -3
  116. mirascope/api/_generated/organizations/types/organizations_get_response.py +4 -3
  117. mirascope/api/_generated/organizations/types/organizations_get_response_role.py +1 -3
  118. mirascope/api/_generated/organizations/types/organizations_list_response_item.py +4 -3
  119. mirascope/api/_generated/organizations/types/organizations_list_response_item_role.py +1 -3
  120. mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_request_target_plan.py +7 -0
  121. mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response.py +47 -0
  122. mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response_validation_errors_item.py +33 -0
  123. mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response_validation_errors_item_resource.py +7 -0
  124. mirascope/api/_generated/organizations/types/organizations_router_balance_response.py +24 -0
  125. mirascope/api/_generated/organizations/types/organizations_subscription_response.py +53 -0
  126. mirascope/api/_generated/organizations/types/organizations_subscription_response_current_plan.py +7 -0
  127. mirascope/api/_generated/organizations/types/organizations_subscription_response_payment_method.py +26 -0
  128. mirascope/api/_generated/organizations/types/organizations_subscription_response_scheduled_change.py +34 -0
  129. mirascope/api/_generated/organizations/types/organizations_subscription_response_scheduled_change_target_plan.py +7 -0
  130. mirascope/api/_generated/organizations/types/organizations_update_response.py +4 -3
  131. mirascope/api/_generated/organizations/types/organizations_update_response_role.py +1 -3
  132. mirascope/api/_generated/organizations/types/organizations_update_subscription_request_target_plan.py +7 -0
  133. mirascope/api/_generated/organizations/types/organizations_update_subscription_response.py +35 -0
  134. mirascope/api/_generated/project_memberships/__init__.py +25 -0
  135. mirascope/api/_generated/project_memberships/client.py +437 -0
  136. mirascope/api/_generated/project_memberships/raw_client.py +1039 -0
  137. mirascope/api/_generated/project_memberships/types/__init__.py +29 -0
  138. mirascope/api/_generated/project_memberships/types/project_memberships_create_request_role.py +7 -0
  139. mirascope/api/_generated/project_memberships/types/project_memberships_create_response.py +35 -0
  140. mirascope/api/_generated/project_memberships/types/project_memberships_create_response_role.py +7 -0
  141. mirascope/api/_generated/project_memberships/types/project_memberships_list_response_item.py +33 -0
  142. mirascope/api/_generated/project_memberships/types/project_memberships_list_response_item_role.py +7 -0
  143. mirascope/api/_generated/project_memberships/types/project_memberships_update_request_role.py +7 -0
  144. mirascope/api/_generated/project_memberships/types/project_memberships_update_response.py +35 -0
  145. mirascope/api/_generated/project_memberships/types/project_memberships_update_response_role.py +7 -0
  146. mirascope/api/_generated/projects/__init__.py +2 -12
  147. mirascope/api/_generated/projects/client.py +17 -71
  148. mirascope/api/_generated/projects/raw_client.py +295 -51
  149. mirascope/api/_generated/projects/types/__init__.py +1 -6
  150. mirascope/api/_generated/projects/types/projects_create_response.py +3 -9
  151. mirascope/api/_generated/projects/types/projects_get_response.py +3 -9
  152. mirascope/api/_generated/projects/types/projects_list_response_item.py +3 -9
  153. mirascope/api/_generated/projects/types/projects_update_response.py +3 -9
  154. mirascope/api/_generated/reference.md +3619 -182
  155. mirascope/api/_generated/tags/__init__.py +19 -0
  156. mirascope/api/_generated/tags/client.py +504 -0
  157. mirascope/api/_generated/tags/raw_client.py +1288 -0
  158. mirascope/api/_generated/tags/types/__init__.py +17 -0
  159. mirascope/api/_generated/tags/types/tags_create_response.py +41 -0
  160. mirascope/api/_generated/tags/types/tags_get_response.py +41 -0
  161. mirascope/api/_generated/tags/types/tags_list_response.py +23 -0
  162. mirascope/api/_generated/tags/types/tags_list_response_tags_item.py +41 -0
  163. mirascope/api/_generated/tags/types/tags_update_response.py +41 -0
  164. mirascope/api/_generated/token_cost/__init__.py +7 -0
  165. mirascope/api/_generated/token_cost/client.py +160 -0
  166. mirascope/api/_generated/token_cost/raw_client.py +264 -0
  167. mirascope/api/_generated/token_cost/types/__init__.py +8 -0
  168. mirascope/api/_generated/token_cost/types/token_cost_calculate_request_usage.py +54 -0
  169. mirascope/api/_generated/token_cost/types/token_cost_calculate_response.py +52 -0
  170. mirascope/api/_generated/traces/__init__.py +42 -0
  171. mirascope/api/_generated/traces/client.py +941 -0
  172. mirascope/api/_generated/traces/raw_client.py +2177 -23
  173. mirascope/api/_generated/traces/types/__init__.py +60 -0
  174. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item.py +4 -11
  175. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource.py +2 -6
  176. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item.py +1 -3
  177. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value.py +8 -24
  178. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_array_value.py +2 -6
  179. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value.py +3 -9
  180. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value_values_item.py +2 -6
  181. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item.py +3 -9
  182. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope.py +4 -8
  183. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item.py +2 -6
  184. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value.py +8 -24
  185. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_array_value.py +2 -6
  186. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value.py +3 -9
  187. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value_values_item.py +1 -3
  188. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item.py +6 -18
  189. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item.py +3 -9
  190. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value.py +8 -24
  191. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_array_value.py +2 -6
  192. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value.py +2 -6
  193. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value_values_item.py +1 -3
  194. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_status.py +2 -6
  195. mirascope/api/_generated/traces/types/traces_create_response.py +2 -5
  196. mirascope/api/_generated/traces/types/traces_create_response_partial_success.py +3 -9
  197. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response.py +60 -0
  198. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_functions_item.py +24 -0
  199. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_models_item.py +22 -0
  200. mirascope/api/_generated/traces/types/traces_get_trace_detail_by_env_response.py +33 -0
  201. mirascope/api/_generated/traces/types/traces_get_trace_detail_by_env_response_spans_item.py +88 -0
  202. mirascope/api/_generated/traces/types/traces_get_trace_detail_response.py +33 -0
  203. mirascope/api/_generated/traces/types/traces_get_trace_detail_response_spans_item.py +88 -0
  204. mirascope/api/_generated/traces/types/traces_list_by_function_hash_response.py +25 -0
  205. mirascope/api/_generated/traces/types/traces_list_by_function_hash_response_traces_item.py +44 -0
  206. mirascope/api/_generated/traces/types/traces_search_by_env_request_attribute_filters_item.py +26 -0
  207. mirascope/api/_generated/traces/types/traces_search_by_env_request_attribute_filters_item_operator.py +7 -0
  208. mirascope/api/_generated/traces/types/traces_search_by_env_request_sort_by.py +7 -0
  209. mirascope/api/_generated/traces/types/traces_search_by_env_request_sort_order.py +7 -0
  210. mirascope/api/_generated/traces/types/traces_search_by_env_response.py +26 -0
  211. mirascope/api/_generated/traces/types/traces_search_by_env_response_spans_item.py +50 -0
  212. mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item.py +26 -0
  213. mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item_operator.py +7 -0
  214. mirascope/api/_generated/traces/types/traces_search_request_sort_by.py +7 -0
  215. mirascope/api/_generated/traces/types/traces_search_request_sort_order.py +5 -0
  216. mirascope/api/_generated/traces/types/traces_search_response.py +26 -0
  217. mirascope/api/_generated/traces/types/traces_search_response_spans_item.py +50 -0
  218. mirascope/api/_generated/types/__init__.py +48 -0
  219. mirascope/api/_generated/types/already_exists_error.py +1 -3
  220. mirascope/api/_generated/types/bad_request_error_body.py +50 -0
  221. mirascope/api/_generated/types/click_house_error.py +22 -0
  222. mirascope/api/_generated/types/database_error.py +1 -3
  223. mirascope/api/_generated/types/date.py +3 -0
  224. mirascope/api/_generated/types/http_api_decode_error.py +1 -3
  225. mirascope/api/_generated/types/immutable_resource_error.py +22 -0
  226. mirascope/api/_generated/types/internal_server_error_body.py +49 -0
  227. mirascope/api/_generated/types/issue.py +1 -3
  228. mirascope/api/_generated/types/issue_tag.py +1 -8
  229. mirascope/api/_generated/types/not_found_error_body.py +1 -3
  230. mirascope/api/_generated/types/number_from_string.py +3 -0
  231. mirascope/api/_generated/types/permission_denied_error.py +1 -3
  232. mirascope/api/_generated/types/permission_denied_error_tag.py +1 -3
  233. mirascope/api/_generated/types/plan_limit_exceeded_error.py +32 -0
  234. mirascope/api/_generated/types/plan_limit_exceeded_error_tag.py +7 -0
  235. mirascope/api/_generated/types/pricing_unavailable_error.py +23 -0
  236. mirascope/api/_generated/types/property_key_key.py +1 -3
  237. mirascope/api/_generated/types/rate_limit_error.py +31 -0
  238. mirascope/api/_generated/types/rate_limit_error_tag.py +5 -0
  239. mirascope/api/_generated/types/service_unavailable_error_body.py +24 -0
  240. mirascope/api/_generated/types/service_unavailable_error_tag.py +7 -0
  241. mirascope/api/_generated/types/stripe_error.py +20 -0
  242. mirascope/api/_generated/types/subscription_past_due_error.py +31 -0
  243. mirascope/api/_generated/types/subscription_past_due_error_tag.py +7 -0
  244. mirascope/api/_generated/types/unauthorized_error_body.py +21 -0
  245. mirascope/api/_generated/types/unauthorized_error_tag.py +5 -0
  246. mirascope/api/settings.py +19 -1
  247. mirascope/llm/__init__.py +55 -8
  248. mirascope/llm/calls/__init__.py +2 -1
  249. mirascope/llm/calls/calls.py +3 -1
  250. mirascope/llm/calls/decorator.py +21 -7
  251. mirascope/llm/content/tool_call.py +6 -0
  252. mirascope/llm/content/tool_output.py +22 -5
  253. mirascope/llm/exceptions.py +284 -71
  254. mirascope/llm/formatting/__init__.py +19 -2
  255. mirascope/llm/formatting/format.py +219 -30
  256. mirascope/llm/formatting/output_parser.py +178 -0
  257. mirascope/llm/formatting/partial.py +80 -7
  258. mirascope/llm/formatting/primitives.py +192 -0
  259. mirascope/llm/formatting/types.py +21 -64
  260. mirascope/llm/mcp/__init__.py +2 -2
  261. mirascope/llm/mcp/mcp_client.py +130 -0
  262. mirascope/llm/messages/__init__.py +3 -0
  263. mirascope/llm/messages/_utils.py +34 -0
  264. mirascope/llm/models/__init__.py +5 -0
  265. mirascope/llm/models/models.py +137 -69
  266. mirascope/llm/{providers/base → models}/params.py +16 -37
  267. mirascope/llm/models/thinking_config.py +61 -0
  268. mirascope/llm/prompts/_utils.py +0 -32
  269. mirascope/llm/prompts/decorator.py +16 -5
  270. mirascope/llm/prompts/prompts.py +131 -68
  271. mirascope/llm/providers/__init__.py +18 -2
  272. mirascope/llm/providers/anthropic/__init__.py +3 -21
  273. mirascope/llm/providers/anthropic/_utils/__init__.py +2 -0
  274. mirascope/llm/providers/anthropic/_utils/beta_decode.py +22 -11
  275. mirascope/llm/providers/anthropic/_utils/beta_encode.py +75 -25
  276. mirascope/llm/providers/anthropic/_utils/decode.py +22 -11
  277. mirascope/llm/providers/anthropic/_utils/encode.py +82 -20
  278. mirascope/llm/providers/anthropic/_utils/errors.py +2 -2
  279. mirascope/llm/providers/anthropic/beta_provider.py +64 -18
  280. mirascope/llm/providers/anthropic/provider.py +91 -33
  281. mirascope/llm/providers/base/__init__.py +0 -2
  282. mirascope/llm/providers/base/_utils.py +55 -11
  283. mirascope/llm/providers/base/base_provider.py +116 -37
  284. mirascope/llm/providers/google/__init__.py +2 -17
  285. mirascope/llm/providers/google/_utils/__init__.py +2 -0
  286. mirascope/llm/providers/google/_utils/decode.py +37 -15
  287. mirascope/llm/providers/google/_utils/encode.py +127 -19
  288. mirascope/llm/providers/google/_utils/errors.py +3 -2
  289. mirascope/llm/providers/google/model_info.py +1 -0
  290. mirascope/llm/providers/google/provider.py +68 -19
  291. mirascope/llm/providers/mirascope/__init__.py +5 -0
  292. mirascope/llm/providers/mirascope/_utils.py +73 -0
  293. mirascope/llm/providers/mirascope/provider.py +349 -0
  294. mirascope/llm/providers/mlx/__init__.py +2 -17
  295. mirascope/llm/providers/mlx/_utils.py +8 -3
  296. mirascope/llm/providers/mlx/encoding/base.py +5 -2
  297. mirascope/llm/providers/mlx/encoding/transformers.py +5 -2
  298. mirascope/llm/providers/mlx/mlx.py +23 -6
  299. mirascope/llm/providers/mlx/provider.py +42 -13
  300. mirascope/llm/providers/ollama/__init__.py +1 -13
  301. mirascope/llm/providers/openai/_utils/errors.py +2 -2
  302. mirascope/llm/providers/openai/completions/__init__.py +2 -20
  303. mirascope/llm/providers/openai/completions/_utils/decode.py +14 -3
  304. mirascope/llm/providers/openai/completions/_utils/encode.py +35 -28
  305. mirascope/llm/providers/openai/completions/base_provider.py +40 -11
  306. mirascope/llm/providers/openai/provider.py +40 -10
  307. mirascope/llm/providers/openai/responses/__init__.py +1 -17
  308. mirascope/llm/providers/openai/responses/_utils/__init__.py +2 -0
  309. mirascope/llm/providers/openai/responses/_utils/decode.py +21 -8
  310. mirascope/llm/providers/openai/responses/_utils/encode.py +59 -19
  311. mirascope/llm/providers/openai/responses/provider.py +56 -18
  312. mirascope/llm/providers/provider_id.py +1 -0
  313. mirascope/llm/providers/provider_registry.py +96 -19
  314. mirascope/llm/providers/together/__init__.py +1 -13
  315. mirascope/llm/responses/__init__.py +6 -1
  316. mirascope/llm/responses/_utils.py +102 -12
  317. mirascope/llm/responses/base_response.py +5 -2
  318. mirascope/llm/responses/base_stream_response.py +139 -45
  319. mirascope/llm/responses/response.py +2 -1
  320. mirascope/llm/responses/root_response.py +89 -17
  321. mirascope/llm/responses/stream_response.py +6 -9
  322. mirascope/llm/tools/decorator.py +17 -8
  323. mirascope/llm/tools/tool_schema.py +43 -10
  324. mirascope/llm/tools/toolkit.py +35 -27
  325. mirascope/llm/tools/tools.py +123 -30
  326. mirascope/ops/__init__.py +64 -109
  327. mirascope/ops/_internal/configuration.py +82 -31
  328. mirascope/ops/_internal/exporters/exporters.py +64 -11
  329. mirascope/ops/_internal/instrumentation/llm/common.py +530 -0
  330. mirascope/ops/_internal/instrumentation/llm/cost.py +190 -0
  331. mirascope/ops/_internal/instrumentation/llm/encode.py +1 -1
  332. mirascope/ops/_internal/instrumentation/llm/llm.py +116 -1243
  333. mirascope/ops/_internal/instrumentation/llm/model.py +1798 -0
  334. mirascope/ops/_internal/instrumentation/llm/response.py +521 -0
  335. mirascope/ops/_internal/instrumentation/llm/serialize.py +300 -0
  336. mirascope/ops/_internal/protocols.py +83 -1
  337. mirascope/ops/_internal/traced_calls.py +4 -0
  338. mirascope/ops/_internal/traced_functions.py +141 -12
  339. mirascope/ops/_internal/tracing.py +78 -1
  340. mirascope/ops/_internal/utils.py +52 -4
  341. mirascope/ops/_internal/versioned_functions.py +54 -43
  342. {mirascope-2.0.0a5.dist-info → mirascope-2.0.1.dist-info}/METADATA +14 -13
  343. mirascope-2.0.1.dist-info/RECORD +423 -0
  344. {mirascope-2.0.0a5.dist-info → mirascope-2.0.1.dist-info}/licenses/LICENSE +1 -1
  345. mirascope/llm/formatting/_utils.py +0 -78
  346. mirascope/llm/mcp/client.py +0 -118
  347. mirascope/llm/providers/_missing_import_stubs.py +0 -49
  348. mirascope-2.0.0a5.dist-info/RECORD +0 -265
  349. {mirascope-2.0.0a5.dist-info → mirascope-2.0.1.dist-info}/WHEEL +0 -0
@@ -14,13 +14,16 @@ from ..errors.conflict_error import ConflictError
14
14
  from ..errors.forbidden_error import ForbiddenError
15
15
  from ..errors.internal_server_error import InternalServerError
16
16
  from ..errors.not_found_error import NotFoundError
17
- from ..types.already_exists_error import AlreadyExistsError
18
- from ..types.database_error import DatabaseError
19
- from ..types.http_api_decode_error import HttpApiDecodeError
17
+ from ..errors.service_unavailable_error import ServiceUnavailableError
18
+ from ..errors.too_many_requests_error import TooManyRequestsError
20
19
  from ..types.not_found_error_body import NotFoundErrorBody
21
20
  from ..types.permission_denied_error import PermissionDeniedError
21
+ from ..types.rate_limit_error import RateLimitError
22
22
  from .types.api_keys_create_response import ApiKeysCreateResponse
23
23
  from .types.api_keys_get_response import ApiKeysGetResponse
24
+ from .types.api_keys_list_all_for_org_response_item import (
25
+ ApiKeysListAllForOrgResponseItem,
26
+ )
24
27
  from .types.api_keys_list_response_item import ApiKeysListResponseItem
25
28
 
26
29
  # this is used as the default value for optional parameters
@@ -31,6 +34,108 @@ class RawApiKeysClient:
31
34
  def __init__(self, *, client_wrapper: SyncClientWrapper):
32
35
  self._client_wrapper = client_wrapper
33
36
 
37
+ def api_keys_list_all_for_org(
38
+ self,
39
+ organization_id: str,
40
+ *,
41
+ request_options: typing.Optional[RequestOptions] = None,
42
+ ) -> HttpResponse[typing.List[ApiKeysListAllForOrgResponseItem]]:
43
+ """
44
+ Parameters
45
+ ----------
46
+ organization_id : str
47
+
48
+ request_options : typing.Optional[RequestOptions]
49
+ Request-specific configuration.
50
+
51
+ Returns
52
+ -------
53
+ HttpResponse[typing.List[ApiKeysListAllForOrgResponseItem]]
54
+ Success
55
+ """
56
+ _response = self._client_wrapper.httpx_client.request(
57
+ f"organizations/{jsonable_encoder(organization_id)}/api-keys",
58
+ method="GET",
59
+ request_options=request_options,
60
+ )
61
+ try:
62
+ if 200 <= _response.status_code < 300:
63
+ _data = typing.cast(
64
+ typing.List[ApiKeysListAllForOrgResponseItem],
65
+ parse_obj_as(
66
+ type_=typing.List[ApiKeysListAllForOrgResponseItem], # type: ignore
67
+ object_=_response.json(),
68
+ ),
69
+ )
70
+ return HttpResponse(response=_response, data=_data)
71
+ if _response.status_code == 400:
72
+ raise BadRequestError(
73
+ headers=dict(_response.headers),
74
+ body=typing.cast(
75
+ typing.Optional[typing.Any],
76
+ parse_obj_as(
77
+ type_=typing.Optional[typing.Any], # type: ignore
78
+ object_=_response.json(),
79
+ ),
80
+ ),
81
+ )
82
+ if _response.status_code == 404:
83
+ raise NotFoundError(
84
+ headers=dict(_response.headers),
85
+ body=typing.cast(
86
+ NotFoundErrorBody,
87
+ parse_obj_as(
88
+ type_=NotFoundErrorBody, # type: ignore
89
+ object_=_response.json(),
90
+ ),
91
+ ),
92
+ )
93
+ if _response.status_code == 429:
94
+ raise TooManyRequestsError(
95
+ headers=dict(_response.headers),
96
+ body=typing.cast(
97
+ RateLimitError,
98
+ parse_obj_as(
99
+ type_=RateLimitError, # type: ignore
100
+ object_=_response.json(),
101
+ ),
102
+ ),
103
+ )
104
+ if _response.status_code == 500:
105
+ raise InternalServerError(
106
+ headers=dict(_response.headers),
107
+ body=typing.cast(
108
+ typing.Optional[typing.Any],
109
+ parse_obj_as(
110
+ type_=typing.Optional[typing.Any], # type: ignore
111
+ object_=_response.json(),
112
+ ),
113
+ ),
114
+ )
115
+ if _response.status_code == 503:
116
+ raise ServiceUnavailableError(
117
+ headers=dict(_response.headers),
118
+ body=typing.cast(
119
+ typing.Optional[typing.Any],
120
+ parse_obj_as(
121
+ type_=typing.Optional[typing.Any], # type: ignore
122
+ object_=_response.json(),
123
+ ),
124
+ ),
125
+ )
126
+ _response_json = _response.json()
127
+ except JSONDecodeError:
128
+ raise ApiError(
129
+ status_code=_response.status_code,
130
+ headers=dict(_response.headers),
131
+ body=_response.text,
132
+ )
133
+ raise ApiError(
134
+ status_code=_response.status_code,
135
+ headers=dict(_response.headers),
136
+ body=_response_json,
137
+ )
138
+
34
139
  def api_keys_list(
35
140
  self,
36
141
  organization_id: str,
@@ -75,9 +180,9 @@ class RawApiKeysClient:
75
180
  raise BadRequestError(
76
181
  headers=dict(_response.headers),
77
182
  body=typing.cast(
78
- HttpApiDecodeError,
183
+ typing.Optional[typing.Any],
79
184
  parse_obj_as(
80
- type_=HttpApiDecodeError, # type: ignore
185
+ type_=typing.Optional[typing.Any], # type: ignore
81
186
  object_=_response.json(),
82
187
  ),
83
188
  ),
@@ -104,13 +209,35 @@ class RawApiKeysClient:
104
209
  ),
105
210
  ),
106
211
  )
212
+ if _response.status_code == 429:
213
+ raise TooManyRequestsError(
214
+ headers=dict(_response.headers),
215
+ body=typing.cast(
216
+ RateLimitError,
217
+ parse_obj_as(
218
+ type_=RateLimitError, # type: ignore
219
+ object_=_response.json(),
220
+ ),
221
+ ),
222
+ )
107
223
  if _response.status_code == 500:
108
224
  raise InternalServerError(
109
225
  headers=dict(_response.headers),
110
226
  body=typing.cast(
111
- DatabaseError,
227
+ typing.Optional[typing.Any],
112
228
  parse_obj_as(
113
- type_=DatabaseError, # type: ignore
229
+ type_=typing.Optional[typing.Any], # type: ignore
230
+ object_=_response.json(),
231
+ ),
232
+ ),
233
+ )
234
+ if _response.status_code == 503:
235
+ raise ServiceUnavailableError(
236
+ headers=dict(_response.headers),
237
+ body=typing.cast(
238
+ typing.Optional[typing.Any],
239
+ parse_obj_as(
240
+ type_=typing.Optional[typing.Any], # type: ignore
114
241
  object_=_response.json(),
115
242
  ),
116
243
  ),
@@ -183,9 +310,9 @@ class RawApiKeysClient:
183
310
  raise BadRequestError(
184
311
  headers=dict(_response.headers),
185
312
  body=typing.cast(
186
- HttpApiDecodeError,
313
+ typing.Optional[typing.Any],
187
314
  parse_obj_as(
188
- type_=HttpApiDecodeError, # type: ignore
315
+ type_=typing.Optional[typing.Any], # type: ignore
189
316
  object_=_response.json(),
190
317
  ),
191
318
  ),
@@ -216,9 +343,20 @@ class RawApiKeysClient:
216
343
  raise ConflictError(
217
344
  headers=dict(_response.headers),
218
345
  body=typing.cast(
219
- AlreadyExistsError,
346
+ typing.Optional[typing.Any],
347
+ parse_obj_as(
348
+ type_=typing.Optional[typing.Any], # type: ignore
349
+ object_=_response.json(),
350
+ ),
351
+ ),
352
+ )
353
+ if _response.status_code == 429:
354
+ raise TooManyRequestsError(
355
+ headers=dict(_response.headers),
356
+ body=typing.cast(
357
+ RateLimitError,
220
358
  parse_obj_as(
221
- type_=AlreadyExistsError, # type: ignore
359
+ type_=RateLimitError, # type: ignore
222
360
  object_=_response.json(),
223
361
  ),
224
362
  ),
@@ -227,9 +365,20 @@ class RawApiKeysClient:
227
365
  raise InternalServerError(
228
366
  headers=dict(_response.headers),
229
367
  body=typing.cast(
230
- DatabaseError,
368
+ typing.Optional[typing.Any],
231
369
  parse_obj_as(
232
- type_=DatabaseError, # type: ignore
370
+ type_=typing.Optional[typing.Any], # type: ignore
371
+ object_=_response.json(),
372
+ ),
373
+ ),
374
+ )
375
+ if _response.status_code == 503:
376
+ raise ServiceUnavailableError(
377
+ headers=dict(_response.headers),
378
+ body=typing.cast(
379
+ typing.Optional[typing.Any],
380
+ parse_obj_as(
381
+ type_=typing.Optional[typing.Any], # type: ignore
233
382
  object_=_response.json(),
234
383
  ),
235
384
  ),
@@ -294,9 +443,9 @@ class RawApiKeysClient:
294
443
  raise BadRequestError(
295
444
  headers=dict(_response.headers),
296
445
  body=typing.cast(
297
- HttpApiDecodeError,
446
+ typing.Optional[typing.Any],
298
447
  parse_obj_as(
299
- type_=HttpApiDecodeError, # type: ignore
448
+ type_=typing.Optional[typing.Any], # type: ignore
300
449
  object_=_response.json(),
301
450
  ),
302
451
  ),
@@ -323,13 +472,35 @@ class RawApiKeysClient:
323
472
  ),
324
473
  ),
325
474
  )
475
+ if _response.status_code == 429:
476
+ raise TooManyRequestsError(
477
+ headers=dict(_response.headers),
478
+ body=typing.cast(
479
+ RateLimitError,
480
+ parse_obj_as(
481
+ type_=RateLimitError, # type: ignore
482
+ object_=_response.json(),
483
+ ),
484
+ ),
485
+ )
326
486
  if _response.status_code == 500:
327
487
  raise InternalServerError(
328
488
  headers=dict(_response.headers),
329
489
  body=typing.cast(
330
- DatabaseError,
490
+ typing.Optional[typing.Any],
331
491
  parse_obj_as(
332
- type_=DatabaseError, # type: ignore
492
+ type_=typing.Optional[typing.Any], # type: ignore
493
+ object_=_response.json(),
494
+ ),
495
+ ),
496
+ )
497
+ if _response.status_code == 503:
498
+ raise ServiceUnavailableError(
499
+ headers=dict(_response.headers),
500
+ body=typing.cast(
501
+ typing.Optional[typing.Any],
502
+ parse_obj_as(
503
+ type_=typing.Optional[typing.Any], # type: ignore
333
504
  object_=_response.json(),
334
505
  ),
335
506
  ),
@@ -386,9 +557,9 @@ class RawApiKeysClient:
386
557
  raise BadRequestError(
387
558
  headers=dict(_response.headers),
388
559
  body=typing.cast(
389
- HttpApiDecodeError,
560
+ typing.Optional[typing.Any],
390
561
  parse_obj_as(
391
- type_=HttpApiDecodeError, # type: ignore
562
+ type_=typing.Optional[typing.Any], # type: ignore
392
563
  object_=_response.json(),
393
564
  ),
394
565
  ),
@@ -415,13 +586,35 @@ class RawApiKeysClient:
415
586
  ),
416
587
  ),
417
588
  )
589
+ if _response.status_code == 429:
590
+ raise TooManyRequestsError(
591
+ headers=dict(_response.headers),
592
+ body=typing.cast(
593
+ RateLimitError,
594
+ parse_obj_as(
595
+ type_=RateLimitError, # type: ignore
596
+ object_=_response.json(),
597
+ ),
598
+ ),
599
+ )
418
600
  if _response.status_code == 500:
419
601
  raise InternalServerError(
420
602
  headers=dict(_response.headers),
421
603
  body=typing.cast(
422
- DatabaseError,
604
+ typing.Optional[typing.Any],
605
+ parse_obj_as(
606
+ type_=typing.Optional[typing.Any], # type: ignore
607
+ object_=_response.json(),
608
+ ),
609
+ ),
610
+ )
611
+ if _response.status_code == 503:
612
+ raise ServiceUnavailableError(
613
+ headers=dict(_response.headers),
614
+ body=typing.cast(
615
+ typing.Optional[typing.Any],
423
616
  parse_obj_as(
424
- type_=DatabaseError, # type: ignore
617
+ type_=typing.Optional[typing.Any], # type: ignore
425
618
  object_=_response.json(),
426
619
  ),
427
620
  ),
@@ -444,6 +637,108 @@ class AsyncRawApiKeysClient:
444
637
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
445
638
  self._client_wrapper = client_wrapper
446
639
 
640
+ async def api_keys_list_all_for_org(
641
+ self,
642
+ organization_id: str,
643
+ *,
644
+ request_options: typing.Optional[RequestOptions] = None,
645
+ ) -> AsyncHttpResponse[typing.List[ApiKeysListAllForOrgResponseItem]]:
646
+ """
647
+ Parameters
648
+ ----------
649
+ organization_id : str
650
+
651
+ request_options : typing.Optional[RequestOptions]
652
+ Request-specific configuration.
653
+
654
+ Returns
655
+ -------
656
+ AsyncHttpResponse[typing.List[ApiKeysListAllForOrgResponseItem]]
657
+ Success
658
+ """
659
+ _response = await self._client_wrapper.httpx_client.request(
660
+ f"organizations/{jsonable_encoder(organization_id)}/api-keys",
661
+ method="GET",
662
+ request_options=request_options,
663
+ )
664
+ try:
665
+ if 200 <= _response.status_code < 300:
666
+ _data = typing.cast(
667
+ typing.List[ApiKeysListAllForOrgResponseItem],
668
+ parse_obj_as(
669
+ type_=typing.List[ApiKeysListAllForOrgResponseItem], # type: ignore
670
+ object_=_response.json(),
671
+ ),
672
+ )
673
+ return AsyncHttpResponse(response=_response, data=_data)
674
+ if _response.status_code == 400:
675
+ raise BadRequestError(
676
+ headers=dict(_response.headers),
677
+ body=typing.cast(
678
+ typing.Optional[typing.Any],
679
+ parse_obj_as(
680
+ type_=typing.Optional[typing.Any], # type: ignore
681
+ object_=_response.json(),
682
+ ),
683
+ ),
684
+ )
685
+ if _response.status_code == 404:
686
+ raise NotFoundError(
687
+ headers=dict(_response.headers),
688
+ body=typing.cast(
689
+ NotFoundErrorBody,
690
+ parse_obj_as(
691
+ type_=NotFoundErrorBody, # type: ignore
692
+ object_=_response.json(),
693
+ ),
694
+ ),
695
+ )
696
+ if _response.status_code == 429:
697
+ raise TooManyRequestsError(
698
+ headers=dict(_response.headers),
699
+ body=typing.cast(
700
+ RateLimitError,
701
+ parse_obj_as(
702
+ type_=RateLimitError, # type: ignore
703
+ object_=_response.json(),
704
+ ),
705
+ ),
706
+ )
707
+ if _response.status_code == 500:
708
+ raise InternalServerError(
709
+ headers=dict(_response.headers),
710
+ body=typing.cast(
711
+ typing.Optional[typing.Any],
712
+ parse_obj_as(
713
+ type_=typing.Optional[typing.Any], # type: ignore
714
+ object_=_response.json(),
715
+ ),
716
+ ),
717
+ )
718
+ if _response.status_code == 503:
719
+ raise ServiceUnavailableError(
720
+ headers=dict(_response.headers),
721
+ body=typing.cast(
722
+ typing.Optional[typing.Any],
723
+ parse_obj_as(
724
+ type_=typing.Optional[typing.Any], # type: ignore
725
+ object_=_response.json(),
726
+ ),
727
+ ),
728
+ )
729
+ _response_json = _response.json()
730
+ except JSONDecodeError:
731
+ raise ApiError(
732
+ status_code=_response.status_code,
733
+ headers=dict(_response.headers),
734
+ body=_response.text,
735
+ )
736
+ raise ApiError(
737
+ status_code=_response.status_code,
738
+ headers=dict(_response.headers),
739
+ body=_response_json,
740
+ )
741
+
447
742
  async def api_keys_list(
448
743
  self,
449
744
  organization_id: str,
@@ -488,9 +783,9 @@ class AsyncRawApiKeysClient:
488
783
  raise BadRequestError(
489
784
  headers=dict(_response.headers),
490
785
  body=typing.cast(
491
- HttpApiDecodeError,
786
+ typing.Optional[typing.Any],
492
787
  parse_obj_as(
493
- type_=HttpApiDecodeError, # type: ignore
788
+ type_=typing.Optional[typing.Any], # type: ignore
494
789
  object_=_response.json(),
495
790
  ),
496
791
  ),
@@ -517,13 +812,35 @@ class AsyncRawApiKeysClient:
517
812
  ),
518
813
  ),
519
814
  )
815
+ if _response.status_code == 429:
816
+ raise TooManyRequestsError(
817
+ headers=dict(_response.headers),
818
+ body=typing.cast(
819
+ RateLimitError,
820
+ parse_obj_as(
821
+ type_=RateLimitError, # type: ignore
822
+ object_=_response.json(),
823
+ ),
824
+ ),
825
+ )
520
826
  if _response.status_code == 500:
521
827
  raise InternalServerError(
522
828
  headers=dict(_response.headers),
523
829
  body=typing.cast(
524
- DatabaseError,
830
+ typing.Optional[typing.Any],
525
831
  parse_obj_as(
526
- type_=DatabaseError, # type: ignore
832
+ type_=typing.Optional[typing.Any], # type: ignore
833
+ object_=_response.json(),
834
+ ),
835
+ ),
836
+ )
837
+ if _response.status_code == 503:
838
+ raise ServiceUnavailableError(
839
+ headers=dict(_response.headers),
840
+ body=typing.cast(
841
+ typing.Optional[typing.Any],
842
+ parse_obj_as(
843
+ type_=typing.Optional[typing.Any], # type: ignore
527
844
  object_=_response.json(),
528
845
  ),
529
846
  ),
@@ -596,9 +913,9 @@ class AsyncRawApiKeysClient:
596
913
  raise BadRequestError(
597
914
  headers=dict(_response.headers),
598
915
  body=typing.cast(
599
- HttpApiDecodeError,
916
+ typing.Optional[typing.Any],
600
917
  parse_obj_as(
601
- type_=HttpApiDecodeError, # type: ignore
918
+ type_=typing.Optional[typing.Any], # type: ignore
602
919
  object_=_response.json(),
603
920
  ),
604
921
  ),
@@ -629,9 +946,20 @@ class AsyncRawApiKeysClient:
629
946
  raise ConflictError(
630
947
  headers=dict(_response.headers),
631
948
  body=typing.cast(
632
- AlreadyExistsError,
949
+ typing.Optional[typing.Any],
950
+ parse_obj_as(
951
+ type_=typing.Optional[typing.Any], # type: ignore
952
+ object_=_response.json(),
953
+ ),
954
+ ),
955
+ )
956
+ if _response.status_code == 429:
957
+ raise TooManyRequestsError(
958
+ headers=dict(_response.headers),
959
+ body=typing.cast(
960
+ RateLimitError,
633
961
  parse_obj_as(
634
- type_=AlreadyExistsError, # type: ignore
962
+ type_=RateLimitError, # type: ignore
635
963
  object_=_response.json(),
636
964
  ),
637
965
  ),
@@ -640,9 +968,20 @@ class AsyncRawApiKeysClient:
640
968
  raise InternalServerError(
641
969
  headers=dict(_response.headers),
642
970
  body=typing.cast(
643
- DatabaseError,
971
+ typing.Optional[typing.Any],
644
972
  parse_obj_as(
645
- type_=DatabaseError, # type: ignore
973
+ type_=typing.Optional[typing.Any], # type: ignore
974
+ object_=_response.json(),
975
+ ),
976
+ ),
977
+ )
978
+ if _response.status_code == 503:
979
+ raise ServiceUnavailableError(
980
+ headers=dict(_response.headers),
981
+ body=typing.cast(
982
+ typing.Optional[typing.Any],
983
+ parse_obj_as(
984
+ type_=typing.Optional[typing.Any], # type: ignore
646
985
  object_=_response.json(),
647
986
  ),
648
987
  ),
@@ -707,9 +1046,9 @@ class AsyncRawApiKeysClient:
707
1046
  raise BadRequestError(
708
1047
  headers=dict(_response.headers),
709
1048
  body=typing.cast(
710
- HttpApiDecodeError,
1049
+ typing.Optional[typing.Any],
711
1050
  parse_obj_as(
712
- type_=HttpApiDecodeError, # type: ignore
1051
+ type_=typing.Optional[typing.Any], # type: ignore
713
1052
  object_=_response.json(),
714
1053
  ),
715
1054
  ),
@@ -736,13 +1075,35 @@ class AsyncRawApiKeysClient:
736
1075
  ),
737
1076
  ),
738
1077
  )
1078
+ if _response.status_code == 429:
1079
+ raise TooManyRequestsError(
1080
+ headers=dict(_response.headers),
1081
+ body=typing.cast(
1082
+ RateLimitError,
1083
+ parse_obj_as(
1084
+ type_=RateLimitError, # type: ignore
1085
+ object_=_response.json(),
1086
+ ),
1087
+ ),
1088
+ )
739
1089
  if _response.status_code == 500:
740
1090
  raise InternalServerError(
741
1091
  headers=dict(_response.headers),
742
1092
  body=typing.cast(
743
- DatabaseError,
1093
+ typing.Optional[typing.Any],
744
1094
  parse_obj_as(
745
- type_=DatabaseError, # type: ignore
1095
+ type_=typing.Optional[typing.Any], # type: ignore
1096
+ object_=_response.json(),
1097
+ ),
1098
+ ),
1099
+ )
1100
+ if _response.status_code == 503:
1101
+ raise ServiceUnavailableError(
1102
+ headers=dict(_response.headers),
1103
+ body=typing.cast(
1104
+ typing.Optional[typing.Any],
1105
+ parse_obj_as(
1106
+ type_=typing.Optional[typing.Any], # type: ignore
746
1107
  object_=_response.json(),
747
1108
  ),
748
1109
  ),
@@ -799,9 +1160,9 @@ class AsyncRawApiKeysClient:
799
1160
  raise BadRequestError(
800
1161
  headers=dict(_response.headers),
801
1162
  body=typing.cast(
802
- HttpApiDecodeError,
1163
+ typing.Optional[typing.Any],
803
1164
  parse_obj_as(
804
- type_=HttpApiDecodeError, # type: ignore
1165
+ type_=typing.Optional[typing.Any], # type: ignore
805
1166
  object_=_response.json(),
806
1167
  ),
807
1168
  ),
@@ -828,13 +1189,35 @@ class AsyncRawApiKeysClient:
828
1189
  ),
829
1190
  ),
830
1191
  )
1192
+ if _response.status_code == 429:
1193
+ raise TooManyRequestsError(
1194
+ headers=dict(_response.headers),
1195
+ body=typing.cast(
1196
+ RateLimitError,
1197
+ parse_obj_as(
1198
+ type_=RateLimitError, # type: ignore
1199
+ object_=_response.json(),
1200
+ ),
1201
+ ),
1202
+ )
831
1203
  if _response.status_code == 500:
832
1204
  raise InternalServerError(
833
1205
  headers=dict(_response.headers),
834
1206
  body=typing.cast(
835
- DatabaseError,
1207
+ typing.Optional[typing.Any],
1208
+ parse_obj_as(
1209
+ type_=typing.Optional[typing.Any], # type: ignore
1210
+ object_=_response.json(),
1211
+ ),
1212
+ ),
1213
+ )
1214
+ if _response.status_code == 503:
1215
+ raise ServiceUnavailableError(
1216
+ headers=dict(_response.headers),
1217
+ body=typing.cast(
1218
+ typing.Optional[typing.Any],
836
1219
  parse_obj_as(
837
- type_=DatabaseError, # type: ignore
1220
+ type_=typing.Optional[typing.Any], # type: ignore
838
1221
  object_=_response.json(),
839
1222
  ),
840
1223
  ),
@@ -4,6 +4,12 @@
4
4
 
5
5
  from .api_keys_create_response import ApiKeysCreateResponse
6
6
  from .api_keys_get_response import ApiKeysGetResponse
7
+ from .api_keys_list_all_for_org_response_item import ApiKeysListAllForOrgResponseItem
7
8
  from .api_keys_list_response_item import ApiKeysListResponseItem
8
9
 
9
- __all__ = ["ApiKeysCreateResponse", "ApiKeysGetResponse", "ApiKeysListResponseItem"]
10
+ __all__ = [
11
+ "ApiKeysCreateResponse",
12
+ "ApiKeysGetResponse",
13
+ "ApiKeysListAllForOrgResponseItem",
14
+ "ApiKeysListResponseItem",
15
+ ]
@@ -12,22 +12,14 @@ class ApiKeysCreateResponse(UniversalBaseModel):
12
12
  id: str
13
13
  name: str
14
14
  key_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="keyPrefix")]
15
- environment_id: typing_extensions.Annotated[
16
- str, FieldMetadata(alias="environmentId")
17
- ]
15
+ environment_id: typing_extensions.Annotated[str, FieldMetadata(alias="environmentId")]
18
16
  owner_id: typing_extensions.Annotated[str, FieldMetadata(alias="ownerId")]
19
- created_at: typing_extensions.Annotated[
20
- typing.Optional[str], FieldMetadata(alias="createdAt")
21
- ] = None
22
- last_used_at: typing_extensions.Annotated[
23
- typing.Optional[str], FieldMetadata(alias="lastUsedAt")
24
- ] = None
17
+ created_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdAt")] = None
18
+ last_used_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="lastUsedAt")] = None
25
19
  key: str
26
20
 
27
21
  if IS_PYDANTIC_V2:
28
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
29
- extra="allow", frozen=True
30
- ) # type: ignore # Pydantic v2
22
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
31
23
  else:
32
24
 
33
25
  class Config: