cartesia 2.0.0b8__tar.gz → 2.0.2__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 (175) hide show
  1. {cartesia-2.0.0b8 → cartesia-2.0.2}/PKG-INFO +1 -1
  2. {cartesia-2.0.0b8 → cartesia-2.0.2}/pyproject.toml +1 -1
  3. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/__init__.py +9 -1
  4. cartesia-2.0.2/src/cartesia/auth/__init__.py +13 -0
  5. cartesia-2.0.2/src/cartesia/auth/client.py +159 -0
  6. cartesia-2.0.2/src/cartesia/auth/requests/__init__.py +7 -0
  7. cartesia-2.0.2/src/cartesia/auth/requests/token_grant.py +10 -0
  8. cartesia-2.0.2/src/cartesia/auth/requests/token_request.py +17 -0
  9. cartesia-2.0.2/src/cartesia/auth/requests/token_response.py +10 -0
  10. cartesia-2.0.2/src/cartesia/auth/types/__init__.py +7 -0
  11. cartesia-2.0.2/src/cartesia/auth/types/token_grant.py +22 -0
  12. cartesia-2.0.2/src/cartesia/auth/types/token_request.py +28 -0
  13. cartesia-2.0.2/src/cartesia/auth/types/token_response.py +22 -0
  14. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/base_client.py +4 -0
  15. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/client_wrapper.py +1 -1
  16. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/_async_websocket.py +3 -0
  17. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/_websocket.py +3 -0
  18. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/client.py +40 -4
  19. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/generation_request.py +19 -1
  20. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/tts_request.py +10 -1
  21. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_tts_request.py +3 -1
  22. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/generation_request.py +19 -1
  23. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/tts_request.py +10 -1
  24. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_tts_request.py +3 -1
  25. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/client.py +10 -10
  26. {cartesia-2.0.0b8 → cartesia-2.0.2}/README.md +0 -0
  27. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/api_status/__init__.py +0 -0
  28. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/api_status/client.py +0 -0
  29. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/api_status/requests/__init__.py +0 -0
  30. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/api_status/requests/api_info.py +0 -0
  31. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/api_status/types/__init__.py +0 -0
  32. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/api_status/types/api_info.py +0 -0
  33. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/client.py +0 -0
  34. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/__init__.py +0 -0
  35. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/api_error.py +0 -0
  36. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/datetime_utils.py +0 -0
  37. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/file.py +0 -0
  38. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/http_client.py +0 -0
  39. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/jsonable_encoder.py +0 -0
  40. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/pagination.py +0 -0
  41. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/pydantic_utilities.py +0 -0
  42. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/query_encoder.py +0 -0
  43. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/remove_none_from_dict.py +0 -0
  44. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/request_options.py +0 -0
  45. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/core/serialization.py +0 -0
  46. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/__init__.py +0 -0
  47. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/requests/__init__.py +0 -0
  48. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/requests/create_dataset_request.py +0 -0
  49. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/requests/dataset.py +0 -0
  50. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/requests/dataset_file.py +0 -0
  51. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/requests/paginated_dataset_files.py +0 -0
  52. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/requests/paginated_datasets.py +0 -0
  53. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/types/__init__.py +0 -0
  54. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/types/create_dataset_request.py +0 -0
  55. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/types/dataset.py +0 -0
  56. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/types/dataset_file.py +0 -0
  57. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/types/file_purpose.py +0 -0
  58. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/types/paginated_dataset_files.py +0 -0
  59. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/datasets/types/paginated_datasets.py +0 -0
  60. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/embedding/__init__.py +0 -0
  61. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/embedding/types/__init__.py +0 -0
  62. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/embedding/types/embedding.py +0 -0
  63. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/environment.py +0 -0
  64. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/infill/__init__.py +0 -0
  65. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/infill/client.py +0 -0
  66. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/py.typed +0 -0
  67. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/__init__.py +0 -0
  68. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/__init__.py +0 -0
  69. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/cancel_context_request.py +0 -0
  70. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/controls.py +0 -0
  71. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/mp_3_output_format.py +0 -0
  72. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/output_format.py +0 -0
  73. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/phoneme_timestamps.py +0 -0
  74. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/raw_output_format.py +0 -0
  75. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/speed.py +0 -0
  76. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/tts_request_embedding_specifier.py +0 -0
  77. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/tts_request_id_specifier.py +0 -0
  78. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/tts_request_voice_specifier.py +0 -0
  79. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/wav_output_format.py +0 -0
  80. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_base_response.py +0 -0
  81. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_chunk_response.py +0 -0
  82. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_done_response.py +0 -0
  83. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_error_response.py +0 -0
  84. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_flush_done_response.py +0 -0
  85. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_phoneme_timestamps_response.py +0 -0
  86. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_raw_output_format.py +0 -0
  87. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_request.py +0 -0
  88. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_response.py +0 -0
  89. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_stream_options.py +0 -0
  90. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_timestamps_response.py +0 -0
  91. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/web_socket_tts_output.py +0 -0
  92. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/requests/word_timestamps.py +0 -0
  93. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/socket_client.py +0 -0
  94. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/__init__.py +0 -0
  95. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/cancel_context_request.py +0 -0
  96. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/context_id.py +0 -0
  97. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/controls.py +0 -0
  98. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/emotion.py +0 -0
  99. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/flush_id.py +0 -0
  100. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/mp_3_output_format.py +0 -0
  101. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/natural_specifier.py +0 -0
  102. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/numerical_specifier.py +0 -0
  103. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/output_format.py +0 -0
  104. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/phoneme_timestamps.py +0 -0
  105. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/raw_encoding.py +0 -0
  106. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/raw_output_format.py +0 -0
  107. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/speed.py +0 -0
  108. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/supported_language.py +0 -0
  109. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/tts_request_embedding_specifier.py +0 -0
  110. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/tts_request_id_specifier.py +0 -0
  111. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/tts_request_voice_specifier.py +0 -0
  112. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/wav_output_format.py +0 -0
  113. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_base_response.py +0 -0
  114. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_chunk_response.py +0 -0
  115. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_done_response.py +0 -0
  116. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_error_response.py +0 -0
  117. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_flush_done_response.py +0 -0
  118. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_phoneme_timestamps_response.py +0 -0
  119. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_raw_output_format.py +0 -0
  120. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_request.py +0 -0
  121. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_response.py +0 -0
  122. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_stream_options.py +0 -0
  123. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_timestamps_response.py +0 -0
  124. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/web_socket_tts_output.py +0 -0
  125. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/types/word_timestamps.py +0 -0
  126. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/utils/constants.py +0 -0
  127. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/utils/tts.py +0 -0
  128. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/tts/utils/types.py +0 -0
  129. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/version.py +0 -0
  130. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voice_changer/__init__.py +0 -0
  131. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voice_changer/client.py +0 -0
  132. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voice_changer/requests/__init__.py +0 -0
  133. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voice_changer/requests/streaming_response.py +0 -0
  134. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voice_changer/types/__init__.py +0 -0
  135. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voice_changer/types/output_format_container.py +0 -0
  136. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voice_changer/types/streaming_response.py +0 -0
  137. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/__init__.py +0 -0
  138. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/__init__.py +0 -0
  139. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/create_voice_request.py +0 -0
  140. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/embedding_response.py +0 -0
  141. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/embedding_specifier.py +0 -0
  142. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/get_voices_response.py +0 -0
  143. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/id_specifier.py +0 -0
  144. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/localize_dialect.py +0 -0
  145. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/localize_voice_request.py +0 -0
  146. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/mix_voice_specifier.py +0 -0
  147. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/mix_voices_request.py +0 -0
  148. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/update_voice_request.py +0 -0
  149. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/voice.py +0 -0
  150. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/requests/voice_metadata.py +0 -0
  151. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/__init__.py +0 -0
  152. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/base_voice_id.py +0 -0
  153. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/clone_mode.py +0 -0
  154. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/create_voice_request.py +0 -0
  155. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/embedding_response.py +0 -0
  156. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/embedding_specifier.py +0 -0
  157. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/gender.py +0 -0
  158. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/gender_presentation.py +0 -0
  159. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/get_voices_response.py +0 -0
  160. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/id_specifier.py +0 -0
  161. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/localize_dialect.py +0 -0
  162. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/localize_english_dialect.py +0 -0
  163. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/localize_french_dialect.py +0 -0
  164. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/localize_portuguese_dialect.py +0 -0
  165. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/localize_spanish_dialect.py +0 -0
  166. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/localize_target_language.py +0 -0
  167. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/localize_voice_request.py +0 -0
  168. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/mix_voice_specifier.py +0 -0
  169. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/mix_voices_request.py +0 -0
  170. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/update_voice_request.py +0 -0
  171. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/voice.py +0 -0
  172. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/voice_expand_options.py +0 -0
  173. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/voice_id.py +0 -0
  174. {cartesia-2.0.0b8 → cartesia-2.0.2}/src/cartesia/voices/types/voice_metadata.py +0 -0
  175. {cartesia-2.0.0b8 → cartesia-2.0.2}/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.0b8
