mirascope 2.0.0a3__py3-none-any.whl → 2.0.0a5__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 (118) hide show
  1. mirascope/api/_generated/__init__.py +78 -6
  2. mirascope/api/_generated/api_keys/__init__.py +7 -0
  3. mirascope/api/_generated/api_keys/client.py +453 -0
  4. mirascope/api/_generated/api_keys/raw_client.py +853 -0
  5. mirascope/api/_generated/api_keys/types/__init__.py +9 -0
  6. mirascope/api/_generated/api_keys/types/api_keys_create_response.py +36 -0
  7. mirascope/api/_generated/api_keys/types/api_keys_get_response.py +35 -0
  8. mirascope/api/_generated/api_keys/types/api_keys_list_response_item.py +35 -0
  9. mirascope/api/_generated/client.py +14 -0
  10. mirascope/api/_generated/environments/__init__.py +17 -0
  11. mirascope/api/_generated/environments/client.py +532 -0
  12. mirascope/api/_generated/environments/raw_client.py +1088 -0
  13. mirascope/api/_generated/environments/types/__init__.py +15 -0
  14. mirascope/api/_generated/environments/types/environments_create_response.py +26 -0
  15. mirascope/api/_generated/environments/types/environments_get_response.py +26 -0
  16. mirascope/api/_generated/environments/types/environments_list_response_item.py +26 -0
  17. mirascope/api/_generated/environments/types/environments_update_response.py +26 -0
  18. mirascope/api/_generated/errors/__init__.py +11 -1
  19. mirascope/api/_generated/errors/conflict_error.py +15 -0
  20. mirascope/api/_generated/errors/forbidden_error.py +15 -0
  21. mirascope/api/_generated/errors/internal_server_error.py +15 -0
  22. mirascope/api/_generated/errors/not_found_error.py +15 -0
  23. mirascope/api/_generated/organizations/__init__.py +25 -0
  24. mirascope/api/_generated/organizations/client.py +404 -0
  25. mirascope/api/_generated/organizations/raw_client.py +902 -0
  26. mirascope/api/_generated/organizations/types/__init__.py +23 -0
  27. mirascope/api/_generated/organizations/types/organizations_create_response.py +25 -0
  28. mirascope/api/_generated/organizations/types/organizations_create_response_role.py +7 -0
  29. mirascope/api/_generated/organizations/types/organizations_get_response.py +25 -0
  30. mirascope/api/_generated/organizations/types/organizations_get_response_role.py +7 -0
  31. mirascope/api/_generated/organizations/types/organizations_list_response_item.py +25 -0
  32. mirascope/api/_generated/organizations/types/organizations_list_response_item_role.py +7 -0
  33. mirascope/api/_generated/organizations/types/organizations_update_response.py +25 -0
  34. mirascope/api/_generated/organizations/types/organizations_update_response_role.py +7 -0
  35. mirascope/api/_generated/projects/__init__.py +17 -0
  36. mirascope/api/_generated/projects/client.py +482 -0
  37. mirascope/api/_generated/projects/raw_client.py +1058 -0
  38. mirascope/api/_generated/projects/types/__init__.py +15 -0
  39. mirascope/api/_generated/projects/types/projects_create_response.py +31 -0
  40. mirascope/api/_generated/projects/types/projects_get_response.py +31 -0
  41. mirascope/api/_generated/projects/types/projects_list_response_item.py +31 -0
  42. mirascope/api/_generated/projects/types/projects_update_response.py +31 -0
  43. mirascope/api/_generated/reference.md +1311 -0
  44. mirascope/api/_generated/types/__init__.py +20 -4
  45. mirascope/api/_generated/types/already_exists_error.py +24 -0
  46. mirascope/api/_generated/types/already_exists_error_tag.py +5 -0
  47. mirascope/api/_generated/types/database_error.py +24 -0
  48. mirascope/api/_generated/types/database_error_tag.py +5 -0
  49. mirascope/api/_generated/types/http_api_decode_error.py +1 -3
  50. mirascope/api/_generated/types/issue.py +1 -5
  51. mirascope/api/_generated/types/not_found_error_body.py +24 -0
  52. mirascope/api/_generated/types/not_found_error_tag.py +5 -0
  53. mirascope/api/_generated/types/permission_denied_error.py +24 -0
  54. mirascope/api/_generated/types/permission_denied_error_tag.py +7 -0
  55. mirascope/api/_generated/types/property_key.py +2 -2
  56. mirascope/api/_generated/types/{property_key_tag.py → property_key_key.py} +3 -5
  57. mirascope/api/_generated/types/{property_key_tag_tag.py → property_key_key_tag.py} +1 -1
  58. mirascope/llm/__init__.py +6 -2
  59. mirascope/llm/exceptions.py +28 -0
  60. mirascope/llm/providers/__init__.py +12 -4
  61. mirascope/llm/providers/anthropic/__init__.py +6 -1
  62. mirascope/llm/providers/anthropic/_utils/__init__.py +17 -5
  63. mirascope/llm/providers/anthropic/_utils/beta_decode.py +271 -0
  64. mirascope/llm/providers/anthropic/_utils/beta_encode.py +216 -0
  65. mirascope/llm/providers/anthropic/_utils/decode.py +39 -7
  66. mirascope/llm/providers/anthropic/_utils/encode.py +156 -64
  67. mirascope/llm/providers/anthropic/_utils/errors.py +46 -0
  68. mirascope/llm/providers/anthropic/beta_provider.py +328 -0
  69. mirascope/llm/providers/anthropic/model_id.py +10 -27
  70. mirascope/llm/providers/anthropic/model_info.py +87 -0
  71. mirascope/llm/providers/anthropic/provider.py +132 -145
  72. mirascope/llm/providers/base/__init__.py +2 -1
  73. mirascope/llm/providers/base/_utils.py +15 -1
  74. mirascope/llm/providers/base/base_provider.py +173 -58
  75. mirascope/llm/providers/google/_utils/__init__.py +2 -0
  76. mirascope/llm/providers/google/_utils/decode.py +55 -3
  77. mirascope/llm/providers/google/_utils/encode.py +14 -6
  78. mirascope/llm/providers/google/_utils/errors.py +49 -0
  79. mirascope/llm/providers/google/model_id.py +7 -13
  80. mirascope/llm/providers/google/model_info.py +62 -0
  81. mirascope/llm/providers/google/provider.py +13 -8
  82. mirascope/llm/providers/mlx/_utils.py +31 -2
  83. mirascope/llm/providers/mlx/encoding/transformers.py +17 -1
  84. mirascope/llm/providers/mlx/provider.py +12 -0
  85. mirascope/llm/providers/ollama/__init__.py +19 -0
  86. mirascope/llm/providers/ollama/provider.py +71 -0
  87. mirascope/llm/providers/openai/__init__.py +10 -1
  88. mirascope/llm/providers/openai/_utils/__init__.py +5 -0
  89. mirascope/llm/providers/openai/_utils/errors.py +46 -0
  90. mirascope/llm/providers/openai/completions/__init__.py +6 -1
  91. mirascope/llm/providers/openai/completions/_utils/decode.py +57 -5
  92. mirascope/llm/providers/openai/completions/_utils/encode.py +9 -8
  93. mirascope/llm/providers/openai/completions/base_provider.py +513 -0
  94. mirascope/llm/providers/openai/completions/provider.py +13 -447
  95. mirascope/llm/providers/openai/model_info.py +57 -0
  96. mirascope/llm/providers/openai/provider.py +30 -5
  97. mirascope/llm/providers/openai/responses/_utils/decode.py +55 -4
  98. mirascope/llm/providers/openai/responses/_utils/encode.py +9 -9
  99. mirascope/llm/providers/openai/responses/provider.py +33 -28
  100. mirascope/llm/providers/provider_id.py +11 -1
  101. mirascope/llm/providers/provider_registry.py +59 -4
  102. mirascope/llm/providers/together/__init__.py +19 -0
  103. mirascope/llm/providers/together/provider.py +40 -0
  104. mirascope/llm/responses/__init__.py +3 -0
  105. mirascope/llm/responses/base_response.py +4 -0
  106. mirascope/llm/responses/base_stream_response.py +25 -1
  107. mirascope/llm/responses/finish_reason.py +1 -0
  108. mirascope/llm/responses/response.py +9 -0
  109. mirascope/llm/responses/root_response.py +5 -1
  110. mirascope/llm/responses/usage.py +95 -0
  111. mirascope/ops/_internal/closure.py +62 -11
  112. {mirascope-2.0.0a3.dist-info → mirascope-2.0.0a5.dist-info}/METADATA +3 -3
  113. {mirascope-2.0.0a3.dist-info → mirascope-2.0.0a5.dist-info}/RECORD +115 -56
  114. mirascope/llm/providers/load_provider.py +0 -48
  115. mirascope/llm/providers/openai/shared/__init__.py +0 -7
  116. mirascope/llm/providers/openai/shared/_utils.py +0 -59
  117. {mirascope-2.0.0a3.dist-info → mirascope-2.0.0a5.dist-info}/WHEEL +0 -0
  118. {mirascope-2.0.0a3.dist-info → mirascope-2.0.0a5.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,9 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .api_keys_create_response import ApiKeysCreateResponse
6
+ from .api_keys_get_response import ApiKeysGetResponse
7
+ from .api_keys_list_response_item import ApiKeysListResponseItem
8
+
9
+ __all__ = ["ApiKeysCreateResponse", "ApiKeysGetResponse", "ApiKeysListResponseItem"]
@@ -0,0 +1,36 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class ApiKeysCreateResponse(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ key_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="keyPrefix")]
15
+ environment_id: typing_extensions.Annotated[
16
+ str, FieldMetadata(alias="environmentId")
17
+ ]
18
+ 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
25
+ key: str
26
+
27
+ if IS_PYDANTIC_V2:
28
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
29
+ extra="allow", frozen=True
30
+ ) # type: ignore # Pydantic v2
31
+ else:
32
+
33
+ class Config:
34
+ frozen = True
35
+ smart_union = True
36
+ extra = pydantic.Extra.allow
@@ -0,0 +1,35 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class ApiKeysGetResponse(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ key_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="keyPrefix")]
15
+ environment_id: typing_extensions.Annotated[
16
+ str, FieldMetadata(alias="environmentId")
17
+ ]
18
+ 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
25
+
26
+ if IS_PYDANTIC_V2:
27
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
28
+ extra="allow", frozen=True
29
+ ) # type: ignore # Pydantic v2
30
+ else:
31
+
32
+ class Config:
33
+ frozen = True
34
+ smart_union = True
35
+ extra = pydantic.Extra.allow
@@ -0,0 +1,35 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class ApiKeysListResponseItem(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ key_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="keyPrefix")]
15
+ environment_id: typing_extensions.Annotated[
16
+ str, FieldMetadata(alias="environmentId")
17
+ ]
18
+ 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
25
+
26
+ if IS_PYDANTIC_V2:
27
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
28
+ extra="allow", frozen=True
29
+ ) # type: ignore # Pydantic v2
30
+ else:
31
+
32
+ class Config:
33
+ frozen = True
34
+ smart_union = True
35
+ extra = pydantic.Extra.allow
@@ -3,10 +3,14 @@
3
3
  import typing
