cartesia 2.0.2__tar.gz → 2.0.4__tar.gz

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-2.0.2 → cartesia-2.0.4}/PKG-INFO +1 -1
  2. {cartesia-2.0.2 → cartesia-2.0.4}/pyproject.toml +1 -1
  3. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/__init__.py +2 -0
  4. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/client_wrapper.py +1 -1
  5. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/__init__.py +2 -0
  6. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/_websocket.py +3 -3
  7. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/client.py +13 -32
  8. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/generation_request.py +2 -9
  9. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/tts_request.py +2 -8
  10. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_tts_request.py +2 -1
  11. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/__init__.py +2 -0
  12. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/generation_request.py +2 -9
  13. cartesia-2.0.4/src/cartesia/tts/types/model_speed.py +5 -0
  14. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/tts_request.py +2 -8
  15. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_tts_request.py +2 -1
  16. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/client.py +11 -13
  17. {cartesia-2.0.2 → cartesia-2.0.4}/README.md +0 -0
  18. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/api_status/__init__.py +0 -0
  19. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/api_status/client.py +0 -0
  20. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/api_status/requests/__init__.py +0 -0
  21. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/api_status/requests/api_info.py +0 -0
  22. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/api_status/types/__init__.py +0 -0
  23. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/api_status/types/api_info.py +0 -0
  24. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/__init__.py +0 -0
  25. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/client.py +0 -0
  26. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/requests/__init__.py +0 -0
  27. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/requests/token_grant.py +0 -0
  28. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/requests/token_request.py +0 -0
  29. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/requests/token_response.py +0 -0
  30. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/types/__init__.py +0 -0
  31. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/types/token_grant.py +0 -0
  32. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/types/token_request.py +0 -0
  33. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/auth/types/token_response.py +0 -0
  34. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/base_client.py +0 -0
  35. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/client.py +0 -0
  36. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/__init__.py +0 -0
  37. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/api_error.py +0 -0
  38. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/datetime_utils.py +0 -0
  39. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/file.py +0 -0
  40. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/http_client.py +0 -0
  41. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/jsonable_encoder.py +0 -0
  42. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/pagination.py +0 -0
  43. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/pydantic_utilities.py +0 -0
  44. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/query_encoder.py +0 -0
  45. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/remove_none_from_dict.py +0 -0
  46. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/request_options.py +0 -0
  47. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/core/serialization.py +0 -0
  48. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/__init__.py +0 -0
  49. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/requests/__init__.py +0 -0
  50. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/requests/create_dataset_request.py +0 -0
  51. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/requests/dataset.py +0 -0
  52. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/requests/dataset_file.py +0 -0
  53. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/requests/paginated_dataset_files.py +0 -0
  54. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/requests/paginated_datasets.py +0 -0
  55. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/types/__init__.py +0 -0
  56. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/types/create_dataset_request.py +0 -0
  57. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/types/dataset.py +0 -0
  58. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/types/dataset_file.py +0 -0
  59. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/types/file_purpose.py +0 -0
  60. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/types/paginated_dataset_files.py +0 -0
  61. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/datasets/types/paginated_datasets.py +0 -0
  62. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/embedding/__init__.py +0 -0
  63. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/embedding/types/__init__.py +0 -0
  64. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/embedding/types/embedding.py +0 -0
  65. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/environment.py +0 -0
  66. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/infill/__init__.py +0 -0
  67. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/infill/client.py +0 -0
  68. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/py.typed +0 -0
  69. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/_async_websocket.py +0 -0
  70. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/__init__.py +0 -0
  71. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/cancel_context_request.py +0 -0
  72. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/controls.py +0 -0
  73. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/mp_3_output_format.py +0 -0
  74. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/output_format.py +0 -0
  75. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/phoneme_timestamps.py +0 -0
  76. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/raw_output_format.py +0 -0
  77. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/speed.py +0 -0
  78. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/tts_request_embedding_specifier.py +0 -0
  79. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/tts_request_id_specifier.py +0 -0
  80. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/tts_request_voice_specifier.py +0 -0
  81. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/wav_output_format.py +0 -0
  82. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_base_response.py +0 -0
  83. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_chunk_response.py +0 -0
  84. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_done_response.py +0 -0
  85. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_error_response.py +0 -0
  86. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_flush_done_response.py +0 -0
  87. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_phoneme_timestamps_response.py +0 -0
  88. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_raw_output_format.py +0 -0
  89. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_request.py +0 -0
  90. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_response.py +0 -0
  91. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_stream_options.py +0 -0
  92. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_timestamps_response.py +0 -0
  93. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/web_socket_tts_output.py +0 -0
  94. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/requests/word_timestamps.py +0 -0
  95. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/socket_client.py +0 -0
  96. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/cancel_context_request.py +0 -0
  97. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/context_id.py +0 -0
  98. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/controls.py +0 -0
  99. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/emotion.py +0 -0
  100. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/flush_id.py +0 -0
  101. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/mp_3_output_format.py +0 -0
  102. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/natural_specifier.py +0 -0
  103. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/numerical_specifier.py +0 -0
  104. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/output_format.py +0 -0
  105. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/phoneme_timestamps.py +0 -0
  106. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/raw_encoding.py +0 -0
  107. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/raw_output_format.py +0 -0
  108. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/speed.py +0 -0
  109. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/supported_language.py +0 -0
  110. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/tts_request_embedding_specifier.py +0 -0
  111. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/tts_request_id_specifier.py +0 -0
  112. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/tts_request_voice_specifier.py +0 -0
  113. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/wav_output_format.py +0 -0
  114. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_base_response.py +0 -0
  115. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_chunk_response.py +0 -0
  116. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_done_response.py +0 -0
  117. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_error_response.py +0 -0
  118. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_flush_done_response.py +0 -0
  119. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_phoneme_timestamps_response.py +0 -0
  120. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_raw_output_format.py +0 -0
  121. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_request.py +0 -0
  122. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_response.py +0 -0
  123. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_stream_options.py +0 -0
  124. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_timestamps_response.py +0 -0
  125. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/web_socket_tts_output.py +0 -0
  126. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/types/word_timestamps.py +0 -0
  127. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/utils/constants.py +0 -0
  128. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/utils/tts.py +0 -0
  129. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/tts/utils/types.py +0 -0
  130. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/version.py +0 -0
  131. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voice_changer/__init__.py +0 -0
  132. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voice_changer/client.py +0 -0
  133. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voice_changer/requests/__init__.py +0 -0
  134. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voice_changer/requests/streaming_response.py +0 -0
  135. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voice_changer/types/__init__.py +0 -0
  136. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voice_changer/types/output_format_container.py +0 -0
  137. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voice_changer/types/streaming_response.py +0 -0
  138. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/__init__.py +0 -0
  139. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/__init__.py +0 -0
  140. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/create_voice_request.py +0 -0
  141. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/embedding_response.py +0 -0
  142. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/embedding_specifier.py +0 -0
  143. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/get_voices_response.py +0 -0
  144. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/id_specifier.py +0 -0
  145. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/localize_dialect.py +0 -0
  146. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/localize_voice_request.py +0 -0
  147. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/mix_voice_specifier.py +0 -0
  148. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/mix_voices_request.py +0 -0
  149. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/update_voice_request.py +0 -0
  150. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/voice.py +0 -0
  151. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/requests/voice_metadata.py +0 -0
  152. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/__init__.py +0 -0
  153. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/base_voice_id.py +0 -0
  154. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/clone_mode.py +0 -0
  155. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/create_voice_request.py +0 -0
  156. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/embedding_response.py +0 -0
  157. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/embedding_specifier.py +0 -0
  158. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/gender.py +0 -0
  159. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/gender_presentation.py +0 -0
  160. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/get_voices_response.py +0 -0
  161. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/id_specifier.py +0 -0
  162. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/localize_dialect.py +0 -0
  163. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/localize_english_dialect.py +0 -0
  164. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/localize_french_dialect.py +0 -0
  165. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/localize_portuguese_dialect.py +0 -0
  166. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/localize_spanish_dialect.py +0 -0
  167. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/localize_target_language.py +0 -0
  168. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/localize_voice_request.py +0 -0
  169. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/mix_voice_specifier.py +0 -0
  170. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/mix_voices_request.py +0 -0
  171. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/update_voice_request.py +0 -0
  172. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/voice.py +0 -0
  173. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/voice_expand_options.py +0 -0
  174. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/voice_id.py +0 -0
  175. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/voice_metadata.py +0 -0
  176. {cartesia-2.0.2 → cartesia-2.0.4}/src/cartesia/voices/types/weight.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cartesia
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -3,7 +3,7 @@ name = "cartesia"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "cartesia"
6
- version = "2.0.2"
6
+ version = "2.0.4"
7
7
  description = ""