3
+ Version: 2.0.2
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.0b8"
6
+ version = "2.0.2"
7
7
  description = ""
8
8
  readme = "README.md"
9
9
  authors = []
@@ -1,7 +1,8 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from . import api_status, datasets, embedding, infill, tts, voice_changer, voices
3
+ from . import api_status, auth, datasets, embedding, infill, tts, voice_changer, voices
4
4
  from .api_status import ApiInfo, ApiInfoParams
5
+ from .auth import TokenGrant, TokenGrantParams, TokenRequest, TokenRequestParams, TokenResponse, TokenResponseParams
5
6
  from .client import AsyncCartesia, Cartesia
6
7
  from .datasets import (
7
8
  CreateDatasetRequest,
@@ -233,6 +234,12 @@ __all__ = [
233
234
  "StreamingResponse_Error",
234
235
  "StreamingResponse_ErrorParams",
235
236
  "SupportedLanguage",
237
+ "TokenGrant",
238
+ "TokenGrantParams",
239
+ "TokenRequest",
240
+ "TokenRequestParams",
241
+ "TokenResponse",
242
+ "TokenResponseParams",
236
243
  "TtsRequest",
237
244
  "TtsRequestEmbeddingSpecifier",
238
245
  "TtsRequestEmbeddingSpecifierParams",
@@ -294,6 +301,7 @@ __all__ = [
294
301
  "WordTimestampsParams",
295
302
  "__version__",
296
303
  "api_status",
304
+ "auth",
297
305
  "datasets",
298
306
  "embedding",
299
307
  "infill",
@@ -0,0 +1,13 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import TokenGrant, TokenRequest, TokenResponse
4
+ from .requests import TokenGrantParams, TokenRequestParams, TokenResponseParams
5
+
6
+ __all__ = [
7
+ "TokenGrant",
8
+ "TokenGrantParams",
9
+ "TokenRequest",
10
+ "TokenRequestParams",
11
+ "TokenResponse",
12
+ "TokenResponseParams",
13
+ ]
@@ -0,0 +1,159 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from ..core.client_wrapper import SyncClientWrapper
5
+ from .requests.token_grant import TokenGrantParams
6
+ from ..core.request_options import RequestOptions
7
+ from .types.token_response import TokenResponse
8
+ from ..core.serialization import convert_and_respect_annotation_metadata
9
+ from ..core.pydantic_utilities import parse_obj_as
10
+ from json.decoder import JSONDecodeError
11
+ from ..core.api_error import ApiError
12
+ from ..core.client_wrapper import AsyncClientWrapper
13
+
14
+ # this is used as the default value for optional parameters
15
+ OMIT = typing.cast(typing.Any, ...)
16
+
17
+
18
+ class AuthClient:
19
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
20
+ self._client_wrapper = client_wrapper
21
+
22
+ def access_token(
23
+ self,
24
+ *,
25
+ grants: TokenGrantParams,
26
+ expires_in: typing.Optional[int] = OMIT,
27
+ request_options: typing.Optional[RequestOptions] = None,
28
+ ) -> TokenResponse:
29
+ """
30
+ Generates a new Access Token for the client. These tokens are short-lived and should be used to make requests to the API from authenticated clients.
31
+
32
+ Parameters
33
+ ----------
34
+ grants : TokenGrantParams
35
+ The permissions to be granted via the token.
36
+
37
+ expires_in : typing.Optional[int]
38
+ The number of seconds the token will be valid for since the time of generation. The maximum is 1 hour (3600 seconds).
39
+
40
+ request_options : typing.Optional[RequestOptions]
41
+ Request-specific configuration.
42
+
43
+ Returns
44
+ -------
45
+ TokenResponse
46
+
47
+ Examples
48
+ --------
49
+ from cartesia import Cartesia
50
+
51
+ client = Cartesia(
52
+ api_key="YOUR_API_KEY",
53
+ )
54
+ client.auth.access_token(
55
+ grants={"tts": True},
56
+ expires_in=60,
57
+ )
58
+ """
59
+ _response = self._client_wrapper.httpx_client.request(
60
+ "access-token",
61
+ method="POST",
62
+ json={
63
+ "grants": convert_and_respect_annotation_metadata(
64
+ object_=grants, annotation=TokenGrantParams, direction="write"
65
+ ),
66
+ "expires_in": expires_in,
67
+ },
68
+ request_options=request_options,
69
+ omit=OMIT,
70
+ )
71
+ try:
72
+ if 200 <= _response.status_code < 300:
73
+ return typing.cast(
74
+ TokenResponse,
75
+ parse_obj_as(
76
+ type_=TokenResponse, # type: ignore
77
+ object_=_response.json(),
78
+ ),
79
+ )
80
+ _response_json = _response.json()
81
+ except JSONDecodeError:
82
+ raise ApiError(status_code=_response.status_code, body=_response.text)
83
+ raise ApiError(status_code=_response.status_code, body=_response_json)
84
+
85
+
86
+ class AsyncAuthClient:
87
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
88
+ self._client_wrapper = client_wrapper
89
+
90
+ async def access_token(
91
+ self,
92
+ *,
93
+ grants: TokenGrantParams,
94
+ expires_in: typing.Optional[int] = OMIT,
95
+ request_options: typing.Optional[RequestOptions] = None,
96
+ ) -> TokenResponse:
97
+ """
98
+ Generates a new Access Token for the client. These tokens are short-lived and should be used to make requests to the API from authenticated clients.
99
+
100
+ Parameters
101
+ ----------
102
+ grants : TokenGrantParams
103
+ The permissions to be granted via the token.
104
+
105
+ expires_in : typing.Optional[int]
106
+ The number of seconds the token will be valid for since the time of generation. The maximum is 1 hour (3600 seconds).
107
+
108
+ request_options : typing.Optional[RequestOptions]
109
+ Request-specific configuration.
110
+
111
+ Returns
112
+ -------
113
+ TokenResponse
114
+
115
+ Examples
116
+ --------
117
+ import asyncio
118
+
119
+ from cartesia import AsyncCartesia
120
+
121
+ client = AsyncCartesia(
122
+ api_key="YOUR_API_KEY",
123
+ )
124
+
125
+
126
+ async def main() -> None:
127
+ await client.auth.access_token(
128
+ grants={"tts": True},
129
+ expires_in=60,
130
+ )
131
+
132
+
133
+ asyncio.run(main())
134
+ """
135
+ _response = await self._client_wrapper.httpx_client.request(
136
+ "access-token",
137
+ method="POST",
138
+ json={
139
+ "grants": convert_and_respect_annotation_metadata(
140
+ object_=grants, annotation=TokenGrantParams, direction="write"
141
+ ),
142
+ "expires_in": expires_in,
143
+ },
144
+ request_options=request_options,
145
+ omit=OMIT,
146
+ )
147
+ try:
148
+ if 200 <= _response.status_code < 300:
149
+ return typing.cast(
150
+ TokenResponse,
151
+ parse_obj_as(
152
+ type_=TokenResponse, # type: ignore
153
+ object_=_response.json(),
154
+ ),
155
+ )
156
+ _response_json = _response.json()
157
+ except JSONDecodeError:
158
+ raise ApiError(status_code=_response.status_code, body=_response.text)
159
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .token_grant import TokenGrantParams
4
+ from .token_request import TokenRequestParams
5
+ from .token_response import TokenResponseParams
6
+
7
+ __all__ = ["TokenGrantParams", "TokenRequestParams", "TokenResponseParams"]
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+
5
+
6
+ class TokenGrantParams(typing_extensions.TypedDict):
7
+ tts: bool
8
+ """
9
+ The `tts` grant allows the token to be used to access any TTS endpoint.
10
+ """
@@ -0,0 +1,17 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+ from .token_grant import TokenGrantParams
5
+ import typing_extensions
6
+
7
+
8
+ class TokenRequestParams(typing_extensions.TypedDict):
9
+ grants: TokenGrantParams
10
+ """
11
+ The permissions to be granted via the token.
12
+ """
13
+
14
+ expires_in: typing_extensions.NotRequired[int]
15
+ """
16
+ The number of seconds the token will be valid for since the time of generation. The maximum is 1 hour (3600 seconds).
17
+ """
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+
5
+
6
+ class TokenResponseParams(typing_extensions.TypedDict):
7
+ token: str
8
+ """
9
+ The generated Access Token.
10
+ """
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .token_grant import TokenGrant
4
+ from .token_request import TokenRequest
5
+ from .token_response import TokenResponse
6
+
7
+ __all__ = ["TokenGrant", "TokenRequest", "TokenResponse"]
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.pydantic_utilities import UniversalBaseModel
4
+ import pydantic
5
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import typing
7
+
8
+
9
+ class TokenGrant(UniversalBaseModel):
10
+ tts: bool = pydantic.Field()
11
+ """
12
+ The `tts` grant allows the token to be used to access any TTS endpoint.
13
+ """
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,28 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.pydantic_utilities import UniversalBaseModel
4
+ from .token_grant import TokenGrant
5
+ import pydantic
6
+ import typing
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
8
+
9
+
10
+ class TokenRequest(UniversalBaseModel):
11
+ grants: TokenGrant = pydantic.Field()
12
+ """
13
+ The permissions to be granted via the token.
14
+ """
15
+
16
+ expires_in: typing.Optional[int] = pydantic.Field(default=None)
17
+ """
18
+ The number of seconds the token will be valid for since the time of generation. The maximum is 1 hour (3600 seconds).
19
+ """
20
+
21
+ if IS_PYDANTIC_V2:
22
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
23
+ else:
24
+
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ...core.pydantic_utilities import UniversalBaseModel
4
+ import pydantic
5
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import typing
7
+
8
+
9
+ class TokenResponse(UniversalBaseModel):
10
+ token: str = pydantic.Field()
11
+ """
12
+ The generated Access Token.
13
+ """
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -5,12 +5,14 @@ from .environment import CartesiaEnvironment
5
5
  import httpx
6
6
  from .core.client_wrapper import SyncClientWrapper
7
7
  from .api_status.client import ApiStatusClient
8
+ from .auth.client import AuthClient
8
9
  from .infill.client import InfillClient
9
10
  from .tts.client import TtsClient
10
11
  from .voice_changer.client import VoiceChangerClient
11
12
  from .voices.client import VoicesClient
12
13
  from .core.client_wrapper import AsyncClientWrapper
13
14
  from .api_status.client import AsyncApiStatusClient
15
+ from .auth.client import AsyncAuthClient
14
16
  from .infill.client import AsyncInfillClient
15
17
  from .tts.client import AsyncTtsClient
16
18
  from .voice_changer.client import AsyncVoiceChangerClient
@@ -76,6 +78,7 @@ class BaseCartesia:
76
78
  timeout=_defaulted_timeout,
77
79
  )
78
80
  self.api_status = ApiStatusClient(client_wrapper=self._client_wrapper)
81
+ self.auth = AuthClient(client_wrapper=self._client_wrapper)
79
82
  self.infill = InfillClient(client_wrapper=self._client_wrapper)
80
83
  self.tts = TtsClient(client_wrapper=self._client_wrapper)
81
84
  self.voice_changer = VoiceChangerClient(client_wrapper=self._client_wrapper)
@@ -141,6 +144,7 @@ class AsyncBaseCartesia:
141
144
  timeout=_defaulted_timeout,
142
145
  )
143
146
  self.api_status = AsyncApiStatusClient(client_wrapper=self._client_wrapper)
147
+ self.auth = AsyncAuthClient(client_wrapper=self._client_wrapper)
144
148
  self.infill = AsyncInfillClient(client_wrapper=self._client_wrapper)
145
149
  self.tts = AsyncTtsClient(client_wrapper=self._client_wrapper)
146
150
  self.voice_changer = AsyncVoiceChangerClient(client_wrapper=self._client_wrapper)
@@ -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.0b8",
19
+ "X-Fern-SDK-Version": "2.0.2",
20
20
  }
