mirascope 2.0.0a4__py3-none-any.whl → 2.0.0a6__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 (215) 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 +119 -1
  5. mirascope/api/_generated/annotations/__init__.py +33 -0
  6. mirascope/api/_generated/annotations/client.py +474 -0
  7. mirascope/api/_generated/annotations/raw_client.py +1095 -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 +35 -0
  11. mirascope/api/_generated/annotations/types/annotations_create_response_label.py +5 -0
  12. mirascope/api/_generated/annotations/types/annotations_get_response.py +35 -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 +35 -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 +35 -0
  20. mirascope/api/_generated/annotations/types/annotations_update_response_label.py +5 -0
  21. mirascope/api/_generated/api_keys/__init__.py +7 -0
  22. mirascope/api/_generated/api_keys/client.py +429 -0
  23. mirascope/api/_generated/api_keys/raw_client.py +788 -0
  24. mirascope/api/_generated/api_keys/types/__init__.py +9 -0
  25. mirascope/api/_generated/api_keys/types/api_keys_create_response.py +28 -0
  26. mirascope/api/_generated/api_keys/types/api_keys_get_response.py +27 -0
  27. mirascope/api/_generated/api_keys/types/api_keys_list_response_item.py +27 -0
  28. mirascope/api/_generated/client.py +12 -0
  29. mirascope/api/_generated/core/client_wrapper.py +2 -14
  30. mirascope/api/_generated/core/datetime_utils.py +1 -3
  31. mirascope/api/_generated/core/file.py +2 -5
  32. mirascope/api/_generated/core/http_client.py +36 -112
  33. mirascope/api/_generated/core/jsonable_encoder.py +1 -3
  34. mirascope/api/_generated/core/pydantic_utilities.py +19 -74
  35. mirascope/api/_generated/core/query_encoder.py +1 -3
  36. mirascope/api/_generated/core/serialization.py +4 -10
  37. mirascope/api/_generated/docs/client.py +2 -6
  38. mirascope/api/_generated/docs/raw_client.py +4 -20
  39. mirascope/api/_generated/environments/__init__.py +17 -0
  40. mirascope/api/_generated/environments/client.py +500 -0
  41. mirascope/api/_generated/environments/raw_client.py +999 -0
  42. mirascope/api/_generated/environments/types/__init__.py +15 -0
  43. mirascope/api/_generated/environments/types/environments_create_response.py +24 -0
  44. mirascope/api/_generated/environments/types/environments_get_response.py +24 -0
  45. mirascope/api/_generated/environments/types/environments_list_response_item.py +24 -0
  46. mirascope/api/_generated/environments/types/environments_update_response.py +24 -0
  47. mirascope/api/_generated/errors/__init__.py +2 -0
  48. mirascope/api/_generated/errors/bad_request_error.py +1 -5
  49. mirascope/api/_generated/errors/conflict_error.py +1 -5
  50. mirascope/api/_generated/errors/forbidden_error.py +1 -5
  51. mirascope/api/_generated/errors/internal_server_error.py +1 -6
  52. mirascope/api/_generated/errors/not_found_error.py +1 -5
  53. mirascope/api/_generated/errors/unauthorized_error.py +11 -0
  54. mirascope/api/_generated/functions/__init__.py +29 -0
  55. mirascope/api/_generated/functions/client.py +433 -0
  56. mirascope/api/_generated/functions/raw_client.py +1049 -0
  57. mirascope/api/_generated/functions/types/__init__.py +29 -0
  58. mirascope/api/_generated/functions/types/functions_create_request_dependencies_value.py +20 -0
  59. mirascope/api/_generated/functions/types/functions_create_response.py +37 -0
  60. mirascope/api/_generated/functions/types/functions_create_response_dependencies_value.py +20 -0
  61. mirascope/api/_generated/functions/types/functions_find_by_hash_response.py +39 -0
  62. mirascope/api/_generated/functions/types/functions_find_by_hash_response_dependencies_value.py +20 -0
  63. mirascope/api/_generated/functions/types/functions_get_response.py +37 -0
  64. mirascope/api/_generated/functions/types/functions_get_response_dependencies_value.py +20 -0
  65. mirascope/api/_generated/functions/types/functions_list_response.py +21 -0
  66. mirascope/api/_generated/functions/types/functions_list_response_functions_item.py +41 -0
  67. mirascope/api/_generated/functions/types/functions_list_response_functions_item_dependencies_value.py +20 -0
  68. mirascope/api/_generated/health/client.py +2 -6
  69. mirascope/api/_generated/health/raw_client.py +5 -23
  70. mirascope/api/_generated/health/types/health_check_response.py +1 -3
  71. mirascope/api/_generated/organizations/__init__.py +2 -0
  72. mirascope/api/_generated/organizations/client.py +94 -27
  73. mirascope/api/_generated/organizations/raw_client.py +246 -128
  74. mirascope/api/_generated/organizations/types/__init__.py +2 -0
  75. mirascope/api/_generated/organizations/types/organizations_create_response.py +5 -3
  76. mirascope/api/_generated/organizations/types/organizations_create_response_role.py +1 -3
  77. mirascope/api/_generated/organizations/types/organizations_credits_response.py +19 -0
  78. mirascope/api/_generated/organizations/types/organizations_get_response.py +5 -3
  79. mirascope/api/_generated/organizations/types/organizations_get_response_role.py +1 -3
  80. mirascope/api/_generated/organizations/types/organizations_list_response_item.py +5 -3
  81. mirascope/api/_generated/organizations/types/organizations_list_response_item_role.py +1 -3
  82. mirascope/api/_generated/organizations/types/organizations_update_response.py +5 -3
  83. mirascope/api/_generated/organizations/types/organizations_update_response_role.py +1 -3
  84. mirascope/api/_generated/projects/__init__.py +2 -12
  85. mirascope/api/_generated/projects/client.py +38 -68
  86. mirascope/api/_generated/projects/raw_client.py +92 -163
  87. mirascope/api/_generated/projects/types/__init__.py +1 -6
  88. mirascope/api/_generated/projects/types/projects_create_response.py +4 -9
  89. mirascope/api/_generated/projects/types/projects_get_response.py +4 -9
  90. mirascope/api/_generated/projects/types/projects_list_response_item.py +4 -9
  91. mirascope/api/_generated/projects/types/projects_update_response.py +4 -9
  92. mirascope/api/_generated/reference.md +1862 -70
  93. mirascope/api/_generated/traces/__init__.py +22 -0
  94. mirascope/api/_generated/traces/client.py +398 -0
  95. mirascope/api/_generated/traces/raw_client.py +902 -18
  96. mirascope/api/_generated/traces/types/__init__.py +32 -0
  97. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item.py +4 -11
  98. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource.py +2 -6
  99. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item.py +1 -3
  100. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value.py +8 -24
  101. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_array_value.py +2 -6
  102. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value.py +3 -9
  103. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value_values_item.py +2 -6
  104. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item.py +3 -9
  105. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope.py +4 -8
  106. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item.py +2 -6
  107. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value.py +8 -24
  108. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_array_value.py +2 -6
  109. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value.py +3 -9
  110. 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
  111. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item.py +6 -18
  112. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item.py +3 -9
  113. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value.py +8 -24
  114. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_array_value.py +2 -6
  115. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value.py +2 -6
  116. 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
  117. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_status.py +2 -6
  118. mirascope/api/_generated/traces/types/traces_create_response.py +2 -5
  119. mirascope/api/_generated/traces/types/traces_create_response_partial_success.py +3 -9
  120. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response.py +54 -0
  121. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_functions_item.py +24 -0
  122. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_models_item.py +22 -0
  123. mirascope/api/_generated/traces/types/traces_get_trace_detail_response.py +33 -0
  124. mirascope/api/_generated/traces/types/traces_get_trace_detail_response_spans_item.py +90 -0
  125. mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item.py +26 -0
  126. mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item_operator.py +7 -0
  127. mirascope/api/_generated/traces/types/traces_search_request_sort_by.py +7 -0
  128. mirascope/api/_generated/traces/types/traces_search_request_sort_order.py +5 -0
  129. mirascope/api/_generated/traces/types/traces_search_response.py +26 -0
  130. mirascope/api/_generated/traces/types/traces_search_response_spans_item.py +41 -0
  131. mirascope/api/_generated/types/__init__.py +18 -0
  132. mirascope/api/_generated/types/already_exists_error.py +1 -3
  133. mirascope/api/_generated/types/click_house_error.py +22 -0
  134. mirascope/api/_generated/types/database_error.py +1 -3
  135. mirascope/api/_generated/types/http_api_decode_error.py +1 -3
  136. mirascope/api/_generated/types/internal_server_error_body.py +49 -0
  137. mirascope/api/_generated/types/issue.py +1 -3
  138. mirascope/api/_generated/types/issue_tag.py +1 -8
  139. mirascope/api/_generated/types/not_found_error_body.py +1 -3
  140. mirascope/api/_generated/types/number_from_string.py +3 -0
  141. mirascope/api/_generated/types/permission_denied_error.py +1 -3
  142. mirascope/api/_generated/types/permission_denied_error_tag.py +1 -3
  143. mirascope/api/_generated/types/property_key_key.py +1 -3
  144. mirascope/api/_generated/types/stripe_error.py +20 -0
  145. mirascope/api/_generated/types/unauthorized_error_body.py +21 -0
  146. mirascope/api/_generated/types/unauthorized_error_tag.py +5 -0
  147. mirascope/llm/__init__.py +6 -2
  148. mirascope/llm/content/tool_call.py +6 -0
  149. mirascope/llm/exceptions.py +28 -0
  150. mirascope/llm/formatting/__init__.py +2 -2
  151. mirascope/llm/formatting/format.py +120 -8
  152. mirascope/llm/formatting/types.py +1 -56
  153. mirascope/llm/mcp/__init__.py +2 -2
  154. mirascope/llm/mcp/mcp_client.py +130 -0
  155. mirascope/llm/providers/__init__.py +26 -5
  156. mirascope/llm/providers/anthropic/__init__.py +3 -21
  157. mirascope/llm/providers/anthropic/_utils/__init__.py +2 -0
  158. mirascope/llm/providers/anthropic/_utils/beta_decode.py +4 -2
  159. mirascope/llm/providers/anthropic/_utils/beta_encode.py +13 -12
  160. mirascope/llm/providers/anthropic/_utils/decode.py +4 -2
  161. mirascope/llm/providers/anthropic/_utils/encode.py +57 -14
  162. mirascope/llm/providers/anthropic/_utils/errors.py +46 -0
  163. mirascope/llm/providers/anthropic/beta_provider.py +6 -0
  164. mirascope/llm/providers/anthropic/provider.py +5 -0
  165. mirascope/llm/providers/base/__init__.py +5 -2
  166. mirascope/llm/providers/base/_utils.py +2 -7
  167. mirascope/llm/providers/base/base_provider.py +173 -58
  168. mirascope/llm/providers/base/params.py +63 -34
  169. mirascope/llm/providers/google/__init__.py +2 -17
  170. mirascope/llm/providers/google/_utils/__init__.py +2 -0
  171. mirascope/llm/providers/google/_utils/decode.py +17 -8
  172. mirascope/llm/providers/google/_utils/encode.py +105 -16
  173. mirascope/llm/providers/google/_utils/errors.py +49 -0
  174. mirascope/llm/providers/google/model_info.py +1 -0
  175. mirascope/llm/providers/google/provider.py +9 -5
  176. mirascope/llm/providers/mirascope/__init__.py +5 -0
  177. mirascope/llm/providers/mirascope/_utils.py +77 -0
  178. mirascope/llm/providers/mirascope/provider.py +318 -0
  179. mirascope/llm/providers/mlx/__init__.py +2 -17
  180. mirascope/llm/providers/mlx/_utils.py +9 -2
  181. mirascope/llm/providers/mlx/provider.py +8 -0
  182. mirascope/llm/providers/ollama/__init__.py +1 -13
  183. mirascope/llm/providers/openai/__init__.py +10 -1
  184. mirascope/llm/providers/openai/_utils/__init__.py +5 -0
  185. mirascope/llm/providers/openai/_utils/errors.py +46 -0
  186. mirascope/llm/providers/openai/completions/__init__.py +2 -20
  187. mirascope/llm/providers/openai/completions/_utils/decode.py +14 -3
  188. mirascope/llm/providers/openai/completions/_utils/encode.py +15 -12
  189. mirascope/llm/providers/openai/completions/base_provider.py +6 -6
  190. mirascope/llm/providers/openai/provider.py +14 -1
  191. mirascope/llm/providers/openai/responses/__init__.py +1 -17
  192. mirascope/llm/providers/openai/responses/_utils/decode.py +2 -2
  193. mirascope/llm/providers/openai/responses/_utils/encode.py +43 -15
  194. mirascope/llm/providers/openai/responses/provider.py +13 -7
  195. mirascope/llm/providers/provider_id.py +1 -0
  196. mirascope/llm/providers/provider_registry.py +59 -3
  197. mirascope/llm/providers/together/__init__.py +1 -13
  198. mirascope/llm/responses/base_stream_response.py +24 -20
  199. mirascope/llm/tools/decorator.py +8 -4
  200. mirascope/llm/tools/tool_schema.py +33 -6
  201. mirascope/llm/tools/tools.py +84 -16
  202. mirascope/ops/__init__.py +60 -109
  203. mirascope/ops/_internal/closure.py +62 -11
  204. mirascope/ops/_internal/instrumentation/llm/llm.py +1 -2
  205. mirascope/ops/_internal/traced_functions.py +23 -4
  206. mirascope/ops/_internal/versioned_functions.py +54 -43
  207. {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a6.dist-info}/METADATA +7 -7
  208. mirascope-2.0.0a6.dist-info/RECORD +316 -0
  209. mirascope/llm/formatting/_utils.py +0 -78
  210. mirascope/llm/mcp/client.py +0 -118
  211. mirascope/llm/providers/_missing_import_stubs.py +0 -49
  212. mirascope/llm/providers/load_provider.py +0 -54
  213. mirascope-2.0.0a4.dist-info/RECORD +0 -247
  214. {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a6.dist-info}/WHEEL +0 -0
  215. {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a6.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,500 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from .raw_client import AsyncRawEnvironmentsClient, RawEnvironmentsClient
8
+ from .types.environments_create_response import EnvironmentsCreateResponse
9
+ from .types.environments_get_response import EnvironmentsGetResponse
10
+ from .types.environments_list_response_item import EnvironmentsListResponseItem
11
+ from .types.environments_update_response import EnvironmentsUpdateResponse
12
+
13
+ # this is used as the default value for optional parameters
14
+ OMIT = typing.cast(typing.Any, ...)
15
+
16
+
17
+ class EnvironmentsClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._raw_client = RawEnvironmentsClient(client_wrapper=client_wrapper)
20
+
21
+ @property
22
+ def with_raw_response(self) -> RawEnvironmentsClient:
23
+ """
24
+ Retrieves a raw implementation of this client that returns raw responses.
25
+
26
+ Returns
27
+ -------
28
+ RawEnvironmentsClient
29
+ """
30
+ return self._raw_client
31
+
32
+ def list(
33
+ self, organization_id: str, project_id: str, *, request_options: typing.Optional[RequestOptions] = None
34
+ ) -> typing.List[EnvironmentsListResponseItem]:
35
+ """
36
+ Parameters
37
+ ----------
38
+ organization_id : str
39
+
40
+ project_id : str
41
+
42
+ request_options : typing.Optional[RequestOptions]
43
+ Request-specific configuration.
44
+
45
+ Returns
46
+ -------
47
+ typing.List[EnvironmentsListResponseItem]
48
+ Success
49
+
50
+ Examples
51
+ --------
52
+ from mirascope.api._generated import Mirascope
53
+
54
+ client = Mirascope()
55
+ client.environments.list(
56
+ organization_id="organizationId",
57
+ project_id="projectId",
58
+ )
59
+ """
60
+ _response = self._raw_client.list(organization_id, project_id, request_options=request_options)
61
+ return _response.data
62
+
63
+ def create(
64
+ self,
65
+ organization_id: str,
66
+ project_id: str,
67
+ *,
68
+ name: str,
69
+ slug: str,
70
+ request_options: typing.Optional[RequestOptions] = None,
71
+ ) -> EnvironmentsCreateResponse:
72
+ """
73
+ Parameters
74
+ ----------
75
+ organization_id : str
76
+
77
+ project_id : str
78
+
79
+ name : str
80
+ a string at most 100 character(s) long
81
+
82
+ slug : str
83
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
84
+
85
+ request_options : typing.Optional[RequestOptions]
86
+ Request-specific configuration.
87
+
88
+ Returns
89
+ -------
90
+ EnvironmentsCreateResponse
91
+ Success
92
+
93
+ Examples
94
+ --------
95
+ from mirascope.api._generated import Mirascope
96
+
97
+ client = Mirascope()
98
+ client.environments.create(
99
+ organization_id="organizationId",
100
+ project_id="projectId",
101
+ name="name",
102
+ slug="slug",
103
+ )
104
+ """
105
+ _response = self._raw_client.create(
106
+ organization_id, project_id, name=name, slug=slug, request_options=request_options
107
+ )
108
+ return _response.data
109
+
110
+ def get(
111
+ self,
112
+ organization_id: str,
113
+ project_id: str,
114
+ environment_id: str,
115
+ *,
116
+ request_options: typing.Optional[RequestOptions] = None,
117
+ ) -> EnvironmentsGetResponse:
118
+ """
119
+ Parameters
120
+ ----------
121
+ organization_id : str
122
+
123
+ project_id : str
124
+
125
+ environment_id : str
126
+
127
+ request_options : typing.Optional[RequestOptions]
128
+ Request-specific configuration.
129
+
130
+ Returns
131
+ -------
132
+ EnvironmentsGetResponse
133
+ Success
134
+
135
+ Examples
136
+ --------
137
+ from mirascope.api._generated import Mirascope
138
+
139
+ client = Mirascope()
140
+ client.environments.get(
141
+ organization_id="organizationId",
142
+ project_id="projectId",
143
+ environment_id="environmentId",
144
+ )
145
+ """
146
+ _response = self._raw_client.get(organization_id, project_id, environment_id, request_options=request_options)
147
+ return _response.data
148
+
149
+ def update(
150
+ self,
151
+ organization_id: str,
152
+ project_id: str,
153
+ environment_id: str,
154
+ *,
155
+ name: typing.Optional[str] = OMIT,
156
+ slug: typing.Optional[str] = OMIT,
157
+ request_options: typing.Optional[RequestOptions] = None,
158
+ ) -> EnvironmentsUpdateResponse:
159
+ """
160
+ Parameters
161
+ ----------
162
+ organization_id : str
163
+
164
+ project_id : str
165
+
166
+ environment_id : str
167
+
168
+ name : typing.Optional[str]
169
+ a string at most 100 character(s) long
170
+
171
+ slug : typing.Optional[str]
172
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
173
+
174
+ request_options : typing.Optional[RequestOptions]
175
+ Request-specific configuration.
176
+
177
+ Returns
178
+ -------
179
+ EnvironmentsUpdateResponse
180
+ Success
181
+
182
+ Examples
183
+ --------
184
+ from mirascope.api._generated import Mirascope
185
+
186
+ client = Mirascope()
187
+ client.environments.update(
188
+ organization_id="organizationId",
189
+ project_id="projectId",
190
+ environment_id="environmentId",
191
+ )
192
+ """
193
+ _response = self._raw_client.update(
194
+ organization_id, project_id, environment_id, name=name, slug=slug, request_options=request_options
195
+ )
196
+ return _response.data
197
+
198
+ def delete(
199
+ self,
200
+ organization_id: str,
201
+ project_id: str,
202
+ environment_id: str,
203
+ *,
204
+ request_options: typing.Optional[RequestOptions] = None,
205
+ ) -> None:
206
+ """
207
+ Parameters
208
+ ----------
209
+ organization_id : str
210
+
211
+ project_id : str
212
+
213
+ environment_id : str
214
+
215
+ request_options : typing.Optional[RequestOptions]
216
+ Request-specific configuration.
217
+
218
+ Returns
219
+ -------
220
+ None
221
+
222
+ Examples
223
+ --------
224
+ from mirascope.api._generated import Mirascope
225
+
226
+ client = Mirascope()
227
+ client.environments.delete(
228
+ organization_id="organizationId",
229
+ project_id="projectId",
230
+ environment_id="environmentId",
231
+ )
232
+ """
233
+ _response = self._raw_client.delete(
234
+ organization_id, project_id, environment_id, request_options=request_options
235
+ )
236
+ return _response.data
237
+
238
+
239
+ class AsyncEnvironmentsClient:
240
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
241
+ self._raw_client = AsyncRawEnvironmentsClient(client_wrapper=client_wrapper)
242
+
243
+ @property
244
+ def with_raw_response(self) -> AsyncRawEnvironmentsClient:
245
+ """
246
+ Retrieves a raw implementation of this client that returns raw responses.
247
+
248
+ Returns
249
+ -------
250
+ AsyncRawEnvironmentsClient
251
+ """
252
+ return self._raw_client
253
+
254
+ async def list(
255
+ self, organization_id: str, project_id: str, *, request_options: typing.Optional[RequestOptions] = None
256
+ ) -> typing.List[EnvironmentsListResponseItem]:
257
+ """
258
+ Parameters
259
+ ----------
260
+ organization_id : str
261
+
262
+ project_id : str
263
+
264
+ request_options : typing.Optional[RequestOptions]
265
+ Request-specific configuration.
266
+
267
+ Returns
268
+ -------
269
+ typing.List[EnvironmentsListResponseItem]
270
+ Success
271
+
272
+ Examples
273
+ --------
274
+ import asyncio
275
+
276
+ from mirascope.api._generated import AsyncMirascope
277
+
278
+ client = AsyncMirascope()
279
+
280
+
281
+ async def main() -> None:
282
+ await client.environments.list(
283
+ organization_id="organizationId",
284
+ project_id="projectId",
285
+ )
286
+
287
+
288
+ asyncio.run(main())
289
+ """
290
+ _response = await self._raw_client.list(organization_id, project_id, request_options=request_options)
291
+ return _response.data
292
+
293
+ async def create(
294
+ self,
295
+ organization_id: str,
296
+ project_id: str,
297
+ *,
298
+ name: str,
299
+ slug: str,
300
+ request_options: typing.Optional[RequestOptions] = None,
301
+ ) -> EnvironmentsCreateResponse:
302
+ """
303
+ Parameters
304
+ ----------
305
+ organization_id : str
306
+
307
+ project_id : str
308
+
309
+ name : str
310
+ a string at most 100 character(s) long
311
+
312
+ slug : str
313
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
314
+
315
+ request_options : typing.Optional[RequestOptions]
316
+ Request-specific configuration.
317
+
318
+ Returns
319
+ -------
320
+ EnvironmentsCreateResponse
321
+ Success
322
+
323
+ Examples
324
+ --------
325
+ import asyncio
326
+
327
+ from mirascope.api._generated import AsyncMirascope
328
+
329
+ client = AsyncMirascope()
330
+
331
+
332
+ async def main() -> None:
333
+ await client.environments.create(
334
+ organization_id="organizationId",
335
+ project_id="projectId",
336
+ name="name",
337
+ slug="slug",
338
+ )
339
+
340
+
341
+ asyncio.run(main())
342
+ """
343
+ _response = await self._raw_client.create(
344
+ organization_id, project_id, name=name, slug=slug, request_options=request_options
345
+ )
346
+ return _response.data
347
+
348
+ async def get(
349
+ self,
350
+ organization_id: str,
351
+ project_id: str,
352
+ environment_id: str,
353
+ *,
354
+ request_options: typing.Optional[RequestOptions] = None,
355
+ ) -> EnvironmentsGetResponse:
356
+ """
357
+ Parameters
358
+ ----------
359
+ organization_id : str
360
+
361
+ project_id : str
362
+
363
+ environment_id : str
364
+
365
+ request_options : typing.Optional[RequestOptions]
366
+ Request-specific configuration.
367
+
368
+ Returns
369
+ -------
370
+ EnvironmentsGetResponse
371
+ Success
372
+
373
+ Examples
374
+ --------
375
+ import asyncio
376
+
377
+ from mirascope.api._generated import AsyncMirascope
378
+
379
+ client = AsyncMirascope()
380
+
381
+
382
+ async def main() -> None:
383
+ await client.environments.get(
384
+ organization_id="organizationId",
385
+ project_id="projectId",
386
+ environment_id="environmentId",
387
+ )
388
+
389
+
390
+ asyncio.run(main())
391
+ """
392
+ _response = await self._raw_client.get(
393
+ organization_id, project_id, environment_id, request_options=request_options
394
+ )
395
+ return _response.data
396
+
397
+ async def update(
398
+ self,
399
+ organization_id: str,
400
+ project_id: str,
401
+ environment_id: str,
402
+ *,
403
+ name: typing.Optional[str] = OMIT,
404
+ slug: typing.Optional[str] = OMIT,
405
+ request_options: typing.Optional[RequestOptions] = None,
406
+ ) -> EnvironmentsUpdateResponse:
407
+ """
408
+ Parameters
409
+ ----------
410
+ organization_id : str
411
+
412
+ project_id : str
413
+
414
+ environment_id : str
415
+
416
+ name : typing.Optional[str]
417
+ a string at most 100 character(s) long
418
+
419
+ slug : typing.Optional[str]
420
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
421
+
422
+ request_options : typing.Optional[RequestOptions]
423
+ Request-specific configuration.
424
+
425
+ Returns
426
+ -------
427
+ EnvironmentsUpdateResponse
428
+ Success
429
+
430
+ Examples
431
+ --------
432
+ import asyncio
433
+
434
+ from mirascope.api._generated import AsyncMirascope
435
+
436
+ client = AsyncMirascope()
437
+
438
+
439
+ async def main() -> None:
440
+ await client.environments.update(
441
+ organization_id="organizationId",
442
+ project_id="projectId",
443
+ environment_id="environmentId",
444
+ )
445
+
446
+
447
+ asyncio.run(main())
448
+ """
449
+ _response = await self._raw_client.update(
450
+ organization_id, project_id, environment_id, name=name, slug=slug, request_options=request_options
451
+ )
452
+ return _response.data
453
+
454
+ async def delete(
455
+ self,
456
+ organization_id: str,
457
+ project_id: str,
458
+ environment_id: str,
459
+ *,
460
+ request_options: typing.Optional[RequestOptions] = None,
461
+ ) -> None:
462
+ """
463
+ Parameters
464
+ ----------
465
+ organization_id : str
466
+
467
+ project_id : str
468
+
469
+ environment_id : str
470
+
471
+ request_options : typing.Optional[RequestOptions]
472
+ Request-specific configuration.
473
+
474
+ Returns
475
+ -------
476
+ None
477
+
478
+ Examples
479
+ --------
480
+ import asyncio
481
+
482
+ from mirascope.api._generated import AsyncMirascope
483
+
484
+ client = AsyncMirascope()
485
+
486
+
487
+ async def main() -> None:
488
+ await client.environments.delete(
489
+ organization_id="organizationId",
490
+ project_id="projectId",
491
+ environment_id="environmentId",
492
+ )
493
+
494
+
495
+ asyncio.run(main())
496
+ """
497
+ _response = await self._raw_client.delete(
498
+ organization_id, project_id, environment_id, request_options=request_options
499
+ )
500
+ return _response.data