8
8
  readme = "README.md"
9
9
  authors = []
@@ -29,6 +29,7 @@ from .tts import (
29
29
  FlushId,
30
30
  GenerationRequest,
31
31
  GenerationRequestParams,
32
+ ModelSpeed,
32
33
  Mp3OutputFormat,
33
34
  Mp3OutputFormatParams,
34
35
  NaturalSpecifier,
@@ -201,6 +202,7 @@ __all__ = [
201
202
  "MixVoiceSpecifierParams",
202
203
  "MixVoicesRequest",
203
204
  "MixVoicesRequestParams",
205
+ "ModelSpeed",
204
206
  "Mp3OutputFormat",
205
207
  "Mp3OutputFormatParams",
206
208
  "NaturalSpecifier",
@@ -16,7 +16,7 @@ class BaseClientWrapper:
16
16
  headers: typing.Dict[str, str] = {
17
17
  "X-Fern-Language": "Python",
18
18
  "X-Fern-SDK-Name": "cartesia",
19
- "X-Fern-SDK-Version": "2.0.2",
19
+ "X-Fern-SDK-Version": "2.0.4",
20
20
  }
21
21
  headers["X-API-Key"] = self.api_key
22
22
  headers["Cartesia-Version"] = "2024-11-13"
@@ -7,6 +7,7 @@ from .types import (
7
7
  Emotion,
8
8
  FlushId,
9
9
  GenerationRequest,
10
+ ModelSpeed,
10
11
  Mp3OutputFormat,
11
12
  NaturalSpecifier,
12
13
  NumericalSpecifier,
@@ -94,6 +95,7 @@ __all__ = [
94
95
  "FlushId",
95
96
  "GenerationRequest",
96
97
  "GenerationRequestParams",
98
+ "ModelSpeed",
97
99
  "Mp3OutputFormat",
98
100
  "Mp3OutputFormatParams",
99
101
  "NaturalSpecifier",
@@ -154,7 +154,7 @@ class _TTSContext:
154
154
  f"Error generating audio:\n{response_obj.error}"
155
155
  )
156
156
  if isinstance(response_obj, WebSocketResponse_Done):
157
- break
157
+ return
158
158
  if (
159
159
  isinstance(response_obj, WebSocketResponse_Chunk)
160
160
  or isinstance(response_obj, WebSocketResponse_Timestamps)
@@ -185,7 +185,7 @@ class _TTSContext:
185
185
  f"Error generating audio:\n{response_obj.error}"
186
186
  )
187
187
  if isinstance(response_obj, WebSocketResponse_Done):
188
- break
188
+ return
189
189
  if (
190
190
  isinstance(response_obj, WebSocketResponse_Chunk)
191
191
  or isinstance(response_obj, WebSocketResponse_Timestamps)
@@ -221,7 +221,7 @@ class _TTSContext:
221
221
  if isinstance(response_obj, WebSocketResponse_Error):
222
222
  raise RuntimeError(f"Error generating audio:\n{response_obj.error}")
223
223
  if isinstance(response_obj, WebSocketResponse_Done):
224
- break
224
+ return
225
225
  yield self._websocket._convert_response(
226
226
  response_obj, include_context_id=True
227
227
  )
@@ -5,6 +5,7 @@ from ..core.client_wrapper import SyncClientWrapper
5
5
  from .requests.tts_request_voice_specifier import TtsRequestVoiceSpecifierParams
6
6
  from .requests.output_format import OutputFormatParams
7
7
  from .types.supported_language import SupportedLanguage
8
+ from .types.model_speed import ModelSpeed
8
9
  from ..core.request_options import RequestOptions
9
10
  from ..core.serialization import convert_and_respect_annotation_metadata
10
11
  from json.decoder import JSONDecodeError
@@ -32,7 +33,7 @@ class TtsClient:
32
33
  output_format: OutputFormatParams,
33
34
  language: typing.Optional[SupportedLanguage] = OMIT,
34
35
  duration: typing.Optional[float] = OMIT,
35
- text_cfg: typing.Optional[float] = OMIT,
36
+ speed: typing.Optional[ModelSpeed] = OMIT,
36
37
  request_options: typing.Optional[RequestOptions] = None,
37
38
  ) -> typing.Iterator[bytes]:
38
39
  """
@@ -53,12 +54,7 @@ class TtsClient:
53
54
  The maximum duration of the audio in seconds. You do not usually need to specify this.
54
55
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
55
56
 
56
- text_cfg : typing.Optional[float]
57
- The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
58
-
59
- Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
60
-
61
- This parameter is only supported for `sonic-2` models.
57
+ speed : typing.Optional[ModelSpeed]
62
58
 
63
59
  request_options : typing.Optional[RequestOptions]
64
60
  Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
@@ -100,7 +96,7 @@ class TtsClient:
100
96
  object_=output_format, annotation=OutputFormatParams, direction="write"
101
97
  ),
102
98
  "duration": duration,
103
- "text_cfg": text_cfg,
99
+ "speed": speed,
104
100
  },
105
101
  request_options=request_options,
106
102
  omit=OMIT,
@@ -126,7 +122,7 @@ class TtsClient:
126
122
  output_format: OutputFormatParams,
127
123
  language: typing.Optional[SupportedLanguage] = OMIT,
128
124
  duration: typing.Optional[float] = OMIT,
129
- text_cfg: typing.Optional[float] = OMIT,
125
+ speed: typing.Optional[ModelSpeed] = OMIT,
130
126
  request_options: typing.Optional[RequestOptions] = None,
131
127
  ) -> typing.Iterator[WebSocketResponse]:
132
128
  """
@@ -147,12 +143,7 @@ class TtsClient:
147
143
  The maximum duration of the audio in seconds. You do not usually need to specify this.
148
144
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
149
145
 
150
- text_cfg : typing.Optional[float]
151
- The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
152
-
153
- Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
154
-
155
- This parameter is only supported for `sonic-2` models.
146
+ speed : typing.Optional[ModelSpeed]
156
147
 
157
148
  request_options : typing.Optional[RequestOptions]
158
149
  Request-specific configuration.
@@ -196,7 +187,7 @@ class TtsClient:
196
187
  object_=output_format, annotation=OutputFormatParams, direction="write"
197
188
  ),
198
189
  "duration": duration,
199
- "text_cfg": text_cfg,
190
+ "speed": speed,
200
191
  },
201
192
  request_options=request_options,
202
193
  omit=OMIT,
@@ -236,7 +227,7 @@ class AsyncTtsClient:
236
227
  output_format: OutputFormatParams,
237
228
  language: typing.Optional[SupportedLanguage] = OMIT,
238
229
  duration: typing.Optional[float] = OMIT,
239
- text_cfg: typing.Optional[float] = OMIT,
230
+ speed: typing.Optional[ModelSpeed] = OMIT,
240
231
  request_options: typing.Optional[RequestOptions] = None,
241
232
  ) -> typing.AsyncIterator[bytes]:
