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,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .environments_create_response import EnvironmentsCreateResponse
6
+ from .environments_get_response import EnvironmentsGetResponse
7
+ from .environments_list_response_item import EnvironmentsListResponseItem
8
+ from .environments_update_response import EnvironmentsUpdateResponse
9
+
10
+ __all__ = [
11
+ "EnvironmentsCreateResponse",
12
+ "EnvironmentsGetResponse",
13
+ "EnvironmentsListResponseItem",
14
+ "EnvironmentsUpdateResponse",
15
+ ]
@@ -0,0 +1,26 @@
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 EnvironmentsCreateResponse(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ slug: str
15
+ project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")]
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
19
+ extra="allow", frozen=True
20
+ ) # type: ignore # Pydantic v2
21
+ else:
22
+
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -0,0 +1,26 @@
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 EnvironmentsGetResponse(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ slug: str
15
+ project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")]
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
19
+ extra="allow", frozen=True
20
+ ) # type: ignore # Pydantic v2
21
+ else:
22
+
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -0,0 +1,26 @@
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 EnvironmentsListResponseItem(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ slug: str
15
+ project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")]
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
19
+ extra="allow", frozen=True
20
+ ) # type: ignore # Pydantic v2
21
+ else:
22
+
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -0,0 +1,26 @@
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 EnvironmentsUpdateResponse(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ slug: str
15
+ project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")]
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
19
+ extra="allow", frozen=True
20
+ ) # type: ignore # Pydantic v2
21
+ else:
22
+
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -3,5 +3,15 @@
3
3
  # isort: skip_file
4
4
 
5
5
  from .bad_request_error import BadRequestError
6
+ from .conflict_error import ConflictError
7
+ from .forbidden_error import ForbiddenError
8
+ from .internal_server_error import InternalServerError
9
+ from .not_found_error import NotFoundError
6
10
 
