cartesia 1.3.1__py3-none-any.whl → 2.0.0a0__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 (174) hide show
  1. cartesia/__init__.py +288 -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 +422 -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 +294 -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 +67 -0
  122. cartesia/voices/client.py +1812 -0
  123. cartesia/voices/requests/__init__.py +27 -0
  124. cartesia/voices/requests/create_voice_request.py +21 -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 +6 -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 +41 -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 +32 -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 +6 -0
  144. cartesia/voices/types/localize_english_dialect.py +5 -0
  145. cartesia/voices/types/localize_target_language.py +7 -0
  146. cartesia/voices/types/localize_voice_request.py +26 -0
  147. cartesia/voices/types/mix_voice_specifier.py +7 -0
  148. cartesia/voices/types/mix_voices_request.py +20 -0
  149. cartesia/voices/types/update_voice_request.py +27 -0
  150. cartesia/voices/types/voice.py +50 -0
  151. cartesia/voices/types/voice_id.py +3 -0
  152. cartesia/voices/types/voice_metadata.py +48 -0
  153. cartesia/voices/types/weight.py +3 -0
  154. cartesia-2.0.0a0.dist-info/METADATA +306 -0
  155. cartesia-2.0.0a0.dist-info/RECORD +158 -0
  156. {cartesia-1.3.1.dist-info → cartesia-2.0.0a0.dist-info}/WHEEL +1 -1
  157. cartesia/_async_sse.py +0 -95
  158. cartesia/_logger.py +0 -3
  159. cartesia/_sse.py +0 -143
  160. cartesia/_types.py +0 -70
  161. cartesia/_websocket.py +0 -358
  162. cartesia/async_client.py +0 -82
  163. cartesia/async_tts.py +0 -63
  164. cartesia/resource.py +0 -44
  165. cartesia/tts.py +0 -137
  166. cartesia/utils/deprecated.py +0 -55
  167. cartesia/utils/retry.py +0 -87
  168. cartesia/utils/tts.py +0 -78
  169. cartesia/voices.py +0 -208
  170. cartesia-1.3.1.dist-info/METADATA +0 -661
  171. cartesia-1.3.1.dist-info/RECORD +0 -23
  172. cartesia-1.3.1.dist-info/licenses/LICENSE.md +0 -21
  173. /cartesia/{utils/__init__.py → py.typed} +0 -0
  174. /cartesia/{_constants.py → tts/utils/constants.py} +0 -0