242
233
  """
@@ -257,12 +248,7 @@ class AsyncTtsClient:
257
248
  The maximum duration of the audio in seconds. You do not usually need to specify this.
258
249
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
259
250
 
260
- text_cfg : typing.Optional[float]
261
- The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
262
-
263
- Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
264
-
265
- This parameter is only supported for `sonic-2` models.
251
+ speed : typing.Optional[ModelSpeed]
266
252
 
267
253
  request_options : typing.Optional[RequestOptions]
268
254
  Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
@@ -312,7 +298,7 @@ class AsyncTtsClient:
312
298
  object_=output_format, annotation=OutputFormatParams, direction="write"
313
299
  ),
314
300
  "duration": duration,
315
- "text_cfg": text_cfg,
301
+ "speed": speed,
316
302
  },
317
303
  request_options=request_options,
318
304
  omit=OMIT,
@@ -338,7 +324,7 @@ class AsyncTtsClient:
338
324
  output_format: OutputFormatParams,
339
325
  language: typing.Optional[SupportedLanguage] = OMIT,
340
326
  duration: typing.Optional[float] = OMIT,
341
- text_cfg: typing.Optional[float] = OMIT,
327
+ speed: typing.Optional[ModelSpeed] = OMIT,
342
328
  request_options: typing.Optional[RequestOptions] = None,
343
329
  ) -> typing.AsyncIterator[WebSocketResponse]:
344
330
  """
