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,307 @@
1
+ Metadata-Version: 2.1
2
+ Name: cartesia
3
+ Version: 2.0.0a2
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: audioop-lts (==0.2.1) ; python_version >= "3.13" and python_version < "4.0"
23
+ Requires-Dist: httpx (>=0.21.2)
24
+ Requires-Dist: httpx-sse (==0.4.0)
25
+ Requires-Dist: iterators (>=0.2.0)
26
+ Requires-Dist: pydantic (>=1.9.2)
27
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
28
+ Requires-Dist: pydub (>=0.25.1)
29
+ Requires-Dist: typing_extensions (>=4.0.0)
30
+ Requires-Dist: websockets (>=10.4)
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Cartesia Python Library
34
+
35
+ [![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)
36
+ [![pypi](https://img.shields.io/pypi/v/cartesia)](https://pypi.python.org/pypi/cartesia)
37
+
38
+ The Cartesia Python library provides convenient access to the Cartesia API from Python.
39
+
40
+ ## Documentation
41
+
42
+ Our complete API documentation can be found [on docs.cartesia.ai](https://docs.cartesia.ai).
43
+
44
+ ## Installation
45
+
46
+ ```sh
47
+ pip install cartesia
48
+ ```
49
+
50
+ ## Reference
51
+
52
+ A full reference for this library is available [here](./reference.md).
53
+
54
+ ## Voices
55
+
56
+ ```python
57
+ from cartesia import Cartesia
58
+ import os
59
+
60
+ client = Cartesia(api_key=os.environ.get("CARTESIA_API_KEY"))
61
+
62
+ # Get all available voices
63
+ voices = client.voices.list()
64
+ print(voices)
65
+
66
+ # Get a specific voice
67
+ voice = client.voices.get(id="a0e99841-438c-4a64-b679-ae501e7d6091")
68
+ print("The embedding for", voice["name"], "is", voice["embedding"])
69
+
70
+ # Clone a voice using filepath
71
+ cloned_voice_embedding = client.voices.clone(filepath="path/to/voice")
72
+
73
+ # Mix voices together
74
+ mixed_voice_embedding = client.voices.mix(
75
+ [{ "id": "voice_id_1", "weight": 0.5 }, { "id": "voice_id_2", "weight": 0.25 }, { "id": "voice_id_3", "weight": 0.25 }]
76
+ )
77
+
78
+ # Create a new voice
79
+ new_voice = client.voices.create(
80
+ name="New Voice",
81
+ description="A clone of my own voice",
82
+ embedding=cloned_voice_embedding,
83
+ )
84
+ ```
85
+
86
+ ## Usage
87
+
88
+ Instantiate and use the client with the following:
89
+
90
+ ```python
91
+ from cartesia import Cartesia
92
+ from cartesia.tts import OutputFormat_Raw, TtsRequestIdSpecifier
93
+
94
+ client = Cartesia(
95
+ api_key="YOUR_API_KEY",
96
+ )
97
+ client.tts.bytes(
98
+ model_id="sonic-english",
99
+ transcript="Hello, world!",
100
+ voice={"id": "694f9389-aac1-45b6-b726-9d9369183238"},
101
+ ),
102
+ language="en",
103
+ output_format={
104
+ "container": "raw",
105
+ "sample_rate": 44100,
106
+ "encoding": "pcm_f32le",
107
+ },
108
+ )
109
+ ```
110
+
111
+ ## Async Client
112
+
113
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API.
114
+
115
+ ```python
116
+ import asyncio
117
+
118
+ from cartesia import AsyncCartesia
119
+ from cartesia.tts import OutputFormat_Raw, TtsRequestIdSpecifier
120
+
121
+ client = AsyncCartesia(
122
+ api_key="YOUR_API_KEY",
123
+ )
124
+
125
+
126
+ async def main() -> None:
127
+ await client.tts.bytes(
128
+ model_id="sonic-english",
129
+ transcript="Hello, world!",
130
+ voice={"id": "694f9389-aac1-45b6-b726-9d9369183238"},
131
+ language="en",
132
+ output_format={
133
+ "container": "raw",
134
+ "sample_rate": 44100,
135
+ "encoding": "pcm_f32le",
136
+ },
137
+ )
138
+
139
+
140
+ asyncio.run(main())
141
+ ```
142
+
143
+ ## Exception Handling
144
+
145
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
146
+ will be thrown.
147
+
148
+ ```python
149
+ from cartesia.core.api_error import ApiError
150
+
151
+ try:
152
+ client.tts.bytes(...)
153
+ except ApiError as e:
154
+ print(e.status_code)
155
+ print(e.body)
156
+ ```
157
+
158
+ ## Streaming
159
+
160
+ The SDK supports streaming responses, as well, the response will be a generator that you can loop over.
161
+
162
+ ```python
163
+ from cartesia import Cartesia
164
+ from cartesia.tts import Controls, OutputFormat_RawParams, TtsRequestIdSpecifierParams
165
+
166
+ client = Cartesia(
167
+ api_key="YOUR_API_KEY",
168
+ )
169
+ response = client.tts.sse(
170
+ model_id="string",
171
+ transcript="string",
172
+ voice={
173
+ "id": "string",
174
+ "experimental_controls": {
175
+ speed=1.1,
176
+ emotion="anger:lowest",
177
+ },
178
+ },
179
+ language="en",
180
+ output_format={},
181
+ duration=1.1,
182
+ )
183
+ for chunk in response:
184
+ yield chunk
185
+ ```
186
+
187
+ ## WebSocket
188
+
189
+ ```python
190
+ from cartesia import Cartesia
191
+ from cartesia.tts import TtsRequestEmbeddingSpecifierParams, OutputFormat_RawParams
192
+ import pyaudio
193
+
194
+ client = Cartesia(
195
+ api_key="YOUR_API_KEY",
196
+ )
197
+ voice_id = "a0e99841-438c-4a64-b679-ae501e7d6091"
198
+ voice = client.voices.get(id=voice_id)
199
+ transcript = "Hello! Welcome to Cartesia"
200
+
201
+ # You can check out our models at https://docs.cartesia.ai/getting-started/available-models
202
+ model_id = "sonic-english"
203
+
204
+ p = pyaudio.PyAudio()
205
+ rate = 22050
206
+
207
+ stream = None
208
+
209
+ # Set up the websocket connection
210
+ ws = client.tts.websocket()
211
+
212
+ # Generate and stream audio using the websocket
213
+ for output in ws.send(
214
+ model_id=model_id,
215
+ transcript=transcript,
216
+ voice={"embedding": voice.embedding},
217
+ stream=True,
218
+ output_format={
219
+ "container": "raw",
220
+ "encoding": "pcm_f32le",
221
+ "sample_rate": 22050
222
+ },
223
+ ):
224
+ buffer = output.audio
225
+
226
+ if not stream:
227
+ stream = p.open(format=pyaudio.paFloat32, channels=1, rate=rate, output=True)
228
+
229
+ # Write the audio data to the stream
230
+ stream.write(buffer)
231
+
232
+ stream.stop_stream()
233
+ stream.close()
234
+ p.terminate()
235
+
236
+ ws.close() # Close the websocket connection
237
+ ```
238
+
239
+ ## Advanced
240
+
241
+ ### Retries
242
+
243
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
244
+ as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
245
+ retry limit (default: 2).
246
+
247
+ A request is deemed retriable when any of the following HTTP status codes is returned:
248
+
249
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
250
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
251
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
252
+
253
+ Use the `max_retries` request option to configure this behavior.
254
+
255
+ ```python
256
+ client.tts.bytes(..., request_options={
257
+ "max_retries": 1
258
+ })
259
+ ```
260
+
261
+ ### Timeouts
262
+
263
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
264
+
265
+ ```python
266
+
267
+ from cartesia import Cartesia
268
+
269
+ client = Cartesia(
270
+ ...,
271
+ timeout=20.0,
272
+ )
273
+
274
+
275
+ # Override timeout for a specific method
276
+ client.tts.bytes(..., request_options={
277
+ "timeout_in_seconds": 1
278
+ })
279
+ ```
280
+
281
+ ### Custom Client
282
+
283
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
284
+ and transports.
285
+ ```python
286
+ import httpx
287
+ from cartesia import Cartesia
288
+
289
+ client = Cartesia(
290
+ ...,
291
+ httpx_client=httpx.Client(
292
+ proxies="http://my.test.proxy.example.com",
293
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
294
+ ),
295
+ )
296
+ ```
297
+
298
+ ## Contributing
299
+
300
+ While we value open-source contributions to this SDK, this library is generated programmatically.
301
+ Additions made directly to this library would have to be moved over to our generation code,
302
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
303
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
304
+ an issue first to discuss with us!
305
+
306
+ On the other hand, contributions to the README are always very welcome!
307
+
@@ -0,0 +1,160 @@
1
+ cartesia/__init__.py,sha256=M7AQ_2T6XVRQxhCUaFxWPwv2X1Ky8KY3wOPDLGlyIyo,7879
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=RdPFkIVuzjk-BH6CvnMUmsflqQjAoSKNDr2kxIE1C7M,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=KL5RGa0y4n8nX0-07WRg4ZQUTq30sc-XJbWcP5vjBDg,19552
16
+ cartesia/core/jsonable_encoder.py,sha256=qaF1gtgH-kQZb4kJskETwcCsOPUof-NnYVdszHkb-dM,3656
17
+ cartesia/core/pydantic_utilities.py,sha256=UibVGGYmBDsV834x8CtckRDrTIL4lYJPMrcq9yvf7RM,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=6cxSvaRbq0YEyCfGH-_SrDop6dgiXMKoRWDuP0e8MkA,11672
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=RfOZzohJNDN0TxEywAHA-kjHUJwqXPaBzGVSj7wR0r0,12611
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=Xjk98e21QUMlJedg3V-tkXbq6H6fSfKFo3x6ZoEBiLE,14824
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=tz0hG_v_lguNqtMJMLe4_yhSYOdMkbYCPnKsZLsB9Rc,1627
124
+ cartesia/voices/client.py,sha256=00PzrH-FIZNhKqPJNDkkwrToHiqS4zsk4qO2dhxL3mc,31865
125
+ cartesia/voices/requests/__init__.py,sha256=oNZkk0ydOwaRgA38vxNQ34K68CCBQN3yrdDTS9mwe7E,984
126
+ cartesia/voices/requests/create_voice_request.py,sha256=r6dKb9ga0ZsAi_6PXuE43u2lLgfQg2DIYjk2Neng7pI,617
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=V_j_1Dv9E8PjOFqjh0gh6MZEG76DIZPCQgyUkIR72xM,402
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=fSV-9Z1O_xhwIajsaE1_eR4HRthz5oIUAaZ_nJPbgx4,1461
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=_q0d8QojmQrpU-Puzd_YvWmiC7cBp_lrbKmTLuknYqQ,1005
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=TIkopmT1VOIMVORbiM-HpHGW61WJ_ihyP8-67_RkTew,375
146
+ cartesia/voices/types/localize_english_dialect.py,sha256=0PjZNjQv5ll2wWZxGveQIYCUGLtGDVELK9FBWFe7SNc,176
147
+ cartesia/voices/types/localize_portuguese_dialect.py,sha256=6dcThK1qWyS3c-W--3Zz7HK5ixS0qslEWrVQmKSrl9E,161
148
+ cartesia/voices/types/localize_spanish_dialect.py,sha256=h-H52vk0MBOvJqlzPVPgajfQU6oxpTzHoQAKmSDyaC4,158
149
+ cartesia/voices/types/localize_target_language.py,sha256=ttngtFVpMvuWAKQztJu_pCaf7V62DzmNq9zthPCb2LI,242
150
+ cartesia/voices/types/localize_voice_request.py,sha256=roZkcA7LiYs_L1R9FgTCTIgmHv9TUfXZMgLEnrajJ3I,887
151
+ cartesia/voices/types/mix_voice_specifier.py,sha256=B0FE6UREGk1TxlN0GOPwyCuqJbMkWVUs0EFqiJuQfZ8,236
152
+ cartesia/voices/types/mix_voices_request.py,sha256=R_8bmUmE1br4wmfH1Qu6EnL9uC-V1z5BV3_B7u51EOw,641
153
+ cartesia/voices/types/update_voice_request.py,sha256=_CEH8nuSZn2qZa9xZlANZXOhJd49XLel3dRy2dfOvr8,716
154
+ cartesia/voices/types/voice.py,sha256=echDtXYwyNvoBkwnVBaUV2HzRBbXDqZz0ZZcnj4307g,1278
155
+ cartesia/voices/types/voice_id.py,sha256=GDoXcRVeIm-V21R4suxG2zqLD3DLYkXE9kgizadzFKo,79
156
+ cartesia/voices/types/voice_metadata.py,sha256=4KNGjXMUKm3niv-NvKIFVGtiilpH13heuzKcZYNQxk4,1181
157
+ cartesia/voices/types/weight.py,sha256=XqDU7_JItNUb5QykIDqTbELlRYQdbt2SviRgW0w2LKo,80
158
+ cartesia-2.0.0a2.dist-info/METADATA,sha256=H2qk2eF-ouhNTOpoQW_nSkFba1J8efjNAj8jMIGEmes,8064
159
+ cartesia-2.0.0a2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
160
+ cartesia-2.0.0a2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
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__)