cartesia 2.0.0b8__tar.gz → 2.0.3__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.
- {cartesia-2.0.0b8 → cartesia-2.0.3}/PKG-INFO +1 -1
- {cartesia-2.0.0b8 → cartesia-2.0.3}/pyproject.toml +1 -1
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/__init__.py +11 -1
- cartesia-2.0.3/src/cartesia/auth/__init__.py +13 -0
- cartesia-2.0.3/src/cartesia/auth/client.py +159 -0
- cartesia-2.0.3/src/cartesia/auth/requests/__init__.py +7 -0
- cartesia-2.0.3/src/cartesia/auth/requests/token_grant.py +10 -0
- cartesia-2.0.3/src/cartesia/auth/requests/token_request.py +17 -0
- cartesia-2.0.3/src/cartesia/auth/requests/token_response.py +10 -0
- cartesia-2.0.3/src/cartesia/auth/types/__init__.py +7 -0
- cartesia-2.0.3/src/cartesia/auth/types/token_grant.py +22 -0
- cartesia-2.0.3/src/cartesia/auth/types/token_request.py +28 -0
- cartesia-2.0.3/src/cartesia/auth/types/token_response.py +22 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/base_client.py +4 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/client_wrapper.py +1 -1
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/__init__.py +2 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/_async_websocket.py +3 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/_websocket.py +3 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/client.py +21 -4
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/generation_request.py +12 -1
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/tts_request.py +4 -1
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_tts_request.py +4 -1
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/__init__.py +2 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/generation_request.py +12 -1
- cartesia-2.0.3/src/cartesia/tts/types/model_speed.py +5 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/tts_request.py +4 -1
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_tts_request.py +4 -1
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/client.py +19 -21
- {cartesia-2.0.0b8 → cartesia-2.0.3}/README.md +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/api_status/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/api_status/client.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/api_status/requests/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/api_status/requests/api_info.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/api_status/types/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/api_status/types/api_info.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/client.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/api_error.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/datetime_utils.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/file.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/http_client.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/jsonable_encoder.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/pagination.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/pydantic_utilities.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/query_encoder.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/remove_none_from_dict.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/request_options.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/core/serialization.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/requests/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/requests/create_dataset_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/requests/dataset.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/requests/dataset_file.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/requests/paginated_dataset_files.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/requests/paginated_datasets.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/types/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/types/create_dataset_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/types/dataset.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/types/dataset_file.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/types/file_purpose.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/types/paginated_dataset_files.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/datasets/types/paginated_datasets.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/embedding/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/embedding/types/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/embedding/types/embedding.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/environment.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/infill/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/infill/client.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/py.typed +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/cancel_context_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/controls.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/mp_3_output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/phoneme_timestamps.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/raw_output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/speed.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/tts_request_embedding_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/tts_request_id_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/tts_request_voice_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/wav_output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_base_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_chunk_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_done_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_error_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_flush_done_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_phoneme_timestamps_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_raw_output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_stream_options.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_timestamps_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/web_socket_tts_output.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/requests/word_timestamps.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/socket_client.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/cancel_context_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/context_id.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/controls.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/emotion.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/flush_id.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/mp_3_output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/natural_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/numerical_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/phoneme_timestamps.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/raw_encoding.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/raw_output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/speed.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/supported_language.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/tts_request_embedding_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/tts_request_id_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/tts_request_voice_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/wav_output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_base_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_chunk_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_done_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_error_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_flush_done_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_phoneme_timestamps_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_raw_output_format.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_stream_options.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_timestamps_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/web_socket_tts_output.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/types/word_timestamps.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/utils/constants.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/utils/tts.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/tts/utils/types.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/version.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voice_changer/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voice_changer/client.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voice_changer/requests/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voice_changer/requests/streaming_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voice_changer/types/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voice_changer/types/output_format_container.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voice_changer/types/streaming_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/create_voice_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/embedding_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/embedding_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/get_voices_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/id_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/localize_dialect.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/localize_voice_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/mix_voice_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/mix_voices_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/update_voice_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/voice.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/requests/voice_metadata.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/__init__.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/base_voice_id.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/clone_mode.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/create_voice_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/embedding_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/embedding_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/gender.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/gender_presentation.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/get_voices_response.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/id_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/localize_dialect.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/localize_english_dialect.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/localize_french_dialect.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/localize_portuguese_dialect.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/localize_spanish_dialect.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/localize_target_language.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/localize_voice_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/mix_voice_specifier.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/mix_voices_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/update_voice_request.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/voice.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/voice_expand_options.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/voice_id.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/voice_metadata.py +0 -0
- {cartesia-2.0.0b8 → cartesia-2.0.3}/src/cartesia/voices/types/weight.py +0 -0
@@ -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,
|
@@ -28,6 +29,7 @@ from .tts import (
|
|
28
29
|
FlushId,
|
29
30
|
GenerationRequest,
|
30
31
|
GenerationRequestParams,
|
32
|
+
ModelSpeed,
|
31
33
|
Mp3OutputFormat,
|
32
34
|
Mp3OutputFormatParams,
|
33
35
|
NaturalSpecifier,
|
@@ -200,6 +202,7 @@ __all__ = [
|
|
200
202
|
"MixVoiceSpecifierParams",
|
201
203
|
"MixVoicesRequest",
|
202
204
|
"MixVoicesRequestParams",
|
205
|
+
"ModelSpeed",
|
203
206
|
"Mp3OutputFormat",
|
204
207
|
"Mp3OutputFormatParams",
|
205
208
|
"NaturalSpecifier",
|
@@ -233,6 +236,12 @@ __all__ = [
|
|
233
236
|
"StreamingResponse_Error",
|
234
237
|
"StreamingResponse_ErrorParams",
|
235
238
|
"SupportedLanguage",
|
239
|
+
"TokenGrant",
|
240
|
+
"TokenGrantParams",
|
241
|
+
"TokenRequest",
|
242
|
+
"TokenRequestParams",
|
243
|
+
"TokenResponse",
|
244
|
+
"TokenResponseParams",
|
236
245
|
"TtsRequest",
|
237
246
|
"TtsRequestEmbeddingSpecifier",
|
238
247
|
"TtsRequestEmbeddingSpecifierParams",
|
@@ -294,6 +303,7 @@ __all__ = [
|
|
294
303
|
"WordTimestampsParams",
|
295
304
|
"__version__",
|
296
305
|
"api_status",
|
306
|
+
"auth",
|
297
307
|
"datasets",
|
298
308
|
"embedding",
|
299
309
|
"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,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,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.
|
19
|
+
"X-Fern-SDK-Version": "2.0.3",
|
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",
|
@@ -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
|
@@ -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,13 +33,14 @@ class TtsClient:
|
|
32
33
|
output_format: OutputFormatParams,
|
33
34
|
language: typing.Optional[SupportedLanguage] = OMIT,
|
34
35
|
duration: typing.Optional[float] = OMIT,
|
36
|
+
speed: typing.Optional[ModelSpeed] = OMIT,
|
35
37
|
request_options: typing.Optional[RequestOptions] = None,
|
36
38
|
) -> typing.Iterator[bytes]:
|
37
39
|
"""
|
38
40
|
Parameters
|
39
41
|
----------
|
40
42
|
model_id : str
|
41
|
-
The ID of the model to use for the generation. See [Models](/build-with-
|
43
|
+
The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
|
42
44
|
|
43
45
|
transcript : str
|
44
46
|
|
@@ -52,6 +54,8 @@ class TtsClient:
|
|
52
54
|
The maximum duration of the audio in seconds. You do not usually need to specify this.
|
53
55
|
If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
54
56
|
|
57
|
+
speed : typing.Optional[ModelSpeed]
|
58
|
+
|
55
59
|
request_options : typing.Optional[RequestOptions]
|
56
60
|
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
57
61
|
|
@@ -92,6 +96,7 @@ class TtsClient:
|
|
92
96
|
object_=output_format, annotation=OutputFormatParams, direction="write"
|
93
97
|
),
|
94
98
|
"duration": duration,
|
99
|
+
"speed": speed,
|
95
100
|
},
|
96
101
|
request_options=request_options,
|
97
102
|
omit=OMIT,
|
@@ -117,13 +122,14 @@ class TtsClient:
|
|
117
122
|
output_format: OutputFormatParams,
|
118
123
|
language: typing.Optional[SupportedLanguage] = OMIT,
|
119
124
|
duration: typing.Optional[float] = OMIT,
|
125
|
+
speed: typing.Optional[ModelSpeed] = OMIT,
|
120
126
|
request_options: typing.Optional[RequestOptions] = None,
|
121
127
|
) -> typing.Iterator[WebSocketResponse]:
|
122
128
|
"""
|
123
129
|
Parameters
|
124
130
|
----------
|
125
131
|
model_id : str
|
126
|
-
The ID of the model to use for the generation. See [Models](/build-with-
|
132
|
+
The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
|
127
133
|
|
128
134
|
transcript : str
|
129
135
|
|
@@ -137,6 +143,8 @@ class TtsClient:
|
|
137
143
|
The maximum duration of the audio in seconds. You do not usually need to specify this.
|
138
144
|
If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
139
145
|
|
146
|
+
speed : typing.Optional[ModelSpeed]
|
147
|
+
|
140
148
|
request_options : typing.Optional[RequestOptions]
|
141
149
|
Request-specific configuration.
|
142
150
|
|
@@ -179,6 +187,7 @@ class TtsClient:
|
|
179
187
|
object_=output_format, annotation=OutputFormatParams, direction="write"
|
180
188
|
),
|
181
189
|
"duration": duration,
|
190
|
+
"speed": speed,
|
182
191
|
},
|
183
192
|
request_options=request_options,
|
184
193
|
omit=OMIT,
|
@@ -218,13 +227,14 @@ class AsyncTtsClient:
|
|
218
227
|
output_format: OutputFormatParams,
|
219
228
|
language: typing.Optional[SupportedLanguage] = OMIT,
|
220
229
|
duration: typing.Optional[float] = OMIT,
|
230
|
+
speed: typing.Optional[ModelSpeed] = OMIT,
|
221
231
|
request_options: typing.Optional[RequestOptions] = None,
|
222
232
|
) -> typing.AsyncIterator[bytes]:
|
223
233
|
"""
|
224
234
|
Parameters
|
225
235
|
----------
|
226
236
|
model_id : str
|
227
|
-
The ID of the model to use for the generation. See [Models](/build-with-
|
237
|
+
The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
|
228
238
|
|
229
239
|
transcript : str
|
230
240
|
|
@@ -238,6 +248,8 @@ class AsyncTtsClient:
|
|
238
248
|
The maximum duration of the audio in seconds. You do not usually need to specify this.
|
239
249
|
If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
240
250
|
|
251
|
+
speed : typing.Optional[ModelSpeed]
|
252
|
+
|
241
253
|
request_options : typing.Optional[RequestOptions]
|
242
254
|
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
243
255
|
|
@@ -286,6 +298,7 @@ class AsyncTtsClient:
|
|
286
298
|
object_=output_format, annotation=OutputFormatParams, direction="write"
|
287
299
|
),
|
288
300
|
"duration": duration,
|
301
|
+
"speed": speed,
|
289
302
|
},
|
290
303
|
request_options=request_options,
|
291
304
|
omit=OMIT,
|
@@ -311,13 +324,14 @@ class AsyncTtsClient:
|
|
311
324
|
output_format: OutputFormatParams,
|
312
325
|
language: typing.Optional[SupportedLanguage] = OMIT,
|
313
326
|
duration: typing.Optional[float] = OMIT,
|
327
|
+
speed: typing.Optional[ModelSpeed] = OMIT,
|
314
328
|
request_options: typing.Optional[RequestOptions] = None,
|
315
329
|
) -> typing.AsyncIterator[WebSocketResponse]:
|
316
330
|
"""
|
317
331
|
Parameters
|
318
332
|
----------
|
319
333
|
model_id : str
|
320
|
-
The ID of the model to use for the generation. See [Models](/build-with-
|
334
|
+
The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
|
321
335
|
|
322
336
|
transcript : str
|
323
337
|
|
@@ -331,6 +345,8 @@ class AsyncTtsClient:
|
|
331
345
|
The maximum duration of the audio in seconds. You do not usually need to specify this.
|
332
346
|
If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
333
347
|
|
348
|
+
speed : typing.Optional[ModelSpeed]
|
349
|
+
|
334
350
|
request_options : typing.Optional[RequestOptions]
|
335
351
|
Request-specific configuration.
|
336
352
|
|
@@ -381,6 +397,7 @@ class AsyncTtsClient:
|
|
381
397
|
object_=output_format, annotation=OutputFormatParams, direction="write"
|
382
398
|
),
|
383
399
|
"duration": duration,
|
400
|
+
"speed": speed,
|
384
401
|
},
|
385
402
|
request_options=request_options,
|
386
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
|
|
@@ -13,7 +14,7 @@ from ...core.serialization import FieldMetadata
|
|
13
14
|
class GenerationRequestParams(typing_extensions.TypedDict):
|
14
15
|
model_id: str
|
15
16
|
"""
|
16
|
-
The ID of the model to use for the generation. See [Models](/build-with-
|
17
|
+
The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
|
17
18
|
"""
|
18
19
|
|
19
20
|
transcript: typing.Optional[typing.Any]
|
@@ -30,6 +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
|
|
34
|
+
speed: typing_extensions.NotRequired[ModelSpeed]
|
33
35
|
context_id: typing_extensions.NotRequired[ContextId]
|
34
36
|
continue_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="continue")]]
|
35
37
|
"""
|
@@ -37,6 +39,15 @@ class GenerationRequestParams(typing_extensions.TypedDict):
|
|
37
39
|
If not specified, this defaults to `false`.
|
38
40
|
"""
|
39
41
|
|
42
|
+
max_buffer_delay_ms: typing_extensions.NotRequired[int]
|
43
|
+
"""
|
44
|
+
The maximum time in milliseconds to buffer text before starting generation. Values between [0, 1000]ms are supported. Defaults to 0 (no buffering).
|
45
|
+
|
46
|
+
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.
|
47
|
+
|
48
|
+
Use this to balance responsiveness with higher quality speech generation, which often benefits from having more context.
|
49
|
+
"""
|
50
|
+
|
40
51
|
flush: typing_extensions.NotRequired[bool]
|
41
52
|
"""
|
42
53
|
Whether to flush the context.
|
@@ -5,12 +5,13 @@ 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):
|
11
12
|
model_id: str
|
12
13
|
"""
|
13
|
-
The ID of the model to use for the generation. See [Models](/build-with-
|
14
|
+
The ID of the model to use for the generation. See [Models](/build-with-cartesia/models) for available models.
|
14
15
|
"""
|
15
16
|
|
16
17
|
transcript: str
|
@@ -22,3 +23,5 @@ class TtsRequestParams(typing_extensions.TypedDict):
|
|
22
23
|
The maximum duration of the audio in seconds. You do not usually need to specify this.
|
23
24
|
If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
24
25
|
"""
|
26
|
+
|
27
|
+
speed: typing_extensions.NotRequired[ModelSpeed]
|