@@ -359,12 +345,7 @@ class AsyncTtsClient:
359
345
  The maximum duration of the audio in seconds. You do not usually need to specify this.
360
346
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
361
347
 
362
- text_cfg : typing.Optional[float]
363
- The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
364
-
365
- Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
366
-
367
- This parameter is only supported for `sonic-2` models.
348
+ speed : typing.Optional[ModelSpeed]
368
349
 
369
350
  request_options : typing.Optional[RequestOptions]
370
351
  Request-specific configuration.
@@ -416,7 +397,7 @@ class AsyncTtsClient:
416
397
  object_=output_format, annotation=OutputFormatParams, direction="write"
417
398
  ),
418
399
  "duration": duration,
419
- "text_cfg": text_cfg,
400
+ "speed": speed,
420
401
  },
421
402
  request_options=request_options,
422
403
  omit=OMIT,
@@ -6,6 +6,7 @@ from .tts_request_voice_specifier import TtsRequestVoiceSpecifierParams
6
6
  import typing_extensions
7
7
  from ..types.supported_language import SupportedLanguage
8
8
  from .web_socket_raw_output_format import WebSocketRawOutputFormatParams
9
+ from ..types.model_speed import ModelSpeed
9
10
  from ..types.context_id import ContextId
10
11
  from ...core.serialization import FieldMetadata