21
21
  headers["X-API-Key"] = self.api_key
22
22
  headers["Cartesia-Version"] = "2024-11-13"
@@ -71,6 +71,7 @@ class _AsyncTTSContext:
71
71
  add_phoneme_timestamps: bool = False,
72
72
  use_original_timestamps: bool = False,
73
73
  continue_: bool = False,
74
+ max_buffer_delay_ms: Optional[int] = None,
74
75
  flush: bool = False,
75
76
  ) -> None:
76
77
  """Send audio generation requests to the WebSocket. The response can be received using the `receive` method.
@@ -111,6 +112,8 @@ class _AsyncTTSContext:
111
112
  request_body["use_original_timestamps"] = use_original_timestamps
112
113
  if continue_:
113
114
  request_body["continue"] = continue_
115
+ if max_buffer_delay_ms:
116
+ request_body["max_buffer_delay_ms"] = max_buffer_delay_ms
114
117
  if flush:
115
118
  request_body["flush"] = flush
116
119
 
@@ -63,6 +63,7 @@ class _TTSContext:
63
63
  output_format: OutputFormatParams,
64
64
  voice: TtsRequestVoiceSpecifierParams,
65
65
  context_id: Optional[str] = None,
66
+ max_buffer_delay_ms: Optional[int] = None,
66
67
  duration: Optional[int] = None,
67
68
  language: Optional[str] = None,
68
69
  stream: bool = True,
@@ -108,6 +109,8 @@ class _TTSContext:
108
109
  request_body["add_phoneme_timestamps"] = add_phoneme_timestamps
109
110
  if use_original_timestamps:
110
111
  request_body["use_original_timestamps"] = use_original_timestamps
112
+ if max_buffer_delay_ms:
113
+ request_body["max_buffer_delay_ms"] = max_buffer_delay_ms
111
114
 
112
115
  if (
113
116
  "context_id" in request_body
@@ -32,13 +32,14 @@ class TtsClient:
32
32
  output_format: OutputFormatParams,
33
33
  language: typing.Optional[SupportedLanguage] = OMIT,
34
34
  duration: typing.Optional[float] = OMIT,
35
+ text_cfg: typing.Optional[float] = OMIT,
35
36
  request_options: typing.Optional[RequestOptions] = None,
36
37
  ) -> typing.Iterator[bytes]:
37
38
  """