@@ -0,0 +1,306 @@
1
+ Metadata-Version: 2.1
2
+ Name: cartesia
3
+ Version: 2.0.0a0
4
+ Summary:
5
+ Requires-Python: >=3.8,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: aiohttp (>=3.10.10)
22
+ Requires-Dist: httpx (>=0.21.2)
23
+ Requires-Dist: httpx-sse (==0.4.0)
24
+ Requires-Dist: iterators (>=0.2.0)
25
+ Requires-Dist: pydantic (>=1.9.2)
26
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
27
+ Requires-Dist: pydub (>=0.25.1)
28
+ Requires-Dist: typing_extensions (>=4.0.0)
29
+ Requires-Dist: websockets (>=10.4)
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Cartesia Python Library
33
+
34
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fcartesia-ai%2Fcartesia-python)
35
+ [![pypi](https://img.shields.io/pypi/v/cartesia)](https://pypi.python.org/pypi/cartesia)
36
+
37
+ The Cartesia Python library provides convenient access to the Cartesia API from Python.
38
+
39
+ ## Documentation
40
+
41
+ Our complete API documentation can be found [on docs.cartesia.ai](https://docs.cartesia.ai).
42
+
43
+ ## Installation
44
+
45
+ ```sh
46
+ pip install cartesia
47
+ ```
48
+
49
+ ## Reference
50
+
51
+ A full reference for this library is available [here](./reference.md).
52
+
53
+ ## Voices
54
+
55
+ ```python
56
+ from cartesia import Cartesia
57
+ import os
58
+
59
+ client = Cartesia(api_key=os.environ.get("CARTESIA_API_KEY"))
60
+
61
+ # Get all available voices
62
+ voices = client.voices.list()
63
+ print(voices)
64
+
65
+ # Get a specific voice
66
+ voice = client.voices.get(id="a0e99841-438c-4a64-b679-ae501e7d6091")
67
+ print("The embedding for", voice["name"], "is", voice["embedding"])
68
+
69
+ # Clone a voice using filepath
70
+ cloned_voice_embedding = client.voices.clone(filepath="path/to/voice")
71
+
72
+ # Mix voices together
73
+ mixed_voice_embedding = client.voices.mix(
74
+ [{ "id": "voice_id_1", "weight": 0.5 }, { "id": "voice_id_2", "weight": 0.25 }, { "id": "voice_id_3", "weight": 0.25 }]
75
+ )
76
+
77
+ # Create a new voice
78
+ new_voice = client.voices.create(
79
+ name="New Voice",
80
+ description="A clone of my own voice",
81
+ embedding=cloned_voice_embedding,
82
+ )
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ Instantiate and use the client with the following:
88
+
89
+ ```python
90
+ from cartesia import Cartesia
91
+ from cartesia.tts import OutputFormat_Raw, TtsRequestIdSpecifier
92
+
93
+ client = Cartesia(
94
+ api_key="YOUR_API_KEY",
95
+ )
96
+ client.tts.bytes(
97
+ model_id="sonic-english",
98
+ transcript="Hello, world!",
99
+ voice={"id": "694f9389-aac1-45b6-b726-9d9369183238"},
100
+ ),
101
+ language="en",
102
+ output_format={
103
+ "container": "raw",
104
+ "sample_rate": 44100,
105
+ "encoding": "pcm_f32le",
106
+ },
107
+ )
108
+ ```
109
+
110
+ ## Async Client
111
+
112
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API.
113
+
114
+ ```python
115
+ import asyncio
116
+
117
+ from cartesia import AsyncCartesia
118
+ from cartesia.tts import OutputFormat_Raw, TtsRequestIdSpecifier
119
+
120
+ client = AsyncCartesia(
121
+ api_key="YOUR_API_KEY",
122
+ )
123
+
124
+
125
+ async def main() -> None:
126
+ await client.tts.bytes(
127
+ model_id="sonic-english",
128
+ transcript="Hello, world!",
129
+ voice={"id": "694f9389-aac1-45b6-b726-9d9369183238"},
130
+ language="en",
131
+ output_format={
132
+ "container": "raw",
133
+ "sample_rate": 44100,
134
+ "encoding": "pcm_f32le",
135
+ },
136
+ )
137
+
138
+
139
+ asyncio.run(main())
140
+ ```
141
+
142
+ ## Exception Handling
143
+
144
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
145
+ will be thrown.
146
+
147
+ ```python
148
+ from cartesia.core.api_error import ApiError
149
+
150
+ try:
151
+ client.tts.bytes(...)
152
+ except ApiError as e:
153
+ print(e.status_code)
154
+ print(e.body)
155
+ ```
156
+
157
+ ## Streaming
158
+
159
+ The SDK supports streaming responses, as well, the response will be a generator that you can loop over.
160
+
161
+ ```python
162
+ from cartesia import Cartesia
163
+ from cartesia.tts import Controls, OutputFormat_RawParams, TtsRequestIdSpecifierParams
164
+
165
+ client = Cartesia(
166
+ api_key="YOUR_API_KEY",
167
+ )
168
+ response = client.tts.sse(
169
+ model_id="string",
170
+ transcript="string",
171
+ voice={
172
+ "id": "string",
173
+ "experimental_controls": {
174
+ speed=1.1,
175
+ emotion="anger:lowest",
176
+ },
177
+ },
178
+ language="en",
179
+ output_format={},
180
+ duration=1.1,
181
+ )
182
+ for chunk in response:
183
+ yield chunk
184
+ ```
185
+
186
+ ## WebSocket
187
+
188
+ ```python
189
+ from cartesia import Cartesia
190
+ from cartesia.tts import TtsRequestEmbeddingSpecifierParams, OutputFormat_RawParams
191
+ import pyaudio
192
+
193
+ client = Cartesia(
194
+ api_key="YOUR_API_KEY",
195
+ )
196
+ voice_id = "a0e99841-438c-4a64-b679-ae501e7d6091"
197
+ voice = client.voices.get(id=voice_id)
198
+ transcript = "Hello! Welcome to Cartesia"
199
+
200
+ # You can check out our models at https://docs.cartesia.ai/getting-started/available-models
201
+ model_id = "sonic-english"
202
+
203
+ p = pyaudio.PyAudio()
204
+ rate = 22050
205
+
206
+ stream = None
207
+
208
+ # Set up the websocket connection
209
+ ws = client.tts.websocket()
210
+
211
+ # Generate and stream audio using the websocket
212
+ for output in ws.send(
213
+ model_id=model_id,
214
+ transcript=transcript,
215
+ voice={"embedding": voice.embedding},
216
+ stream=True,
217
+ output_format={
218
+ "container": "raw",
219
+ "encoding": "pcm_f32le",
220
+ "sample_rate": 22050
221
+ },
222
+ ):
223
+ buffer = output.audio
224
+
225
+ if not stream:
226
+ stream = p.open(format=pyaudio.paFloat32, channels=1, rate=rate, output=True)
227
+
228
+ # Write the audio data to the stream
229
+ stream.write(buffer)
230
+
231
+ stream.stop_stream()
232
+ stream.close()
233
+ p.terminate()
234
+
235
+ ws.close() # Close the websocket connection
236
+ ```
237
+
238
+ ## Advanced
239
+
240
+ ### Retries
241
+
242
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
243
+ as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
244
+ retry limit (default: 2).
245
+
246
+ A request is deemed retriable when any of the following HTTP status codes is returned:
247
+
248
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
249
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
250
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
251
+
252
+ Use the `max_retries` request option to configure this behavior.
253
+
254
+ ```python
255
+ client.tts.bytes(..., request_options={
256
+ "max_retries": 1
257
+ })
258
+ ```
259
+
260
+ ### Timeouts
261
+
262
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
263
+
264
+ ```python
265
+
266
+ from cartesia import Cartesia
267
+
268
+ client = Cartesia(
269
+ ...,
270
+ timeout=20.0,
271
+ )
272
+
273
+
274
+ # Override timeout for a specific method
275
+ client.tts.bytes(..., request_options={
276
+ "timeout_in_seconds": 1
277
+ })
278
+ ```
279
+
280
+ ### Custom Client
281
+
282
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
283
+ and transports.
284
+ ```python
285
+ import httpx
286
+ from cartesia import Cartesia
287
+
288
+ client = Cartesia(
289
+ ...,
290
+ httpx_client=httpx.Client(
291
+ proxies="http://my.test.proxy.example.com",
292
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
293
+ ),
294
+ )
295
+ ```
296
+
297
+ ## Contributing
298
+
299
+ While we value open-source contributions to this SDK, this library is generated programmatically.
300
+ Additions made directly to this library would have to be moved over to our generation code,
301
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
302
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
303
+ an issue first to discuss with us!
304
+
305
+ On the other hand, contributions to the README are always very welcome!
306
+
@@ -0,0 +1,158 @@
1
+ cartesia/__init__.py,sha256=0Qk2QKdJXm7SJe634hSv7UbtxI7AgKLlOGWc2OR2rCk,7757
2
+ cartesia/api_status/__init__.py,sha256=_dHNLdknrBjxHtU2PvLumttJM-JTQhJQqhhAQkLqt_U,168
3
+ cartesia/api_status/client.py,sha256=GJ9Dq8iCn3hn8vCIqc6k1fCGEhSz0T0kaPGcdFnbMDY,3146
4
+ cartesia/api_status/requests/__init__.py,sha256=ilEMzEy1JEw484CuL92bX5lHGOznc62pjiDMgiZ0tKM,130
5
+ cartesia/api_status/requests/api_info.py,sha256=AmB6RpquI2yUlTQBtOk8e0qtLmXHYLcGZKpXZahOwmc,172
6
+ cartesia/api_status/types/__init__.py,sha256=6NUyGWiGK1Wl3mXlSMJN2ObKf2LK3vjX2MUP1uopfEQ,118
7
+ cartesia/api_status/types/api_info.py,sha256=o1LwSxnoHpCR7huw9J-cF6LRlC_fiftDQLYUz8p-vTc,568
8
+ cartesia/base_client.py,sha256=fnRxqROt8Eh2_Vx54RmBxLyFsJKQGEMmRlznTKi4Rho,6571
9
+ cartesia/client.py,sha256=sPAYQLt9W2E_2F17ooocvvJImuNyLrL8xUypgf6dZeI,6238
10
+ cartesia/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
11
+ cartesia/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
12
+ cartesia/core/client_wrapper.py,sha256=uIkW6NdE1WRmnp8yFV-W1KsZTg1V653yTtw1v1vY1Yw,1856
13
+ cartesia/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
14
+ cartesia/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
15
+ cartesia/core/http_client.py,sha256=siUQ6UV0ARZALlxubqWSSAAPC9B4VW8y6MGlHStfaeo,19552
16
+ cartesia/core/jsonable_encoder.py,sha256=qaF1gtgH-kQZb4kJskETwcCsOPUof-NnYVdszHkb-dM,3656
17
+ cartesia/core/pydantic_utilities.py,sha256=Pj_AIcjRR-xc28URvV4t2XssDPjLvpN6HAcsY3MVLRM,11973
18
+ cartesia/core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
19
+ cartesia/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
20
+ cartesia/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
21
+ cartesia/core/serialization.py,sha256=D9h_t-RQON3-CHWs1C4ESY9B-Yd5d-l5lnTLb_X896g,9601
22
+ cartesia/datasets/__init__.py,sha256=m7uI_lBRsIh-YOIin7Q11cHSXD4FMUkq_J74CLMWuyY,640
23
+ cartesia/datasets/client.py,sha256=ER8bQCpYXH30dBxaBdFd67_1fLun8fwgkq1E45IY4wA,12240
24
+ cartesia/datasets/requests/__init__.py,sha256=pxNlVfjSEPr1RfJKb07CXKIrg_EDa4_t8le2x6u9l1c,489
25
+ cartesia/datasets/requests/create_dataset_request.py,sha256=RtISvq-eA8GG_0plEPTkJl8TzOVm93NQuHbJVGtkQeg,169
26
+ cartesia/datasets/requests/dataset.py,sha256=Wxg5AEBh8h9t5N2ud96bsrPVgjH5orMAv1PXl1RGTDs,188
27
+ cartesia/datasets/requests/dataset_file.py,sha256=ddxUw-yYzATfRDn_ey-SzSYd_2J501OsAggH13sbIRE,196
28
+ cartesia/datasets/requests/paginated_dataset_files.py,sha256=6hZm3O8qJSkinqdJLSgEPaKBi2Vx3NxfTKk1FGwA2e0,278
29
+ cartesia/datasets/requests/paginated_datasets.py,sha256=UHzcmKJ73pOtN-CUfQurHCb0y6yf1hNGum3ckbn83YY,261
30
+ cartesia/datasets/types/__init__.py,sha256=cDPaVpLq8O6I6mWuuVGZOICgO9_Os2BXPWEAK1hbHsg,486
31
+ cartesia/datasets/types/create_dataset_request.py,sha256=w9-7U1gcW67tcticQ9zteYga3Vc_LPUfISttLc_-06o,565
32
+ cartesia/datasets/types/dataset.py,sha256=uR_tSITVL_G2lYqMZIhPGddgmaUbqsifZ5eXpbt-pOE,584
33
+ cartesia/datasets/types/dataset_file.py,sha256=VuKeojvfl112AZzN3qmMiI3P_oeNXq84U4dAIfuwY3c,592
34
+ cartesia/datasets/types/file_purpose.py,sha256=YfhGIUTJsQedSf6lnBU-jSz_h9xEpVVtOyYnyHNtcaQ,148
35
+ cartesia/datasets/types/paginated_dataset_files.py,sha256=xY2XiXvcLqt5nPQIIPuIwBtPeM0_0sVYxc5MshFh5j8,644
36
+ cartesia/datasets/types/paginated_datasets.py,sha256=bNgCtzFC3EPqAc0bd9nvkKtR4Q8CwJNpVUr0BBpQJkE,627
37
+ cartesia/embedding/__init__.py,sha256=mfTGlVbrByIrk4KTsZeNCNfm2qYUu1dcO_o37eEgPik,119
38
+ cartesia/embedding/types/__init__.py,sha256=aOrEOGuiO6dlSGu7pckqVMTYEMVAR5I7qqcairy0vlA,123
39
+ cartesia/embedding/types/embedding.py,sha256=C1OJg8M4T1Apfcv4qx79ndftg0SgH4Lfqe_iU3UF-bA,1851
40
+ cartesia/environment.py,sha256=Qnp91BGLic7hXmKsiYub2m3nPfvDWm59aB1wWta1J6A,160
41
+ cartesia/infill/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
42
+ cartesia/infill/client.py,sha256=izdEXk-O7FgdFAKnU5qrNCpuCxBVDiYp3OugAXPlAvo,10797
43
+ cartesia/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
+ cartesia/tts/__init__.py,sha256=G0wcYlPrr7hmu5DQgCG7bDTQq36fpP3iBM5164Z0-Js,4701
45
+ cartesia/tts/_async_websocket.py,sha256=gg9mrY6JpMiCZHUefGdRGy_N2nxNTfP_DJ4mN8xtDOU,15991
46
+ cartesia/tts/_websocket.py,sha256=k_dZSqRMDXOhDgsY26FmYFZH0tRFB06uK1ibMy8DxPc,16513
47
+ cartesia/tts/client.py,sha256=bEuVERt2PaJOCC_BA9f4lXI_Ko52QGC6Vy0ttYlE9mA,14856
48
+ cartesia/tts/requests/__init__.py,sha256=0rcfMLHNbUhkRI1xS09UE4p-WT1BCqrcblFtPxcATOI,3261
49
+ cartesia/tts/requests/cancel_context_request.py,sha256=Wl8g-o5vwl9ENm-H1wsLx441FkIR_4Wt5UYtuWce2Yw,431
50
+ cartesia/tts/requests/controls.py,sha256=xzUJlfgqhaJ1A-JD0LTpoHYk4iEpCuGpSD7qE4YYsRg,285
51
+ cartesia/tts/requests/generation_request.py,sha256=JMSJ1upkcqaXxBH-nUAdEZqsJJvh95sCWxg_vt8vTjM,1839
52
+ cartesia/tts/requests/mp_3_output_format.py,sha256=PGDVzC1d7-Jce12rFxtF8G1pTHmlUdiGAhykFTABg0w,316
53
+ cartesia/tts/requests/output_format.py,sha256=8TKu9AAeHCR5L4edzYch8FIYIldn4bM7ySrsCl8W_g8,842
54
+ cartesia/tts/requests/phoneme_timestamps.py,sha256=ft81nmqElZAnvTBT27lY6YWfF18ZGsCx3Y1XHv9J7cM,267
55
+ cartesia/tts/requests/raw_output_format.py,sha256=S60Vp7DeAATCMLF3bXgxhw0zILJBWJ9GhI9irAg_UkI,316
56
+ cartesia/tts/requests/speed.py,sha256=-YGBWwh7_VtCBnYlT5EVsnrmcHFMEBTxy9LathZhkMA,259
57
+ cartesia/tts/requests/tts_request.py,sha256=rh7akZLf_w0RukKclCic9fKIIJi-X1M1GeHnJ14rjKk,921
58
+ cartesia/tts/requests/tts_request_embedding_specifier.py,sha256=-M54ZjV0H5LPwcKtz0bOVqlkvO1pPiMbqMbVBMko3Ns,565
59
+ cartesia/tts/requests/tts_request_id_specifier.py,sha256=-0ClfyJnnaH0uAcF5r84s3cM_cw2wT39dp6T4JYzOQ8,536
60
+ cartesia/tts/requests/tts_request_voice_specifier.py,sha256=eGzL4aVGq4gKPxeglsV7-wuhxg8x33Qth3uFTTytgeI,337
61
+ cartesia/tts/requests/wav_output_format.py,sha256=qiipmT5hWsa8J-fwW1EH_rnUAX_zOUpGJUNzuLc65r4,181
62
+ cartesia/tts/requests/web_socket_base_response.py,sha256=zCjHw-FaNJMOcHiAb2NQWrBBfrzU5rc95vqDp7y9RmA,315
63
+ cartesia/tts/requests/web_socket_chunk_response.py,sha256=4fVPJH-ZZb8lJKwqyYGx5wyeYWzfuThGxMRXC6ku4bA,233
64
+ cartesia/tts/requests/web_socket_done_response.py,sha256=YLHrT6NkmDntBSxF-JGlXSavdlOWo_cb9tGKCVivGH4,206
65
+ cartesia/tts/requests/web_socket_error_response.py,sha256=ek2O5Whlzn5Ma40NhYviVl3aJBVeCA8BBvbJPUYxEiQ,213
66
+ cartesia/tts/requests/web_socket_flush_done_response.py,sha256=gP3fSWhEFVzdzBweUmVKo7JvdREW3TM9R6o9-u6V6FQ,282
67
+ cartesia/tts/requests/web_socket_phoneme_timestamps_response.py,sha256=nDRK7wo4s6R7ayJrw-LJX9WCaW4mti0HAV4X5j7cxjI,370
68
+ cartesia/tts/requests/web_socket_raw_output_format.py,sha256=9BJHE5l5bzmYCYuUoACRhbZdJBijnSiwkbR8K4EzPDY,302
69
+ cartesia/tts/requests/web_socket_request.py,sha256=5xfE0NgkBEZdus_vC-3RVQkuqhNmXHxLMX4DW3ezcKc,290
70
+ cartesia/tts/requests/web_socket_response.py,sha256=kS46YN94ilUn4qjpt1TpauZApe0N8PpAefT87jFiusY,2079
71
+ cartesia/tts/requests/web_socket_stream_options.py,sha256=VIvblFw9hGZvDzFpOnC11G0NvrFSVt-1-0sY5rpcZPI,232
72
+ cartesia/tts/requests/web_socket_timestamps_response.py,sha256=MK3zN2Q_PVWJtX5DidNB0uXoF2o33rv6qCYPVaourxY,351
73
+ cartesia/tts/requests/web_socket_tts_output.py,sha256=pX2uf0XVdziFhXCydwLlVOWb-LvBiuq-cBI6R1INiMg,760
74
+ cartesia/tts/requests/web_socket_tts_request.py,sha256=UXir2k0GpVQNCYKZ0YZMrl_LullEKCsM0EmyFbl5oDw,1036
75
+ cartesia/tts/requests/word_timestamps.py,sha256=WMfBJtETi6wTpES0pYZCFfFRfEbzWE-RtosDJ5seUWg,261
76
+ cartesia/tts/socket_client.py,sha256=zTPayHbgy-yQQ50AE1HXN4GMyanisZcLXf7Ds1paYks,11621
77
+ cartesia/tts/types/__init__.py,sha256=yV_-DY9EPNAFEfuIk3wgRLcc4Ta5igv0T5g-IIQ53v0,3251
78
+ cartesia/tts/types/cancel_context_request.py,sha256=zInhk3qRZsSc0F1aYJ-Q5BHJsosTrb22IJWhzue-eKE,856
79
+ cartesia/tts/types/context_id.py,sha256=UCEtq5xFGOeBCECcY6Y-gYVe_Peg1hFhH9YYOkpApQg,81
80
+ cartesia/tts/types/controls.py,sha256=H4CSu79mM1Ld4NZx_5uXw3EwRzTEMQRxKBRvFpcFb8Y,644
81
+ cartesia/tts/types/emotion.py,sha256=Hw1znosnRFyPRR0Adtru0GmJ-EGWHXDF_XtfQ3QI96Y,665
82
+ cartesia/tts/types/flush_id.py,sha256=HCIKo9o8d7YWKtaSNU3TEvfUVBju93ckGQy01Z9wLcE,79
83
+ cartesia/tts/types/generation_request.py,sha256=jRqVtEdIZ0Nt8w3RUm2BloF_7DJNqbDtQdvy7WkKVxk,2318
84
+ cartesia/tts/types/mp_3_output_format.py,sha256=0WGblkuDUL7pZO1aRuQ_mU2Z5gN9xIabRfRKkjtzms8,731
85
+ cartesia/tts/types/natural_specifier.py,sha256=K526P1RRuBGy80hyd_tX8tohPrE8DR9EgTCxS5wce0o,188
86
+ cartesia/tts/types/numerical_specifier.py,sha256=tJpIskWO545luCKMFM9JlVc7VVhBhSvqL1qurhzL9cI,92
87
+ cartesia/tts/types/output_format.py,sha256=bi9iZVQKmddTw6RjNKG9XAVrgEB7JVNsBS_emFLlGLs,1736
88
+ cartesia/tts/types/phoneme_timestamps.py,sha256=SrhPmE7-1-bCVi4qCgMU7QR9ezkwUfqsWfZ2PchzwN0,637
89
+ cartesia/tts/types/raw_encoding.py,sha256=eyc2goiYOTxWcuKHAgYZ2SrnfePW22Fbmc-5fGPlV2Y,186
90
+ cartesia/tts/types/raw_output_format.py,sha256=jZGVaS0KIi9mU6trfskgA3HbMKJolhrwICnuDhF01ic,673
91
+ cartesia/tts/types/speed.py,sha256=4c5WdxocBw6WSMnundSaNnceUeooU0vikhy00FW6M-w,239
92
+ cartesia/tts/types/supported_language.py,sha256=riDRduThMbMWAq9i2uCfxhwVTpgaFwNDZ9LhEIl4zHY,237
93
+ cartesia/tts/types/tts_request.py,sha256=MxWcMLxIpotkPiPhFIhdHTtDzYv8yzLJwrwX3kBhkIg,1290
94
+ cartesia/tts/types/tts_request_embedding_specifier.py,sha256=eL_qCEr4pvWfy4qp9hZBuVdCincX5DBVqfv1vLt2_Vk,942
95
+ cartesia/tts/types/tts_request_id_specifier.py,sha256=ktGdkkTRQ9scA-lt8qJ2jn_E5WzoOK8AXMrVqi71gf0,906
96
+ cartesia/tts/types/tts_request_voice_specifier.py,sha256=p-3UQ62uFL1SgbX73Ex1D_V73Ef0wmT1ApOt1iLZmwE,307
97
+ cartesia/tts/types/wav_output_format.py,sha256=OTAgVn_gBMk252XO12kiNI9lKrbw3n38aBAiqlG5mdU,531
98
+ cartesia/tts/types/web_socket_base_response.py,sha256=MWoTt1rGRqUQ8BOad1Zk2SA-i0E8a3JwPLSiehIbFj4,672
99
+ cartesia/tts/types/web_socket_chunk_response.py,sha256=VOPXAlyGFdnfC69KxqDWDo1PPMydvQKmAypoWfbW8_s,593
100
+ cartesia/tts/types/web_socket_done_response.py,sha256=zZ6V-_pKNifdyuuRHGlZe6Zbc-ZRk-uHk5zgHkZcBEw,556
101
+ cartesia/tts/types/web_socket_error_response.py,sha256=Jm26GnK0axyLQI3-JLHC0buYVIU8gKWxLAJlzo-cJFQ,573
102
+ cartesia/tts/types/web_socket_flush_done_response.py,sha256=JLiVPDftr1arl_Kvj6038yj0mnjq6x0ooihsbdXajfw,635
103
+ cartesia/tts/types/web_socket_phoneme_timestamps_response.py,sha256=R1-Z_W3XF7L7rrPwEOK_EfXHT4FWRpSAX3g71WebM90,686
104
+ cartesia/tts/types/web_socket_raw_output_format.py,sha256=9PiOVmPDfT32IDIsmU7UY_rTLOShMMEw1pNv2yZ9Kyg,685
105
+ cartesia/tts/types/web_socket_request.py,sha256=_xoAShkCCNTVAWKCvHw5k0Wisq60y4fOWYjG7SA8edM,260
106
+ cartesia/tts/types/web_socket_response.py,sha256=fUQbJ6yFzZbzUZPuQWgkFdzP8-FMiKTcya-DIPWjimY,3777
107
+ cartesia/tts/types/web_socket_stream_options.py,sha256=MhDSxBFqMuQeWjoyPqXVnTEzLjF8g6aojeigb5dQUgU,596
108
+ cartesia/tts/types/web_socket_timestamps_response.py,sha256=kuWXI82ncF1QapnaHEjwrL84qWob7ByQU-yh1e0IEmk,667
109
+ cartesia/tts/types/web_socket_tts_output.py,sha256=qxzgWt41821tQaIyFqOgH0pb_51678zMuY-8LZYxRdY,863
110
+ cartesia/tts/types/web_socket_tts_request.py,sha256=xTKk-WrLglRHEUwIbbuLfm9hTcS8ww5Th9HBSAEsFDI,1371
111
+ cartesia/tts/types/word_timestamps.py,sha256=XZ2Q0prdb3F9c3AiOKXu4s3A3jBxE-qIt1npHOf16R0,631
112
+ cartesia/tts/utils/constants.py,sha256=khGNVpiQVDmv1oZU7pKTd9C1AHjiaM8zQ2He9d5zI_c,435
113
+ cartesia/tts/utils/tts.py,sha256=u7PgPxlJs6fcQTfr-jqAvBCAaK3JWLhF5QF4s-PwoMo,2093
114
+ cartesia/tts/utils/types.py,sha256=DtsiRwrYypXScLu71gNyprUiELuR1l_-ikVaj47gpg4,2047
115
+ cartesia/version.py,sha256=xk5z2FYkgnvzyjqzmRg67rYl8fnCeHEjPpVmD08bjyE,75
116
+ cartesia/voice_changer/__init__.py,sha256=UKA8CSAwUb41OL-dcWWUhIsKLLsyY_NQtrklPAVWf9E,685
117
+ cartesia/voice_changer/client.py,sha256=vvyEbjwBhC-iS09nkmITMl81lNfrVxef3neUADyv-xc,13517
118
+ cartesia/voice_changer/requests/__init__.py,sha256=MRwSUqio3mg_tvfcpAS0wIZ69HvJsc2kYJ0tUBaJ53U,390
119
+ cartesia/voice_changer/requests/streaming_response.py,sha256=lbo7CJeuh0f5hXT4lKG_sDUZDLJWaLqxcwCuSf1IbMQ,982
120
+ cartesia/voice_changer/types/__init__.py,sha256=qAiHsdRpnFeS0lBkYp_NRrhSJiRXCg5-uFibqDWzYVU,430
121
+ cartesia/voice_changer/types/output_format_container.py,sha256=RqLDELdgeOjYqNTJX1Le62qjiFiJGxf0cYnol88-LLM,166
122
+ cartesia/voice_changer/types/streaming_response.py,sha256=gH-2-rlpeI3y9Ou0c7AopHUm3Z5uB3HaoPM1RvFCKwg,1875
123
+ cartesia/voices/__init__.py,sha256=geKkwtbYG8q13C1vTltQr6hB6UlWScCvZ3vHVWn4MCg,1505
124
+ cartesia/voices/client.py,sha256=s88bN7NrSyprP0Hkauut8WuTQTqHAYXspjngYXWu0sA,48762
125
+ cartesia/voices/requests/__init__.py,sha256=oNZkk0ydOwaRgA38vxNQ34K68CCBQN3yrdDTS9mwe7E,984
126
+ cartesia/voices/requests/create_voice_request.py,sha256=HvxxWBwR5RMMMmxEU5Tj5jsDSXnlT0cS-C6AGlMPlr0,509
127
+ cartesia/voices/requests/embedding_response.py,sha256=PGZkBD8UBcv2MYQbBXyD4T6lzaE9oSGGwXx-MoXCp0M,228
128
+ cartesia/voices/requests/embedding_specifier.py,sha256=PAHdGsVmLLeJC2b1fWHWI_OlhogO1WnJdzoX9pj5N8c,282
129
+ cartesia/voices/requests/id_specifier.py,sha256=UTtoXBEEYaGvg-Dn2QxUDACNB3Vm1O1XbrPtBA3rGzU,252
130
+ cartesia/voices/requests/localize_dialect.py,sha256=9mmLHOFbBvWZoU2PyjXozG6hoDpE0uueymXHi0k_VtE,209
131
+ cartesia/voices/requests/localize_voice_request.py,sha256=AkY4cvx31MF3_gkqMpUzibGIOh9cNF5cOCf3Yqnm7Vc,549
132
+ cartesia/voices/requests/mix_voice_specifier.py,sha256=YjOJ2Qt3nqMQzHsYbF1DnZgmZS9zZepLXpji6V9mfgs,266
133
+ cartesia/voices/requests/mix_voices_request.py,sha256=6JCzFmWKIS1_t-uSoO1m-FQbLWB1zaykTcGV-1s-RqM,275
134
+ cartesia/voices/requests/update_voice_request.py,sha256=XxJ6TKO4M2s1kXQAZRj8uA4okIABvmWiFhAHJv4BS0Q,282
135
+ cartesia/voices/requests/voice.py,sha256=lIdaIaRNR_6d26fHRgJkCOGj8ziZuD7uuW0oOt03nS4,821
136
+ cartesia/voices/requests/voice_metadata.py,sha256=S0jPQtBpEb2WSnYDLQTS7pcbNJpc0d01uWravHaqzso,697
137
+ cartesia/voices/types/__init__.py,sha256=AyLM36fHC7qeTOI96hJZCaXLXXFmQnRDOTYTbbNj0ss,1270
138
+ cartesia/voices/types/base_voice_id.py,sha256=nWRC0rvLpjeMpRbLSmUTPziWo1ZrbPxw22l4gEBWp8Q,118
139
+ cartesia/voices/types/clone_mode.py,sha256=3sR6wdxym4xDVsoHppp3-V9mpDwP9F9fDfMUQKG24xw,160
140
+ cartesia/voices/types/create_voice_request.py,sha256=8vfKu6cD_VYFb3GN5gVpxlRUIZALYE-449NbDSnXaDg,911
141
+ cartesia/voices/types/embedding_response.py,sha256=B7MJ79HIAnxtiP6OT0tt27KBDYTZ3VU0MLuQfb5qVOg,624
142
+ cartesia/voices/types/embedding_specifier.py,sha256=cf6JfVnISyrvjWup3oAg-RFdMVRxytem6HLwZgKl3gA,671
143
+ cartesia/voices/types/gender.py,sha256=OrbTO__3HVNculvkcb5Pz-Yoa-Xv8N_rNMrFoy2DoaA,148
144
+ cartesia/voices/types/id_specifier.py,sha256=yAY-uc9hRJkHXdsSfRZWkE8ga2Sb-KVipOTSXa8Wmp0,634
145
+ cartesia/voices/types/localize_dialect.py,sha256=tRckNEq4EsdYPondF1rrjOrYRZUSL6WW_3627cFwG1I,196
146
+ cartesia/voices/types/localize_english_dialect.py,sha256=0PjZNjQv5ll2wWZxGveQIYCUGLtGDVELK9FBWFe7SNc,176
147
+ cartesia/voices/types/localize_target_language.py,sha256=ttngtFVpMvuWAKQztJu_pCaf7V62DzmNq9zthPCb2LI,242
148
+ cartesia/voices/types/localize_voice_request.py,sha256=roZkcA7LiYs_L1R9FgTCTIgmHv9TUfXZMgLEnrajJ3I,887
149
+ cartesia/voices/types/mix_voice_specifier.py,sha256=B0FE6UREGk1TxlN0GOPwyCuqJbMkWVUs0EFqiJuQfZ8,236
150
+ cartesia/voices/types/mix_voices_request.py,sha256=R_8bmUmE1br4wmfH1Qu6EnL9uC-V1z5BV3_B7u51EOw,641
151
+ cartesia/voices/types/update_voice_request.py,sha256=_CEH8nuSZn2qZa9xZlANZXOhJd49XLel3dRy2dfOvr8,716
152
+ cartesia/voices/types/voice.py,sha256=echDtXYwyNvoBkwnVBaUV2HzRBbXDqZz0ZZcnj4307g,1278
153
+ cartesia/voices/types/voice_id.py,sha256=GDoXcRVeIm-V21R4suxG2zqLD3DLYkXE9kgizadzFKo,79
154
+ cartesia/voices/types/voice_metadata.py,sha256=4KNGjXMUKm3niv-NvKIFVGtiilpH13heuzKcZYNQxk4,1181
155
+ cartesia/voices/types/weight.py,sha256=XqDU7_JItNUb5QykIDqTbELlRYQdbt2SviRgW0w2LKo,80
156
+ cartesia-2.0.0a0.dist-info/METADATA,sha256=LcBy2eYUxnd8WYI-Qmd7eDg00FyQcS5y3QMz7YCUk1A,7973
157
+ cartesia-2.0.0a0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
158
+ cartesia-2.0.0a0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: poetry-core 1.6.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
cartesia/_async_sse.py DELETED
@@ -1,95 +0,0 @@
1
- import base64
2
- import json
3
- from typing import Any, AsyncGenerator, Callable, Dict, List, Optional, Union
4
-
5
- import aiohttp
6
-
7
- from cartesia._constants import BACKOFF_FACTOR, MAX_RETRIES
8
- from cartesia._logger import logger
9
- from cartesia._sse import _SSE
10
- from cartesia._types import OutputFormat, VoiceControls
11
- from cartesia.utils.retry import retry_on_connection_error_async
12
- from cartesia.utils.tts import _construct_tts_request
13
-
14
-
15
- class _AsyncSSE(_SSE):
16
- """This class contains methods to generate audio using Server-Sent Events asynchronously."""
17
-
18
- def __init__(
19
- self,
20
- http_url: str,
21
- headers: Dict[str, str],
22
- timeout: float,
23
- get_session: Callable[[], Optional[aiohttp.ClientSession]],
24
- ):
25
- super().__init__(http_url, headers, timeout)
26
- self._get_session = get_session
27
-
28
- async def send(
29
- self,
30
- model_id: str,
31
- transcript: str,
32
- output_format: OutputFormat,
33
- voice_id: Optional[str] = None,
34
- voice_embedding: Optional[List[float]] = None,
35
- duration: Optional[int] = None,
36
- language: Optional[str] = None,
37
- stream: bool = True,
38
- _experimental_voice_controls: Optional[VoiceControls] = None,
39
- ) -> Union[bytes, AsyncGenerator[bytes, None]]:
40
- request_body = _construct_tts_request(
41
- model_id=model_id,
42
- transcript=transcript,
43
- output_format=output_format,
44
- voice_id=voice_id,
45
- voice_embedding=voice_embedding,
46
- duration=duration,
47
- language=language,
48
- _experimental_voice_controls=_experimental_voice_controls,
49
- )
50
-
51
- generator = self._sse_generator_wrapper(request_body)
52
-
53
- if stream:
54
- return generator
55
-
56
- chunks = []
57
- async for chunk in generator:
58
- chunks.append(chunk["audio"])
59
-
60
- return {"audio": b"".join(chunks)}
61
-
62
- @retry_on_connection_error_async(
63
- max_retries=MAX_RETRIES, backoff_factor=BACKOFF_FACTOR, logger=logger
64
- )
65
- async def _sse_generator_wrapper(self, request_body: Dict[str, Any]):
66
- """Need to wrap the sse generator in a function for the retry decorator to work."""
67
- try:
68
- async for chunk in self._sse_generator(request_body):
69
- yield chunk
70
- except Exception as e:
71
- raise RuntimeError(f"Error generating audio. {e}")
72
-
73
- async def _sse_generator(self, request_body: Dict[str, Any]):
74
- session = await self._get_session()
75
- async with session.post(
76
- f"{self.http_url}/tts/sse",
77
- data=json.dumps(request_body),
78
- headers=self.headers,
79
- ) as response:
80
- if not response.ok:
81
- raise ValueError(f"Failed to generate audio. {await response.text()}")
82
-
83
- buffer = ""
84
- async for chunk_bytes in response.content.iter_any():
85
- buffer, outputs = self._update_buffer(buffer=buffer, chunk_bytes=chunk_bytes)
86
- for output in outputs:
87
- yield output
88
-
89
- if buffer:
90
- try:
91
- chunk_json = json.loads(buffer)
92
- audio = base64.b64decode(chunk_json["data"])
93
- yield {"audio": audio}
94
- except json.JSONDecodeError:
95
- pass
cartesia/_logger.py DELETED
@@ -1,3 +0,0 @@
1
- import logging
2
-
3
- logger = logging.getLogger(__name__)