11
12
 
@@ -30,15 +31,7 @@ class GenerationRequestParams(typing_extensions.TypedDict):
30
31
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
31
32
  """
32
33
 
33
- text_cfg: typing_extensions.NotRequired[float]
34
- """
35
- The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
36
-
37
- Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
38
-
39
- This parameter is only supported for `sonic-2` models.
40
- """
41
-
34
+ speed: typing_extensions.NotRequired[ModelSpeed]
42
35
  context_id: typing_extensions.NotRequired[ContextId]
43
36
  continue_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="continue")]]
44
37
  """
@@ -5,6 +5,7 @@ from .tts_request_voice_specifier import TtsRequestVoiceSpecifierParams
5
5
  import typing_extensions
6
6
  from ..types.supported_language import SupportedLanguage
7
7
  from .output_format import OutputFormatParams
8
+ from ..types.model_speed import ModelSpeed
8
9
 
9
10
 
10
11
  class TtsRequestParams(typing_extensions.TypedDict):
@@ -23,11 +24,4 @@ class TtsRequestParams(typing_extensions.TypedDict):
23
24
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
24
25
  """
25
26
 
26
- text_cfg: typing_extensions.NotRequired[float]
27
- """
28
- The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
29
-
30
- Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
31
-
32
- This parameter is only supported for `sonic-2` models.
33
- """
27
+ speed: typing_extensions.NotRequired[ModelSpeed]
@@ -5,6 +5,7 @@ import typing_extensions
5
5
  from .output_format import OutputFormatParams
6
6
  from .tts_request_voice_specifier import TtsRequestVoiceSpecifierParams
7
7
  from ...core.serialization import FieldMetadata
8
+ from ..types.model_speed import ModelSpeed
8
9
 
9
10
 
10
11
  class WebSocketTtsRequestParams(typing_extensions.TypedDict):
@@ -24,4 +25,4 @@ class WebSocketTtsRequestParams(typing_extensions.TypedDict):
24
25
  continue_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="continue")]]
25
26
  context_id: typing_extensions.NotRequired[str]
26
27
  max_buffer_delay_ms: typing_extensions.NotRequired[int]
27
- text_cfg: typing_extensions.NotRequired[float]
28
+ speed: typing_extensions.NotRequired[ModelSpeed]
@@ -6,6 +6,7 @@ from .controls import Controls
6
6
  from .emotion import Emotion
7
7
  from .flush_id import FlushId
8
8
  from .generation_request import GenerationRequest
9
+ from .model_speed import ModelSpeed
9
10
  from .mp_3_output_format import Mp3OutputFormat
10
11
  from .natural_specifier import NaturalSpecifier
11
12
  from .numerical_specifier import NumericalSpecifier
@@ -50,6 +51,7 @@ __all__ = [
50
51
  "Emotion",
51
52
  "FlushId",
52
53
  "GenerationRequest",
54
+ "ModelSpeed",
53
55
  "Mp3OutputFormat",
54
56
  "NaturalSpecifier",
55
57
  "NumericalSpecifier",
@@ -6,6 +6,7 @@ import typing
6
6
  from .tts_request_voice_specifier import TtsRequestVoiceSpecifier
7
7
  from .supported_language import SupportedLanguage
8
8
  from .web_socket_raw_output_format import WebSocketRawOutputFormat
9
+ from .model_speed import ModelSpeed
9
10
  from .context_id import ContextId
10
11
  import typing_extensions
11
12
  from ...core.serialization import FieldMetadata
@@ -32,15 +33,7 @@ class GenerationRequest(UniversalBaseModel):
32
33
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
33
34
  """