38
39
  Parameters
39
40
  ----------
40
41
  model_id : str
41
- The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models.
42
+ The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
42
43
 
43
44
  transcript : str
44
45
 
@@ -52,6 +53,13 @@ class TtsClient:
52
53
  The maximum duration of the audio in seconds. You do not usually need to specify this.
53
54
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
54
55
 
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.
62
+
55
63
  request_options : typing.Optional[RequestOptions]
56
64
  Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
57
65
 
@@ -92,6 +100,7 @@ class TtsClient:
92
100
  object_=output_format, annotation=OutputFormatParams, direction="write"
93
101
  ),
94
102
  "duration": duration,
103
+ "text_cfg": text_cfg,
95
104
  },
96
105
  request_options=request_options,
97
106
  omit=OMIT,
@@ -117,13 +126,14 @@ class TtsClient:
117
126
  output_format: OutputFormatParams,
118
127
  language: typing.Optional[SupportedLanguage] = OMIT,
119
128
  duration: typing.Optional[float] = OMIT,
129
+ text_cfg: typing.Optional[float] = OMIT,
120
130
  request_options: typing.Optional[RequestOptions] = None,
121
131
  ) -> typing.Iterator[WebSocketResponse]:
122
132
  """
123
133
  Parameters
124
134
  ----------
125
135
  model_id : str
126
- The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models.
136
+ The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
127
137
 
128
138
  transcript : str
129
139
 
@@ -137,6 +147,13 @@ class TtsClient:
137
147
  The maximum duration of the audio in seconds. You do not usually need to specify this.
138
148
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
139
149
 
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.
156
+
140
157
  request_options : typing.Optional[RequestOptions]
141
158
  Request-specific configuration.
142
159
 
@@ -179,6 +196,7 @@ class TtsClient:
179
196
  object_=output_format, annotation=OutputFormatParams, direction="write"
180
197
  ),
181
198
  "duration": duration,
199
+ "text_cfg": text_cfg,
182
200
  },
183
201
  request_options=request_options,
184
202
  omit=OMIT,
@@ -218,13 +236,14 @@ class AsyncTtsClient:
218
236
  output_format: OutputFormatParams,
219
237
  language: typing.Optional[SupportedLanguage] = OMIT,
220
238
  duration: typing.Optional[float] = OMIT,
239
+ text_cfg: typing.Optional[float] = OMIT,
221
240
  request_options: typing.Optional[RequestOptions] = None,
222
241
  ) -> typing.AsyncIterator[bytes]:
223
242
  """