4
4
 
5
5
  import httpx
6
+ from .api_keys.client import ApiKeysClient, AsyncApiKeysClient
6
7
  from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
8
  from .docs.client import AsyncDocsClient, DocsClient
8
9
  from .environment import MirascopeEnvironment
10
+ from .environments.client import AsyncEnvironmentsClient, EnvironmentsClient
9
11
  from .health.client import AsyncHealthClient, HealthClient
12
+ from .organizations.client import AsyncOrganizationsClient, OrganizationsClient
13
+ from .projects.client import AsyncProjectsClient, ProjectsClient
10
14
  from .traces.client import AsyncTracesClient, TracesClient
11
15
 
12
16
 
@@ -74,6 +78,10 @@ class Mirascope:
74
78
  self.health = HealthClient(client_wrapper=self._client_wrapper)
75
79
  self.traces = TracesClient(client_wrapper=self._client_wrapper)
76
80
  self.docs = DocsClient(client_wrapper=self._client_wrapper)
81
+ self.organizations = OrganizationsClient(client_wrapper=self._client_wrapper)
82
+ self.projects = ProjectsClient(client_wrapper=self._client_wrapper)
83
+ self.environments = EnvironmentsClient(client_wrapper=self._client_wrapper)
84
+ self.api_keys = ApiKeysClient(client_wrapper=self._client_wrapper)
77
85
 