34
35
 
35
- text_cfg: typing.Optional[float] = pydantic.Field(default=None)
36
- """
37
- The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
38
-
39
- Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
40
-
41
- This parameter is only supported for `sonic-2` models.
42
- """
43
-
36
+ speed: typing.Optional[ModelSpeed] = None
44
37
  context_id: typing.Optional[ContextId] = None
45
38
  continue_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="continue")] = pydantic.Field(
46
39
  default=None
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ModelSpeed = typing.Union[typing.Literal["slow", "normal", "fast"], typing.Any]
@@ -6,6 +6,7 @@ from .tts_request_voice_specifier import TtsRequestVoiceSpecifier
6
6
  import typing
7
7
  from .supported_language import SupportedLanguage
8
8
  from .output_format import OutputFormat
9
+ from .model_speed import ModelSpeed
9
10
  from ...core.pydantic_utilities import IS_PYDANTIC_V2
10
11
 
11
12
 
@@ -25,14 +26,7 @@ class TtsRequest(UniversalBaseModel):
25
26
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
26
27
  """
27
28
 
28
- text_cfg: typing.Optional[float] = pydantic.Field(default=None)
29
- """
30
- The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
31
-
32
- Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
33
-
34
- This parameter is only supported for `sonic-2` models.
35
- """
29
+ speed: typing.Optional[ModelSpeed] = None
36
30
 
37
31
  if IS_PYDANTIC_V2:
38
32
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -7,6 +7,7 @@ from .output_format import OutputFormat
7
7
  from .tts_request_voice_specifier import TtsRequestVoiceSpecifier
8
8
  import typing_extensions
9
9
  from ...core.serialization import FieldMetadata
10
+ from .model_speed import ModelSpeed
10
11
  from ...core.pydantic_utilities import IS_PYDANTIC_V2
11
12
 
12
13
 
@@ -27,7 +28,7 @@ class WebSocketTtsRequest(UniversalBaseModel):
27
28
  continue_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="continue")] = None
28
29
  context_id: typing.Optional[str] = None
29
30
  max_buffer_delay_ms: typing.Optional[int] = None
30
- text_cfg: typing.Optional[float] = None
31
+ speed: typing.Optional[ModelSpeed] = None
31
32
 
32
33
  if IS_PYDANTIC_V2:
33
34
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -14,8 +14,8 @@ from ..core.api_error import ApiError
14
14
  from .. import core
15
15
  from ..tts.types.supported_language import SupportedLanguage
16
16
  from .types.clone_mode import CloneMode
17
- from .types.voice_metadata import VoiceMetadata
18
17
  from .types.voice_id import VoiceId
18
+ from .types.voice_metadata import VoiceMetadata
19
19
  from ..core.jsonable_encoder import jsonable_encoder
20
20
  from .types.localize_target_language import LocalizeTargetLanguage
21
21
  from .types.gender import Gender
@@ -150,7 +150,7 @@ class VoicesClient:
150
150
  mode: CloneMode,
151
151
  description: typing.Optional[str] = OMIT,
152
152
  enhance: typing.Optional[bool] = OMIT,
153
- transcript: typing.Optional[str] = OMIT,
153
+ base_voice_id: typing.Optional[VoiceId] = OMIT,
154
154
  request_options: typing.Optional[RequestOptions] = None,
155
155
  ) -> VoiceMetadata:
156
156
  """
@@ -182,11 +182,11 @@ class VoicesClient:
182
182
 
183
183
 
184
184
  enhance : typing.Optional[bool]
185
- Whether to enhance the clip to improve its quality before cloning. Useful if the clip has background noise.
185
+ Whether to apply AI enhancements to the clip to reduce background noise. This leads to cleaner generated speech at the cost of reduced similarity to the source clip.
186
186
 
187
187
 
188
- transcript : typing.Optional[str]
189
- Optional transcript of the words spoken in the audio clip. Only used for similarity mode.
188
+ base_voice_id : typing.Optional[VoiceId]
189
+ Optional base voice ID that the cloned voice is derived from.
190
190
 
191
191
 
192
192
  request_options : typing.Optional[RequestOptions]
@@ -208,7 +208,6 @@ class VoicesClient:
208
208
  description="Copied from Cartesia docs",
209
209
  mode="stability",
210
210
  language="en",
211
- enhance=True,
212
211
  )