224
243
  Parameters
225
244
  ----------
226
245
  model_id : str
227
- The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models.
246
+ The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
228
247
 
229
248
  transcript : str
230
249
 
@@ -238,6 +257,13 @@ class AsyncTtsClient:
238
257
  The maximum duration of the audio in seconds. You do not usually need to specify this.
239
258
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
240
259
 
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.
266
+
241
267
  request_options : typing.Optional[RequestOptions]
242
268
  Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
243
269
 
@@ -286,6 +312,7 @@ class AsyncTtsClient:
286
312
  object_=output_format, annotation=OutputFormatParams, direction="write"
287
313
  ),
288
314
  "duration": duration,
315
+ "text_cfg": text_cfg,
289
316
  },
290
317
  request_options=request_options,
291
318
  omit=OMIT,
@@ -311,13 +338,14 @@ class AsyncTtsClient:
311
338
  output_format: OutputFormatParams,
312
339
  language: typing.Optional[SupportedLanguage] = OMIT,
313
340
  duration: typing.Optional[float] = OMIT,
341
+ text_cfg: typing.Optional[float] = OMIT,
314
342
  request_options: typing.Optional[RequestOptions] = None,
315
343
  ) -> typing.AsyncIterator[WebSocketResponse]:
316
344
  """
317
345
  Parameters
318
346
  ----------
319
347
  model_id : str
320
- The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models.
348
+ The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
321
349
 
322
350
  transcript : str
323
351
 
@@ -331,6 +359,13 @@ class AsyncTtsClient:
331
359
  The maximum duration of the audio in seconds. You do not usually need to specify this.
332
360
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
333
361
 
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.
368
+
334
369
  request_options : typing.Optional[RequestOptions]
335
370
  Request-specific configuration.
336
371
 
@@ -381,6 +416,7 @@ class AsyncTtsClient:
381
416
  object_=output_format, annotation=OutputFormatParams, direction="write"
382
417
  ),
383
418
  "duration": duration,
419
+ "text_cfg": text_cfg,
384
420
  },
385
421
  request_options=request_options,
386
422
  omit=OMIT,
@@ -13,7 +13,7 @@ from ...core.serialization import FieldMetadata
13
13
  class GenerationRequestParams(typing_extensions.TypedDict):
14
14
  model_id: str
15
15
  """