7
- __all__ = ["BadRequestError"]
11
+ __all__ = [
12
+ "BadRequestError",
13
+ "ConflictError",
14
+ "ForbiddenError",
15
+ "InternalServerError",
16
+ "NotFoundError",
17
+ ]
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+ from ..types.already_exists_error import AlreadyExistsError
7
+
8
+
9
+ class ConflictError(ApiError):
10
+ def __init__(
11
+ self,
12
+ body: AlreadyExistsError,
13
+ headers: typing.Optional[typing.Dict[str, str]] = None,
14
+ ):
15
+ super().__init__(status_code=409, headers=headers, body=body)
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+ from ..types.permission_denied_error import PermissionDeniedError
7
+
8
+
9
+ class ForbiddenError(ApiError):
10
+ def __init__(
11
+ self,
12
+ body: PermissionDeniedError,
13
+ headers: typing.Optional[typing.Dict[str, str]] = None,
14
+ ):
15
+ super().__init__(status_code=403, headers=headers, body=body)
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+ from ..types.database_error import DatabaseError
7
+
8
+
9
+ class InternalServerError(ApiError):
10
+ def __init__(
11
+ self,
12
+ body: DatabaseError,
13
+ headers: typing.Optional[typing.Dict[str, str]] = None,
14
+ ):
15
+ super().__init__(status_code=500, headers=headers, body=body)
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+ from ..types.not_found_error_body import NotFoundErrorBody
7
+
8
+
9
+ class NotFoundError(ApiError):
10
+ def __init__(
11
+ self,
12
+ body: NotFoundErrorBody,
13
+ headers: typing.Optional[typing.Dict[str, str]] = None,
14
+ ):
15
+ super().__init__(status_code=404, headers=headers, body=body)
@@ -0,0 +1,25 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .types import (
6
+ OrganizationsCreateResponse,
7
+ OrganizationsCreateResponseRole,
8
+ OrganizationsGetResponse,
9
+ OrganizationsGetResponseRole,
10
+ OrganizationsListResponseItem,
11
+ OrganizationsListResponseItemRole,
12
+ OrganizationsUpdateResponse,
13
+ OrganizationsUpdateResponseRole,
14
+ )
15
+
16
+ __all__ = [
17
+ "OrganizationsCreateResponse",
18
+ "OrganizationsCreateResponseRole",
19
+ "OrganizationsGetResponse",
20
+ "OrganizationsGetResponseRole",
21
+ "OrganizationsListResponseItem",
22
+ "OrganizationsListResponseItemRole",
23
+ "OrganizationsUpdateResponse",
24
+ "OrganizationsUpdateResponseRole",
25
+ ]
@@ -0,0 +1,404 @@
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 AsyncRawOrganizationsClient, RawOrganizationsClient
8
+ from .types.organizations_create_response import OrganizationsCreateResponse
9
+ from .types.organizations_get_response import OrganizationsGetResponse
10
+ from .types.organizations_list_response_item import OrganizationsListResponseItem
11
+ from .types.organizations_update_response import OrganizationsUpdateResponse
12
+
13
+ # this is used as the default value for optional parameters
14
+ OMIT = typing.cast(typing.Any, ...)
15
+
16
+
17
+ class OrganizationsClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._raw_client = RawOrganizationsClient(client_wrapper=client_wrapper)
20
+
21
+ @property
22
+ def with_raw_response(self) -> RawOrganizationsClient:
23
+ """
24
+ Retrieves a raw implementation of this client that returns raw responses.
25
+
26
+ Returns
27
+ -------
28
+ RawOrganizationsClient
29
+ """
30
+ return self._raw_client
31
+
32
+ def list(
33
+ self, *, request_options: typing.Optional[RequestOptions] = None
34
+ ) -> typing.List[OrganizationsListResponseItem]:
35
+ """
36
+ Parameters
37
+ ----------
38
+ request_options : typing.Optional[RequestOptions]
39
+ Request-specific configuration.
40
+
41
+ Returns
42
+ -------
43
+ typing.List[OrganizationsListResponseItem]
44
+ Success
45
+
46
+ Examples
47
+ --------
48
+ from mirascope.api._generated import Mirascope
49
+
50
+ client = Mirascope()
51
+ client.organizations.list()
52
+ """
53
+ _response = self._raw_client.list(request_options=request_options)
54
+ return _response.data
55
+
56
+ def create(
57
+ self,
58
+ *,
59
+ name: str,
60
+ slug: str,
61
+ request_options: typing.Optional[RequestOptions] = None,
62
+ ) -> OrganizationsCreateResponse:
63
+ """
64
+ Parameters
65
+ ----------
66
+ name : str
67
+ a string at most 100 character(s) long
68
+
69
+ slug : str
70
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
71
+
72
+ request_options : typing.Optional[RequestOptions]
73
+ Request-specific configuration.
74
+
75
+ Returns
76
+ -------
77
+ OrganizationsCreateResponse
78
+ Success
79
+
80
+ Examples
81
+ --------
82
+ from mirascope.api._generated import Mirascope
83
+
84
+ client = Mirascope()
85
+ client.organizations.create(
86
+ name="name",
87
+ slug="slug",
88
+ )
89
+ """
90
+ _response = self._raw_client.create(
91
+ name=name, slug=slug, request_options=request_options
92
+ )
93
+ return _response.data
94
+
95
+ def get(
96
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
97
+ ) -> OrganizationsGetResponse:
98
+ """
99
+ Parameters
100
+ ----------
101
+ id : str
102
+
103
+ request_options : typing.Optional[RequestOptions]
104
+ Request-specific configuration.
105
+
106
+ Returns
107
+ -------
108
+ OrganizationsGetResponse
109
+ Success
110
+
111
+ Examples
112
+ --------
113
+ from mirascope.api._generated import Mirascope
114
+
115
+ client = Mirascope()
116
+ client.organizations.get(
117
+ id="id",
118
+ )
119
+ """
120
+ _response = self._raw_client.get(id, request_options=request_options)
121
+ return _response.data
122
+
123
+ def update(
124
+ self,
125
+ id: str,
126
+ *,
127
+ name: typing.Optional[str] = OMIT,
128
+ slug: typing.Optional[str] = OMIT,
129
+ request_options: typing.Optional[RequestOptions] = None,
130
+ ) -> OrganizationsUpdateResponse:
131
+ """
132
+ Parameters
133
+ ----------
134
+ id : str
135
+
136
+ name : typing.Optional[str]
137
+ a string at most 100 character(s) long
138
+
139
+ slug : typing.Optional[str]
140
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
141
+
142
+ request_options : typing.Optional[RequestOptions]
143
+ Request-specific configuration.
144
+
145
+ Returns
146
+ -------
147
+ OrganizationsUpdateResponse
148
+ Success
149
+
150
+ Examples
151
+ --------
152
+ from mirascope.api._generated import Mirascope
153
+
154
+ client = Mirascope()
155
+ client.organizations.update(
156
+ id="id",
157
+ )
158
+ """
159
+ _response = self._raw_client.update(
160
+ id, name=name, slug=slug, request_options=request_options
161
+ )
162
+ return _response.data
163
+
164
+ def delete(
165
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
166
+ ) -> None:
167
+ """
168
+ Parameters
169
+ ----------
170
+ id : str
171
+
172
+ request_options : typing.Optional[RequestOptions]
173
+ Request-specific configuration.
174
+
175
+ Returns
176
+ -------
177
+ None
178
+
179
+ Examples
180
+ --------
181
+ from mirascope.api._generated import Mirascope
182
+
183
+ client = Mirascope()
184
+ client.organizations.delete(
185
+ id="id",
186
+ )
187
+ """
188
+ _response = self._raw_client.delete(id, request_options=request_options)
189
+ return _response.data
190
+
191
+
192
+ class AsyncOrganizationsClient:
193
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
194
+ self._raw_client = AsyncRawOrganizationsClient(client_wrapper=client_wrapper)
195
+
196
+ @property
197
+ def with_raw_response(self) -> AsyncRawOrganizationsClient:
198
+ """
199
+ Retrieves a raw implementation of this client that returns raw responses.
200
+
201
+ Returns
202
+ -------
203
+ AsyncRawOrganizationsClient
204
+ """
205
+ return self._raw_client
206
+
207
+ async def list(
208
+ self, *, request_options: typing.Optional[RequestOptions] = None
209
+ ) -> typing.List[OrganizationsListResponseItem]:
210
+ """
211
+ Parameters
212
+ ----------
213
+ request_options : typing.Optional[RequestOptions]
214
+ Request-specific configuration.
215
+
216
+ Returns
217
+ -------
218
+ typing.List[OrganizationsListResponseItem]
219
+ Success
220
+
221
+ Examples
222
+ --------
223
+ import asyncio
224
+
225
+ from mirascope.api._generated import AsyncMirascope
226
+
227
+ client = AsyncMirascope()
228
+
229
+
230
+ async def main() -> None:
231
+ await client.organizations.list()
232
+
233
+
234
+ asyncio.run(main())
235
+ """
236
+ _response = await self._raw_client.list(request_options=request_options)
237
+ return _response.data
238
+
239
+ async def create(
240
+ self,
241
+ *,
242
+ name: str,
243
+ slug: str,
244
+ request_options: typing.Optional[RequestOptions] = None,
245
+ ) -> OrganizationsCreateResponse:
246
+ """
247
+ Parameters
248
+ ----------
249
+ name : str
250
+ a string at most 100 character(s) long
251
+
252
+ slug : str
253
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
254
+
255
+ request_options : typing.Optional[RequestOptions]
256
+ Request-specific configuration.
257
+
258
+ Returns
259
+ -------
260
+ OrganizationsCreateResponse
261
+ Success
262
+
263
+ Examples
264
+ --------
265
+ import asyncio
266
+
267
+ from mirascope.api._generated import AsyncMirascope
268
+
269
+ client = AsyncMirascope()
270
+
271
+
272
+ async def main() -> None:
273
+ await client.organizations.create(
274
+ name="name",
275
+ slug="slug",
276
+ )
277
+
278
+
279
+ asyncio.run(main())
280
+ """
281
+ _response = await self._raw_client.create(
282
+ name=name, slug=slug, request_options=request_options
283
+ )
284
+ return _response.data
285
+
286
+ async def get(
287
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
288
+ ) -> OrganizationsGetResponse:
289
+ """
290
+ Parameters
291
+ ----------
292
+ id : str
293
+
294
+ request_options : typing.Optional[RequestOptions]
295
+ Request-specific configuration.
296
+
297
+ Returns
298
+ -------
299
+ OrganizationsGetResponse
300
+ Success
301
+
302
+ Examples
303
+ --------
304
+ import asyncio
305
+
306
+ from mirascope.api._generated import AsyncMirascope
307
+
308
+ client = AsyncMirascope()
309
+
310
+
311
+ async def main() -> None:
312
+ await client.organizations.get(
313
+ id="id",
314
+ )
315
+
316
+
317
+ asyncio.run(main())
318
+ """
319
+ _response = await self._raw_client.get(id, request_options=request_options)
320
+ return _response.data
321
+
322
+ async def update(
323
+ self,
324
+ id: str,
325
+ *,
326
+ name: typing.Optional[str] = OMIT,
327
+ slug: typing.Optional[str] = OMIT,
328
+ request_options: typing.Optional[RequestOptions] = None,
329
+ ) -> OrganizationsUpdateResponse:
330
+ """
331
+ Parameters
332
+ ----------
333
+ id : str
334
+
335
+ name : typing.Optional[str]
336
+ a string at most 100 character(s) long
337
+
338
+ slug : typing.Optional[str]
339
+ a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
340
+
341
+ request_options : typing.Optional[RequestOptions]
342
+ Request-specific configuration.
343
+
344
+ Returns
345
+ -------
346
+ OrganizationsUpdateResponse
347
+ Success
348
+
349
+ Examples
350
+ --------
351
+ import asyncio
352
+
353
+ from mirascope.api._generated import AsyncMirascope
354
+
355
+ client = AsyncMirascope()
356
+
357
+
358
+ async def main() -> None:
359
+ await client.organizations.update(
360
+ id="id",
361
+ )
362
+
363
+
364
+ asyncio.run(main())
365
+ """
366
+ _response = await self._raw_client.update(
367
+ id, name=name, slug=slug, request_options=request_options
368
+ )
369
+ return _response.data
370
+
371
+ async def delete(
372
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
373
+ ) -> None:
374
+ """
375
+ Parameters
376
+ ----------
377
+ id : str
378
+
379
+ request_options : typing.Optional[RequestOptions]
380
+ Request-specific configuration.
381
+
382
+ Returns
383
+ -------
384
+ None
385
+
386
+ Examples
387
+ --------
388
+ import asyncio
389
+
390
+ from mirascope.api._generated import AsyncMirascope
391
+
392
+ client = AsyncMirascope()
393
+
394
+
395
+ async def main() -> None:
396
+ await client.organizations.delete(
397
+ id="id",
398
+ )
399
+
400
+
401
+ asyncio.run(main())
402
+ """
403
+ _response = await self._raw_client.delete(id, request_options=request_options)
404
+ return _response.data