cartesia 1.4.0__py3-none-any.whl → 2.0.0a2__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 (176) hide show
  1. cartesia/__init__.py +292 -3
  2. cartesia/api_status/__init__.py +6 -0
  3. cartesia/api_status/client.py +104 -0
  4. cartesia/api_status/requests/__init__.py +5 -0
  5. cartesia/api_status/requests/api_info.py +8 -0
  6. cartesia/api_status/types/__init__.py +5 -0
  7. cartesia/api_status/types/api_info.py +20 -0
  8. cartesia/base_client.py +160 -0
  9. cartesia/client.py +163 -40
  10. cartesia/core/__init__.py +47 -0
  11. cartesia/core/api_error.py +15 -0
  12. cartesia/core/client_wrapper.py +55 -0
  13. cartesia/core/datetime_utils.py +28 -0
  14. cartesia/core/file.py +67 -0
  15. cartesia/core/http_client.py +499 -0
  16. cartesia/core/jsonable_encoder.py +101 -0
  17. cartesia/core/pydantic_utilities.py +296 -0
  18. cartesia/core/query_encoder.py +58 -0
  19. cartesia/core/remove_none_from_dict.py +11 -0
  20. cartesia/core/request_options.py +35 -0
  21. cartesia/core/serialization.py +272 -0
  22. cartesia/datasets/__init__.py +24 -0
  23. cartesia/datasets/client.py +392 -0
  24. cartesia/datasets/requests/__init__.py +15 -0
  25. cartesia/datasets/requests/create_dataset_request.py +7 -0
  26. cartesia/datasets/requests/dataset.py +9 -0
  27. cartesia/datasets/requests/dataset_file.py +9 -0
  28. cartesia/datasets/requests/paginated_dataset_files.py +10 -0
  29. cartesia/datasets/requests/paginated_datasets.py +10 -0
  30. cartesia/datasets/types/__init__.py +17 -0
  31. cartesia/datasets/types/create_dataset_request.py +19 -0
  32. cartesia/datasets/types/dataset.py +21 -0
  33. cartesia/datasets/types/dataset_file.py +21 -0
  34. cartesia/datasets/types/file_purpose.py +5 -0
  35. cartesia/datasets/types/paginated_dataset_files.py +21 -0
  36. cartesia/datasets/types/paginated_datasets.py +21 -0
  37. cartesia/embedding/__init__.py +5 -0
  38. cartesia/embedding/types/__init__.py +5 -0
  39. cartesia/embedding/types/embedding.py +201 -0
  40. cartesia/environment.py +7 -0
  41. cartesia/infill/__init__.py +2 -0
  42. cartesia/infill/client.py +318 -0
  43. cartesia/tts/__init__.py +167 -0
  44. cartesia/{_async_websocket.py → tts/_async_websocket.py} +159 -84
  45. cartesia/tts/_websocket.py +430 -0
  46. cartesia/tts/client.py +407 -0
  47. cartesia/tts/requests/__init__.py +76 -0
  48. cartesia/tts/requests/cancel_context_request.py +17 -0
  49. cartesia/tts/requests/controls.py +11 -0
  50. cartesia/tts/requests/generation_request.py +53 -0
  51. cartesia/tts/requests/mp_3_output_format.py +11 -0
  52. cartesia/tts/requests/output_format.py +30 -0
  53. cartesia/tts/requests/phoneme_timestamps.py +10 -0
  54. cartesia/tts/requests/raw_output_format.py +11 -0
  55. cartesia/tts/requests/speed.py +7 -0
  56. cartesia/tts/requests/tts_request.py +24 -0
  57. cartesia/tts/requests/tts_request_embedding_specifier.py +16 -0
  58. cartesia/tts/requests/tts_request_id_specifier.py +16 -0
  59. cartesia/tts/requests/tts_request_voice_specifier.py +7 -0
  60. cartesia/tts/requests/wav_output_format.py +7 -0
  61. cartesia/tts/requests/web_socket_base_response.py +11 -0
  62. cartesia/tts/requests/web_socket_chunk_response.py +8 -0
  63. cartesia/tts/requests/web_socket_done_response.py +7 -0
  64. cartesia/tts/requests/web_socket_error_response.py +7 -0
  65. cartesia/tts/requests/web_socket_flush_done_response.py +9 -0
  66. cartesia/tts/requests/web_socket_phoneme_timestamps_response.py +9 -0
  67. cartesia/tts/requests/web_socket_raw_output_format.py +11 -0
  68. cartesia/tts/requests/web_socket_request.py +7 -0
  69. cartesia/tts/requests/web_socket_response.py +69 -0
  70. cartesia/tts/requests/web_socket_stream_options.py +8 -0
  71. cartesia/tts/requests/web_socket_timestamps_response.py +9 -0
  72. cartesia/tts/requests/web_socket_tts_output.py +18 -0
  73. cartesia/tts/requests/web_socket_tts_request.py +24 -0
  74. cartesia/tts/requests/word_timestamps.py +10 -0
  75. cartesia/tts/socket_client.py +302 -0
  76. cartesia/tts/types/__init__.py +90 -0
  77. cartesia/tts/types/cancel_context_request.py +28 -0
  78. cartesia/tts/types/context_id.py +3 -0
  79. cartesia/tts/types/controls.py +22 -0
  80. cartesia/tts/types/emotion.py +29 -0
  81. cartesia/tts/types/flush_id.py +3 -0
  82. cartesia/tts/types/generation_request.py +66 -0
  83. cartesia/tts/types/mp_3_output_format.py +23 -0
  84. cartesia/tts/types/natural_specifier.py +5 -0
  85. cartesia/tts/types/numerical_specifier.py +3 -0
  86. cartesia/tts/types/output_format.py +58 -0
  87. cartesia/tts/types/phoneme_timestamps.py +21 -0
  88. cartesia/tts/types/raw_encoding.py +5 -0
  89. cartesia/tts/types/raw_output_format.py +22 -0
  90. cartesia/tts/types/speed.py +7 -0
  91. cartesia/tts/types/supported_language.py +7 -0
  92. cartesia/tts/types/tts_request.py +35 -0
  93. cartesia/tts/types/tts_request_embedding_specifier.py +27 -0
  94. cartesia/tts/types/tts_request_id_specifier.py +27 -0
  95. cartesia/tts/types/tts_request_voice_specifier.py +7 -0
  96. cartesia/tts/types/wav_output_format.py +17 -0
  97. cartesia/tts/types/web_socket_base_response.py +22 -0
  98. cartesia/tts/types/web_socket_chunk_response.py +20 -0
  99. cartesia/tts/types/web_socket_done_response.py +17 -0
  100. cartesia/tts/types/web_socket_error_response.py +19 -0
  101. cartesia/tts/types/web_socket_flush_done_response.py +21 -0
  102. cartesia/tts/types/web_socket_phoneme_timestamps_response.py +20 -0
  103. cartesia/tts/types/web_socket_raw_output_format.py +22 -0
  104. cartesia/tts/types/web_socket_request.py +7 -0
  105. cartesia/tts/types/web_socket_response.py +124 -0
  106. cartesia/tts/types/web_socket_stream_options.py +19 -0
  107. cartesia/tts/types/web_socket_timestamps_response.py +20 -0
  108. cartesia/tts/types/web_socket_tts_output.py +27 -0
  109. cartesia/tts/types/web_socket_tts_request.py +36 -0
  110. cartesia/tts/types/word_timestamps.py +21 -0
  111. cartesia/tts/utils/tts.py +64 -0
  112. cartesia/tts/utils/types.py +70 -0
  113. cartesia/version.py +3 -1
  114. cartesia/voice_changer/__init__.py +27 -0
  115. cartesia/voice_changer/client.py +395 -0
  116. cartesia/voice_changer/requests/__init__.py +15 -0
  117. cartesia/voice_changer/requests/streaming_response.py +36 -0
  118. cartesia/voice_changer/types/__init__.py +17 -0
  119. cartesia/voice_changer/types/output_format_container.py +5 -0
  120. cartesia/voice_changer/types/streaming_response.py +62 -0
  121. cartesia/voices/__init__.py +71 -0
  122. cartesia/voices/client.py +1053 -0
  123. cartesia/voices/requests/__init__.py +27 -0
  124. cartesia/voices/requests/create_voice_request.py +23 -0
  125. cartesia/voices/requests/embedding_response.py +8 -0
  126. cartesia/voices/requests/embedding_specifier.py +10 -0
  127. cartesia/voices/requests/id_specifier.py +10 -0
  128. cartesia/voices/requests/localize_dialect.py +8 -0
  129. cartesia/voices/requests/localize_voice_request.py +15 -0
  130. cartesia/voices/requests/mix_voice_specifier.py +7 -0
  131. cartesia/voices/requests/mix_voices_request.py +9 -0
  132. cartesia/voices/requests/update_voice_request.py +15 -0
  133. cartesia/voices/requests/voice.py +39 -0
  134. cartesia/voices/requests/voice_metadata.py +36 -0
  135. cartesia/voices/types/__init__.py +45 -0
  136. cartesia/voices/types/base_voice_id.py +5 -0
  137. cartesia/voices/types/clone_mode.py +5 -0
  138. cartesia/voices/types/create_voice_request.py +34 -0
  139. cartesia/voices/types/embedding_response.py +20 -0
  140. cartesia/voices/types/embedding_specifier.py +22 -0
  141. cartesia/voices/types/gender.py +5 -0
  142. cartesia/voices/types/id_specifier.py +22 -0
  143. cartesia/voices/types/localize_dialect.py +8 -0
  144. cartesia/voices/types/localize_english_dialect.py +5 -0
  145. cartesia/voices/types/localize_portuguese_dialect.py +5 -0
  146. cartesia/voices/types/localize_spanish_dialect.py +5 -0
  147. cartesia/voices/types/localize_target_language.py +7 -0
  148. cartesia/voices/types/localize_voice_request.py +26 -0
  149. cartesia/voices/types/mix_voice_specifier.py +7 -0
  150. cartesia/voices/types/mix_voices_request.py +20 -0
  151. cartesia/voices/types/update_voice_request.py +27 -0
  152. cartesia/voices/types/voice.py +50 -0
  153. cartesia/voices/types/voice_id.py +3 -0
  154. cartesia/voices/types/voice_metadata.py +48 -0
  155. cartesia/voices/types/weight.py +3 -0
  156. cartesia-2.0.0a2.dist-info/METADATA +307 -0
  157. cartesia-2.0.0a2.dist-info/RECORD +160 -0
  158. {cartesia-1.4.0.dist-info → cartesia-2.0.0a2.dist-info}/WHEEL +1 -1
  159. cartesia/_async_sse.py +0 -95
  160. cartesia/_logger.py +0 -3
  161. cartesia/_sse.py +0 -143
  162. cartesia/_types.py +0 -70
  163. cartesia/_websocket.py +0 -358
  164. cartesia/async_client.py +0 -82
  165. cartesia/async_tts.py +0 -176
  166. cartesia/resource.py +0 -44
  167. cartesia/tts.py +0 -292
  168. cartesia/utils/deprecated.py +0 -55
  169. cartesia/utils/retry.py +0 -87
  170. cartesia/utils/tts.py +0 -78
  171. cartesia/voices.py +0 -204
  172. cartesia-1.4.0.dist-info/METADATA +0 -663
  173. cartesia-1.4.0.dist-info/RECORD +0 -23
  174. cartesia-1.4.0.dist-info/licenses/LICENSE.md +0 -21
  175. /cartesia/{utils/__init__.py → py.typed} +0 -0
  176. /cartesia/{_constants.py → tts/utils/constants.py} +0 -0