16
- The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models.
16
+ The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
17
17
  """
18
18
 
19
19
  transcript: typing.Optional[typing.Any]
@@ -30,6 +30,15 @@ class GenerationRequestParams(typing_extensions.TypedDict):
30
30
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
31
31
  """
32
32
 
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
+
33
42
  context_id: typing_extensions.NotRequired[ContextId]
34
43
  continue_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="continue")]]
35
44
  """
@@ -37,6 +46,15 @@ class GenerationRequestParams(typing_extensions.TypedDict):
37
46
  If not specified, this defaults to `false`.
38
47
  """
39
48
 
49
+ max_buffer_delay_ms: typing_extensions.NotRequired[int]
50
+ """
51
+ The maximum time in milliseconds to buffer text before starting generation. Values between [0, 1000]ms are supported. Defaults to 0 (no buffering).
52
+
53
+ When set, the model will buffer incoming text chunks until it's confident it has enough context to generate high-quality speech, or the buffer delay elapses, whichever comes first. Without this option set, the model will kick off generations immediately, ceding control of buffering to the user.
54
+
55
+ Use this to balance responsiveness with higher quality speech generation, which often benefits from having more context.
56
+ """
57
+
40
58
  flush: typing_extensions.NotRequired[bool]
41
59
  """
42
60
  Whether to flush the context.
@@ -10,7 +10,7 @@ from .output_format import OutputFormatParams
10
10
  class TtsRequestParams(typing_extensions.TypedDict):
11
11
  model_id: str
12
12
  """
13
- The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models.
13
+ The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
14
14
  """
15
15
 
16
16
  transcript: str
@@ -22,3 +22,12 @@ class TtsRequestParams(typing_extensions.TypedDict):
22
22
  The maximum duration of the audio in seconds. You do not usually need to specify this.
23
23
  If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
24
24
  """
25
+
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
+ """
@@ -10,7 +10,7 @@ from ...core.serialization import FieldMetadata
10
10
  class WebSocketTtsRequestParams(typing_extensions.TypedDict):
11
11
  model_id: str
12
12
  """
13
- The ID of the model to use for the generation. See [Models](/build-with-sonic/models) for available models.
13
+ The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
14
14
  """
15
15
 
16
16
  output_format: typing_extensions.NotRequired[OutputFormatParams]
@@ -23,3 +23,5 @@ class WebSocketTtsRequestParams(typing_extensions.TypedDict):
23
23
  add_phoneme_timestamps: typing_extensions.NotRequired[bool]
24
24
  continue_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="continue")]]
25
25
  context_id: typing_extensions.NotRequired[str]
26
+ max_buffer_delay_ms: typing_extensions.NotRequired[int]
27
+ text_cfg: typing_extensions.NotRequired[float]