213
212
  """
214
213
  _response = self._client_wrapper.httpx_client.request(
@@ -220,7 +219,7 @@ class VoicesClient:
220
219
  "language": language,
221
220
  "mode": mode,
222
221
  "enhance": enhance,
223
- "transcript": transcript,
222
+ "base_voice_id": base_voice_id,
224
223
  },
225
224
  files={
226
225
  "clip": clip,
@@ -719,7 +718,7 @@ class AsyncVoicesClient:
719
718
  mode: CloneMode,
720
719
  description: typing.Optional[str] = OMIT,
721
720
  enhance: typing.Optional[bool] = OMIT,
722
- transcript: typing.Optional[str] = OMIT,
721
+ base_voice_id: typing.Optional[VoiceId] = OMIT,
723
722
  request_options: typing.Optional[RequestOptions] = None,
724
723
  ) -> VoiceMetadata:
725
724
  """
@@ -751,11 +750,11 @@ class AsyncVoicesClient:
751
750
 
752
751
 
753
752
  enhance : typing.Optional[bool]
754
- Whether to enhance the clip to improve its quality before cloning. Useful if the clip has background noise.
753
+ Whether to apply AI enhancements to the clip to reduce background noise. This leads to cleaner generated speech at the cost of reduced similarity to the source clip.
755
754
 
756
755
 
757
- transcript : typing.Optional[str]
758
- Optional transcript of the words spoken in the audio clip. Only used for similarity mode.
756
+ base_voice_id : typing.Optional[VoiceId]
757
+ Optional base voice ID that the cloned voice is derived from.
759
758
 
760
759
 
761
760
  request_options : typing.Optional[RequestOptions]
@@ -782,7 +781,6 @@ class AsyncVoicesClient:
782
781
  description="Copied from Cartesia docs",
783
782
  mode="stability",
784
783
  language="en",
785
- enhance=True,
786
784
  )
787
785
 
788
786
 
@@ -797,7 +795,7 @@ class AsyncVoicesClient:
797
795
  "language": language,
798
796
  "mode": mode,
799
797
  "enhance": enhance,
800
- "transcript": transcript,
798
+ "base_voice_id": base_voice_id,
801
799
  },
802
800
  files={
803
801
  "clip": clip,
File without changes
File without changes