78
86
 
79
87
  class AsyncMirascope:
@@ -140,6 +148,12 @@ class AsyncMirascope:
140
148
  self.health = AsyncHealthClient(client_wrapper=self._client_wrapper)
141
149
  self.traces = AsyncTracesClient(client_wrapper=self._client_wrapper)
142
150
  self.docs = AsyncDocsClient(client_wrapper=self._client_wrapper)
151
+ self.organizations = AsyncOrganizationsClient(
152
+ client_wrapper=self._client_wrapper
153
+ )
154
+ self.projects = AsyncProjectsClient(client_wrapper=self._client_wrapper)
155
+ self.environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper)
156
+ self.api_keys = AsyncApiKeysClient(client_wrapper=self._client_wrapper)
143
157
 
144
158
 
145
159
  def _get_base_url(
@@ -0,0 +1,17 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .types import (
6
+ EnvironmentsCreateResponse,
7
+ EnvironmentsGetResponse,
8
+ EnvironmentsListResponseItem,
9
+ EnvironmentsUpdateResponse,
10
+ )
11
+
12
+ __all__ = [
13
+ "EnvironmentsCreateResponse",
14
+ "EnvironmentsGetResponse",
15
+ "EnvironmentsListResponseItem",
16
+ "EnvironmentsUpdateResponse",
17
+ ]
@@ -0,0 +1,532 @@
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,
34
+ organization_id: str,
35
+ project_id: str,
36
+ *,
37
+ request_options: typing.Optional[RequestOptions] = None,
38
+ ) -> typing.List[EnvironmentsListResponseItem]:
39
+ """
40
+ Parameters
41
+ ----------
42
+ organization_id : str
43
+
44
+ project_id : str
45
+
46
+ request_options : typing.Optional[RequestOptions]
47
+ Request-specific configuration.
48
+
49
+ Returns
50
+ -------
51
+ typing.List[EnvironmentsListResponseItem]
52
+ Success
53
+
54
+ Examples
55
+ --------
56
+ from mirascope.api._generated import Mirascope
57
+
58
+ client = Mirascope()
59
+ client.environments.list(
60
+ organization_id="organizationId",
61
+ project_id="projectId",
62
+ )
63
+ """
64
+ _response = self._raw_client.list(
65
+ organization_id, project_id, request_options=request_options
66
+ )
67
+ return _response.data
68
+
69
+ def create(
70
+ self,
71
+ organization_id: str,
72
+ project_id: str,
73
+ *,
74
+ name: str,
75
+ slug: str,
76
+ request_options: typing.Optional[RequestOptions] = None,
77
+ ) -> EnvironmentsCreateResponse:
78
+ """
79
+ Parameters
80
+ ----------
81
+ organization_id : str
82
+
83
+ project_id : str
84
+
85
+ name : str
86
+ a string at most 100 character(s) long
87
+
88
+ slug : str
89
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
90
+
91
+ request_options : typing.Optional[RequestOptions]
92
+ Request-specific configuration.
93
+
94
+ Returns
95
+ -------
96
+ EnvironmentsCreateResponse
97
+ Success
98
+
99
+ Examples
100
+ --------
101
+ from mirascope.api._generated import Mirascope
102
+
103
+ client = Mirascope()
104
+ client.environments.create(
105
+ organization_id="organizationId",
106
+ project_id="projectId",
107
+ name="name",
108
+ slug="slug",
109
+ )
110
+ """
111
+ _response = self._raw_client.create(
112
+ organization_id,
113
+ project_id,
114
+ name=name,
115
+ slug=slug,
116
+ request_options=request_options,
117
+ )
118
+ return _response.data
119
+
120
+ def get(
121
+ self,
122
+ organization_id: str,
123
+ project_id: str,
124
+ environment_id: str,
125
+ *,
126
+ request_options: typing.Optional[RequestOptions] = None,
127
+ ) -> EnvironmentsGetResponse:
128
+ """
129
+ Parameters
130
+ ----------
131
+ organization_id : str
132
+
133
+ project_id : str
134
+
135
+ environment_id : str
136
+
137
+ request_options : typing.Optional[RequestOptions]
138
+ Request-specific configuration.
139
+
140
+ Returns
141
+ -------
142
+ EnvironmentsGetResponse
143
+ Success
144
+
145
+ Examples
146
+ --------
147
+ from mirascope.api._generated import Mirascope
148
+
149
+ client = Mirascope()
150
+ client.environments.get(
151
+ organization_id="organizationId",
152
+ project_id="projectId",
153
+ environment_id="environmentId",
154
+ )
155
+ """
156
+ _response = self._raw_client.get(
157
+ organization_id, project_id, environment_id, request_options=request_options
158
+ )
159
+ return _response.data
160
+
161
+ def update(
162
+ self,
163
+ organization_id: str,
164
+ project_id: str,
165
+ environment_id: str,
166
+ *,
167
+ name: typing.Optional[str] = OMIT,
168
+ slug: typing.Optional[str] = OMIT,
169
+ request_options: typing.Optional[RequestOptions] = None,
170
+ ) -> EnvironmentsUpdateResponse:
171
+ """
172
+ Parameters
173
+ ----------
174
+ organization_id : str
175
+
176
+ project_id : str
177
+
178
+ environment_id : str
179
+
180
+ name : typing.Optional[str]
181
+ a string at most 100 character(s) long
182
+
183
+ slug : typing.Optional[str]
184
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
185
+
186
+ request_options : typing.Optional[RequestOptions]
187
+ Request-specific configuration.
188
+
189
+ Returns
190
+ -------
191
+ EnvironmentsUpdateResponse
192
+ Success
193
+
194
+ Examples
195
+ --------
196
+ from mirascope.api._generated import Mirascope
197
+
198
+ client = Mirascope()
199
+ client.environments.update(
200
+ organization_id="organizationId",
201
+ project_id="projectId",
202
+ environment_id="environmentId",
203
+ )
204
+ """
205
+ _response = self._raw_client.update(
206
+ organization_id,
207
+ project_id,
208
+ environment_id,
209
+ name=name,
210
+ slug=slug,
211
+ request_options=request_options,
212
+ )
213
+ return _response.data
214
+
215
+ def delete(
216
+ self,
217
+ organization_id: str,
218
+ project_id: str,
219
+ environment_id: str,
220
+ *,
221
+ request_options: typing.Optional[RequestOptions] = None,
222
+ ) -> None:
223
+ """
224
+ Parameters
225
+ ----------
226
+ organization_id : str
227
+
228
+ project_id : str
229
+
230
+ environment_id : str
231
+
232
+ request_options : typing.Optional[RequestOptions]
233
+ Request-specific configuration.
234
+
235
+ Returns
236
+ -------
237
+ None
238
+
239
+ Examples
240
+ --------
241
+ from mirascope.api._generated import Mirascope
242
+
243
+ client = Mirascope()
244
+ client.environments.delete(
245
+ organization_id="organizationId",
246
+ project_id="projectId",
247
+ environment_id="environmentId",
248
+ )
249
+ """
250
+ _response = self._raw_client.delete(
251
+ organization_id, project_id, environment_id, request_options=request_options
252
+ )
253
+ return _response.data
254
+
255
+
256
+ class AsyncEnvironmentsClient:
257
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
258
+ self._raw_client = AsyncRawEnvironmentsClient(client_wrapper=client_wrapper)
259
+
260
+ @property
261
+ def with_raw_response(self) -> AsyncRawEnvironmentsClient:
262
+ """
263
+ Retrieves a raw implementation of this client that returns raw responses.
264
+
265
+ Returns
266
+ -------
267
+ AsyncRawEnvironmentsClient
268
+ """
269
+ return self._raw_client
270
+
271
+ async def list(
272
+ self,
273
+ organization_id: str,
274
+ project_id: str,
275
+ *,
276
+ request_options: typing.Optional[RequestOptions] = None,
277
+ ) -> typing.List[EnvironmentsListResponseItem]:
278
+ """
279
+ Parameters
280
+ ----------
281
+ organization_id : str
282
+
283
+ project_id : str
284
+
285
+ request_options : typing.Optional[RequestOptions]
286
+ Request-specific configuration.
287
+
288
+ Returns
289
+ -------
290
+ typing.List[EnvironmentsListResponseItem]
291
+ Success
292
+
293
+ Examples
294
+ --------
295
+ import asyncio
296
+
297
+ from mirascope.api._generated import AsyncMirascope
298
+
299
+ client = AsyncMirascope()
300
+
301
+
302
+ async def main() -> None:
303
+ await client.environments.list(
304
+ organization_id="organizationId",
305
+ project_id="projectId",
306
+ )
307
+
308
+
309
+ asyncio.run(main())
310
+ """
311
+ _response = await self._raw_client.list(
312
+ organization_id, project_id, request_options=request_options
313
+ )
314
+ return _response.data
315
+
316
+ async def create(
317
+ self,
318
+ organization_id: str,
319
+ project_id: str,
320
+ *,
321
+ name: str,
322
+ slug: str,
323
+ request_options: typing.Optional[RequestOptions] = None,
324
+ ) -> EnvironmentsCreateResponse:
325
+ """
326
+ Parameters
327
+ ----------
328
+ organization_id : str
329
+
330
+ project_id : str
331
+
332
+ name : str
333
+ a string at most 100 character(s) long
334
+
335
+ slug : str
336
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
337
+
338
+ request_options : typing.Optional[RequestOptions]
339
+ Request-specific configuration.
340
+
341
+ Returns
342
+ -------
343
+ EnvironmentsCreateResponse
344
+ Success
345
+
346
+ Examples
347
+ --------
348
+ import asyncio
349
+
350
+ from mirascope.api._generated import AsyncMirascope
351
+
352
+ client = AsyncMirascope()
353
+
354
+
355
+ async def main() -> None:
356
+ await client.environments.create(
357
+ organization_id="organizationId",
358
+ project_id="projectId",
359
+ name="name",
360
+ slug="slug",
361
+ )
362
+
363
+
364
+ asyncio.run(main())
365
+ """
366
+ _response = await self._raw_client.create(
367
+ organization_id,
368
+ project_id,
369
+ name=name,
370
+ slug=slug,
371
+ request_options=request_options,
372
+ )
373
+ return _response.data
374
+
375
+ async def get(
376
+ self,
377
+ organization_id: str,
378
+ project_id: str,
379
+ environment_id: str,
380
+ *,
381
+ request_options: typing.Optional[RequestOptions] = None,
382
+ ) -> EnvironmentsGetResponse:
383
+ """
384
+ Parameters
385
+ ----------
386
+ organization_id : str
387
+
388
+ project_id : str
389
+
390
+ environment_id : str
391
+
392
+ request_options : typing.Optional[RequestOptions]
393
+ Request-specific configuration.
394
+
395
+ Returns
396
+ -------
397
+ EnvironmentsGetResponse
398
+ Success
399
+
400
+ Examples
401
+ --------
402
+ import asyncio
403
+
404
+ from mirascope.api._generated import AsyncMirascope
405
+
406
+ client = AsyncMirascope()
407
+
408
+
409
+ async def main() -> None:
410
+ await client.environments.get(
411
+ organization_id="organizationId",
412
+ project_id="projectId",
413
+ environment_id="environmentId",
414
+ )
415
+
416
+
417
+ asyncio.run(main())
418
+ """
419
+ _response = await self._raw_client.get(
420
+ organization_id, project_id, environment_id, request_options=request_options
421
+ )
422
+ return _response.data
423
+
424
+ async def update(
425
+ self,
426
+ organization_id: str,
427
+ project_id: str,
428
+ environment_id: str,
429
+ *,
430
+ name: typing.Optional[str] = OMIT,
431
+ slug: typing.Optional[str] = OMIT,
432
+ request_options: typing.Optional[RequestOptions] = None,
433
+ ) -> EnvironmentsUpdateResponse:
434
+ """
435
+ Parameters
436
+ ----------
437
+ organization_id : str
438
+
439
+ project_id : str
440
+
441
+ environment_id : str
442
+
443
+ name : typing.Optional[str]
444
+ a string at most 100 character(s) long
445
+
446
+ slug : typing.Optional[str]
447
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
448
+
449
+ request_options : typing.Optional[RequestOptions]
450
+ Request-specific configuration.
451
+
452
+ Returns
453
+ -------
454
+ EnvironmentsUpdateResponse
455
+ Success
456
+
457
+ Examples
458
+ --------
459
+ import asyncio
460
+
461
+ from mirascope.api._generated import AsyncMirascope
462
+
463
+ client = AsyncMirascope()
464
+
465
+
466
+ async def main() -> None:
467
+ await client.environments.update(
468
+ organization_id="organizationId",
469
+ project_id="projectId",
470
+ environment_id="environmentId",
471
+ )
472
+
473
+
474
+ asyncio.run(main())
475
+ """
476
+ _response = await self._raw_client.update(
477
+ organization_id,
478
+ project_id,
479
+ environment_id,
480
+ name=name,
481
+ slug=slug,
482
+ request_options=request_options,
483
+ )
484
+ return _response.data
485
+
486
+ async def delete(
487
+ self,
488
+ organization_id: str,
489
+ project_id: str,
490
+ environment_id: str,
491
+ *,
492
+ request_options: typing.Optional[RequestOptions] = None,
493
+ ) -> None:
494
+ """
495
+ Parameters
496
+ ----------
497
+ organization_id : str
498
+
499
+ project_id : str
500
+
501
+ environment_id : str
502
+
503
+ request_options : typing.Optional[RequestOptions]
504
+ Request-specific configuration.
505
+
506
+ Returns
507
+ -------
508
+ None
509
+
510
+ Examples
511
+ --------
512
+ import asyncio
513
+
514
+ from mirascope.api._generated import AsyncMirascope
515
+
516
+ client = AsyncMirascope()
517
+
518
+
519
+ async def main() -> None:
520
+ await client.environments.delete(
521
+ organization_id="organizationId",
522
+ project_id="projectId",
523
+ environment_id="environmentId",
524
+ )
525
+
526
+
527
+ asyncio.run(main())
528
+ """
529
+ _response = await self._raw_client.delete(
530
+ organization_id, project_id, environment_id, request_options=request_options
531
+ )
532
+ return _response.data