@@ -0,0 +1,392 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from ..core.client_wrapper import SyncClientWrapper
5
+ from ..core.request_options import RequestOptions
6
+ from .types.paginated_datasets import PaginatedDatasets
7
+ from ..core.pydantic_utilities import parse_obj_as
8
+ from json.decoder import JSONDecodeError
9
+ from ..core.api_error import ApiError
10
+ from .types.dataset import Dataset
11
+ from .types.paginated_dataset_files import PaginatedDatasetFiles
12
+ from ..core.jsonable_encoder import jsonable_encoder
13
+ from .. import core
14
+ from .types.file_purpose import FilePurpose
15
+ from ..core.client_wrapper import AsyncClientWrapper
16
+
17
+ # this is used as the default value for optional parameters
18
+ OMIT = typing.cast(typing.Any, ...)
19
+
20
+
21
+ class DatasetsClient:
22
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
23
+ self._client_wrapper = client_wrapper
24
+
25
+ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> PaginatedDatasets:
26
+ """
27
+ Parameters
28
+ ----------
29
+ request_options : typing.Optional[RequestOptions]
30
+ Request-specific configuration.
31
+
32
+ Returns
33
+ -------
34
+ PaginatedDatasets
35
+
36
+ Examples
37
+ --------
38
+ from cartesia import Cartesia
39
+
40
+ client = Cartesia(
41
+ api_key="YOUR_API_KEY",
42
+ )
43
+ client.datasets.list()
44
+ """
45
+ _response = self._client_wrapper.httpx_client.request(
46
+ "datasets/",
47
+ method="GET",
48
+ request_options=request_options,
49
+ )
50
+ try:
51
+ if 200 <= _response.status_code < 300:
52
+ return typing.cast(
53
+ PaginatedDatasets,
54
+ parse_obj_as(
55
+ type_=PaginatedDatasets, # type: ignore
56
+ object_=_response.json(),
57
+ ),
58
+ )
59
+ _response_json = _response.json()
60
+ except JSONDecodeError:
61
+ raise ApiError(status_code=_response.status_code, body=_response.text)
62
+ raise ApiError(status_code=_response.status_code, body=_response_json)
63
+
64
+ def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> Dataset:
65
+ """
66
+ Parameters
67
+ ----------
68
+ name : str
69
+
70
+ request_options : typing.Optional[RequestOptions]
71
+ Request-specific configuration.
72
+
73
+ Returns
74
+ -------
75
+ Dataset
76
+
77
+ Examples
78
+ --------
79
+ from cartesia import Cartesia
80
+
81
+ client = Cartesia(
82
+ api_key="YOUR_API_KEY",
83
+ )
84
+ client.datasets.create(
85
+ name="name",
86
+ )
87
+ """
88
+ _response = self._client_wrapper.httpx_client.request(
89
+ "datasets/",
90
+ method="POST",
91
+ json={
92
+ "name": name,
93
+ },
94
+ request_options=request_options,
95
+ omit=OMIT,
96
+ )
97
+ try:
98
+ if 200 <= _response.status_code < 300:
99
+ return typing.cast(
100
+ Dataset,
101
+ parse_obj_as(
102
+ type_=Dataset, # type: ignore
103
+ object_=_response.json(),
104
+ ),
105
+ )
106
+ _response_json = _response.json()
107
+ except JSONDecodeError:
108
+ raise ApiError(status_code=_response.status_code, body=_response.text)
109
+ raise ApiError(status_code=_response.status_code, body=_response_json)
110
+
111
+ def list_files(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> PaginatedDatasetFiles:
112
+ """
113
+ Parameters
114
+ ----------
115
+ id : str
116
+
117
+ request_options : typing.Optional[RequestOptions]
118
+ Request-specific configuration.
119
+
120
+ Returns
121
+ -------
122
+ PaginatedDatasetFiles
123
+
124
+ Examples
125
+ --------
126
+ from cartesia import Cartesia
127
+
128
+ client = Cartesia(
129
+ api_key="YOUR_API_KEY",
130
+ )
131
+ client.datasets.list_files(
132
+ id="id",
133
+ )
134
+ """
135
+ _response = self._client_wrapper.httpx_client.request(
136
+ f"datasets/{jsonable_encoder(id)}/files",
137
+ method="GET",
138
+ request_options=request_options,
139
+ )
140
+ try:
141
+ if 200 <= _response.status_code < 300:
142
+ return typing.cast(
143
+ PaginatedDatasetFiles,
144
+ parse_obj_as(
145
+ type_=PaginatedDatasetFiles, # type: ignore
146
+ object_=_response.json(),
147
+ ),
148
+ )
149
+ _response_json = _response.json()
150
+ except JSONDecodeError:
151
+ raise ApiError(status_code=_response.status_code, body=_response.text)
152
+ raise ApiError(status_code=_response.status_code, body=_response_json)
153
+
154
+ def upload_file(
155
+ self, id: str, *, file: core.File, purpose: FilePurpose, request_options: typing.Optional[RequestOptions] = None
156
+ ) -> None:
157
+ """
158
+ Parameters
159
+ ----------
160
+ id : str
161
+
162
+ file : core.File
163
+ See core.File for more documentation
164
+
165
+ purpose : FilePurpose
166
+
167
+ request_options : typing.Optional[RequestOptions]
168
+ Request-specific configuration.
169
+
170
+ Returns
171
+ -------
172
+ None
173
+ """
174
+ _response = self._client_wrapper.httpx_client.request(
175
+ f"datasets/{jsonable_encoder(id)}/files",
176
+ method="POST",
177
+ data={
178
+ "purpose": purpose,
179
+ },
180
+ files={
181
+ "file": file,
182
+ },
183
+ request_options=request_options,
184
+ omit=OMIT,
185
+ )
186
+ try:
187
+ if 200 <= _response.status_code < 300:
188
+ return
189
+ _response_json = _response.json()
190
+ except JSONDecodeError:
191
+ raise ApiError(status_code=_response.status_code, body=_response.text)
192
+ raise ApiError(status_code=_response.status_code, body=_response_json)
193
+
194
+
195
+ class AsyncDatasetsClient:
196
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
197
+ self._client_wrapper = client_wrapper
198
+
199
+ async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> PaginatedDatasets:
200
+ """
201
+ Parameters
202
+ ----------
203
+ request_options : typing.Optional[RequestOptions]
204
+ Request-specific configuration.
205
+
206
+ Returns
207
+ -------
208
+ PaginatedDatasets
209
+
210
+ Examples
211
+ --------
212
+ import asyncio
213
+
214
+ from cartesia import AsyncCartesia
215
+
216
+ client = AsyncCartesia(
217
+ api_key="YOUR_API_KEY",
218
+ )
219
+
220
+
221
+ async def main() -> None:
222
+ await client.datasets.list()
223
+
224
+
225
+ asyncio.run(main())
226
+ """
227
+ _response = await self._client_wrapper.httpx_client.request(
228
+ "datasets/",
229
+ method="GET",
230
+ request_options=request_options,
231
+ )
232
+ try:
233
+ if 200 <= _response.status_code < 300:
234
+ return typing.cast(
235
+ PaginatedDatasets,
236
+ parse_obj_as(
237
+ type_=PaginatedDatasets, # type: ignore
238
+ object_=_response.json(),
239
+ ),
240
+ )
241
+ _response_json = _response.json()
242
+ except JSONDecodeError:
243
+ raise ApiError(status_code=_response.status_code, body=_response.text)
244
+ raise ApiError(status_code=_response.status_code, body=_response_json)
245
+
246
+ async def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> Dataset:
247
+ """
248
+ Parameters
249
+ ----------
250
+ name : str
251
+
252
+ request_options : typing.Optional[RequestOptions]
253
+ Request-specific configuration.
254
+
255
+ Returns
256
+ -------
257
+ Dataset
258
+
259
+ Examples
260
+ --------
261
+ import asyncio
262
+
263
+ from cartesia import AsyncCartesia
264
+
265
+ client = AsyncCartesia(
266
+ api_key="YOUR_API_KEY",
267
+ )
268
+
269
+
270
+ async def main() -> None:
271
+ await client.datasets.create(
272
+ name="name",
273
+ )
274
+
275
+
276
+ asyncio.run(main())
277
+ """
278
+ _response = await self._client_wrapper.httpx_client.request(
279
+ "datasets/",
280
+ method="POST",
281
+ json={
282
+ "name": name,
283
+ },
284
+ request_options=request_options,
285
+ omit=OMIT,
286
+ )
287
+ try:
288
+ if 200 <= _response.status_code < 300:
289
+ return typing.cast(
290
+ Dataset,
291
+ parse_obj_as(
292
+ type_=Dataset, # type: ignore
293
+ object_=_response.json(),
294
+ ),
295
+ )
296
+ _response_json = _response.json()
297
+ except JSONDecodeError:
298
+ raise ApiError(status_code=_response.status_code, body=_response.text)
299
+ raise ApiError(status_code=_response.status_code, body=_response_json)
300
+
301
+ async def list_files(
302
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
303
+ ) -> PaginatedDatasetFiles:
304
+ """
305
+ Parameters
306
+ ----------
307
+ id : str
308
+
309
+ request_options : typing.Optional[RequestOptions]
310
+ Request-specific configuration.
311
+
312
+ Returns
313
+ -------
314
+ PaginatedDatasetFiles
315
+
316
+ Examples
317
+ --------
318
+ import asyncio
319
+
320
+ from cartesia import AsyncCartesia
321
+
322
+ client = AsyncCartesia(
323
+ api_key="YOUR_API_KEY",
324
+ )
325
+
326
+
327
+ async def main() -> None:
328
+ await client.datasets.list_files(
329
+ id="id",
330
+ )
331
+
332
+
333
+ asyncio.run(main())
334
+ """
335
+ _response = await self._client_wrapper.httpx_client.request(
336
+ f"datasets/{jsonable_encoder(id)}/files",
337
+ method="GET",
338
+ request_options=request_options,
339
+ )
340
+ try:
341
+ if 200 <= _response.status_code < 300:
342
+ return typing.cast(
343
+ PaginatedDatasetFiles,
344
+ parse_obj_as(
345
+ type_=PaginatedDatasetFiles, # type: ignore
346
+ object_=_response.json(),
347
+ ),
348
+ )
349
+ _response_json = _response.json()
350
+ except JSONDecodeError:
351
+ raise ApiError(status_code=_response.status_code, body=_response.text)
352
+ raise ApiError(status_code=_response.status_code, body=_response_json)
353
+
354
+ async def upload_file(
355
+ self, id: str, *, file: core.File, purpose: FilePurpose, request_options: typing.Optional[RequestOptions] = None
356
+ ) -> None:
357
+ """
358
+ Parameters
359
+ ----------
360
+ id : str
361
+
362
+ file : core.File
363
+ See core.File for more documentation
364
+
365
+ purpose : FilePurpose
366
+
367
+ request_options : typing.Optional[RequestOptions]
368
+ Request-specific configuration.
369
+
370
+ Returns
371
+ -------
372
+ None
373
+ """
374
+ _response = await self._client_wrapper.httpx_client.request(
375
+ f"datasets/{jsonable_encoder(id)}/files",
376
+ method="POST",
377
+ data={
378
+ "purpose": purpose,
379
+ },
380
+ files={
381
+ "file": file,
382
+ },
383
+ request_options=request_options,
384
+ omit=OMIT,
385
+ )
386
+ try:
387
+ if 200 <= _response.status_code < 300:
388
+ return
389
+ _response_json = _response.json()
390
+ except JSONDecodeError:
391
+ raise ApiError(status_code=_response.status_code, body=_response.text)
392
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .create_dataset_request import CreateDatasetRequestParams
4
+ from .dataset import DatasetParams
5
+ from .dataset_file import DatasetFileParams
6
+ from .paginated_dataset_files import PaginatedDatasetFilesParams
7
+ from .paginated_datasets import PaginatedDatasetsParams
8
+
9
+ __all__ = [
10
+ "CreateDatasetRequestParams",
11
+ "DatasetFileParams",
12
+ "DatasetParams",
13
+ "PaginatedDatasetFilesParams",
14
+ "PaginatedDatasetsParams",
15
+ ]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+
5
+
6
+ class CreateDatasetRequestParams(typing_extensions.TypedDict):
7
+ name: str
@@ -0,0 +1,9 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+
5
+
6
+ class DatasetParams(typing_extensions.TypedDict):
7
+ id: str
8
+ name: str
9
+ created_at: str
@@ -0,0 +1,9 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+
5
+
6
+ class DatasetFileParams(typing_extensions.TypedDict):
7
+ id: str
8
+ filename: str
9
+ created_at: str
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+ import typing
5
+ from .dataset_file import DatasetFileParams
6
+
7
+
8
+ class PaginatedDatasetFilesParams(typing_extensions.TypedDict):
9
+ data: typing.Sequence[DatasetFileParams]
10
+ has_more: bool
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+ import typing
5
+ from .dataset import DatasetParams
6
+
7
+
8
+ class PaginatedDatasetsParams(typing_extensions.TypedDict):
9
+ data: typing.Sequence[DatasetParams]
10
+ has_more: bool
@@ -0,0 +1,17 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .create_dataset_request import CreateDatasetRequest
4
+ from .dataset import Dataset
5
+ from .dataset_file import DatasetFile
6
+ from .file_purpose import FilePurpose
7
+ from .paginated_dataset_files import PaginatedDatasetFiles
8
+ from .paginated_datasets import PaginatedDatasets
9
+
10
+ __all__ = [
11
+ "CreateDatasetRequest",
12
+ "Dataset",
13
+ "DatasetFile",
14
+ "FilePurpose",
15
+ "PaginatedDatasetFiles",
16
+ "PaginatedDatasets",
17
+ ]
@@ -0,0 +1,19 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.pydantic_utilities import UniversalBaseModel
4
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
5
+ import typing
6
+ import pydantic
7
+
8
+
9
+ class CreateDatasetRequest(UniversalBaseModel):
10
+ name: str
11
+
12
+ if IS_PYDANTIC_V2:
13
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
14
+ else:
15
+
16
+ class Config:
17
+ frozen = True
18
+ smart_union = True
19
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.pydantic_utilities import UniversalBaseModel
4
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
5
+ import typing
6
+ import pydantic
7
+
8
+
9
+ class Dataset(UniversalBaseModel):
10
+ id: str
11
+ name: str
12
+ created_at: str
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.pydantic_utilities import UniversalBaseModel
4
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
5
+ import typing
6
+ import pydantic
7
+
8
+
9
+ class DatasetFile(UniversalBaseModel):
10
+ id: str
11
+ filename: str
12
+ created_at: str
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FilePurpose = typing.Union[typing.Literal["fine_tune"], typing.Any]
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .dataset_file import DatasetFile
6
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
+
9
+
10
+ class PaginatedDatasetFiles(UniversalBaseModel):
11
+ data: typing.List[DatasetFile]
12
+ has_more: bool
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .dataset import Dataset
6
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
+
9
+
10
+ class PaginatedDatasets(UniversalBaseModel):
11
+ data: typing.List[Dataset]
12
+ has_more: bool
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import Embedding
4
+
5
+ __all__ = ["Embedding"]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .embedding import Embedding
4
+
5
+ __all__ = ["Embedding"]