Skip to content

Commit 2855124

Browse files
Release 2.0.16
1 parent 51c30c6 commit 2855124

File tree

12 files changed

+74
-2
lines changed

12 files changed

+74
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "cartesia"
33

44
[tool.poetry]
55
name = "cartesia"
6-
version = "2.0.15"
6+
version = "2.0.16"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,14 @@ If the duration is not appropriate for the length of the transcript, the output
675675
<dl>
676676
<dd>
677677

678+
**pronunciation_dict_id:** `typing.Optional[str]` — A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
679+
680+
</dd>
681+
</dl>
682+
683+
<dl>
684+
<dd>
685+
678686
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
679687

680688
</dd>
@@ -833,6 +841,14 @@ If the duration is not appropriate for the length of the transcript, the output
833841
<dl>
834842
<dd>
835843

844+
**pronunciation_dict_id:** `typing.Optional[str]` — A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
845+
846+
</dd>
847+
</dl>
848+
849+
<dl>
850+
<dd>
851+
836852
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
837853

838854
</dd>

src/cartesia/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "cartesia",
19-
"X-Fern-SDK-Version": "2.0.15",
19+
"X-Fern-SDK-Version": "2.0.16",
2020
}
2121
headers["X-API-Key"] = self.api_key
2222
headers["Cartesia-Version"] = "2024-11-13"

src/cartesia/tts/client.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def bytes(
3838
generation_config: typing.Optional[GenerationConfigParams] = OMIT,
3939
duration: typing.Optional[float] = OMIT,
4040
speed: typing.Optional[ModelSpeed] = OMIT,
41+
pronunciation_dict_id: typing.Optional[str] = OMIT,
4142
request_options: typing.Optional[RequestOptions] = None,
4243
) -> typing.Iterator[bytes]:
4344
"""
@@ -62,6 +63,9 @@ def bytes(
6263
6364
speed : typing.Optional[ModelSpeed]
6465
66+
pronunciation_dict_id : typing.Optional[str]
67+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
68+
6569
request_options : typing.Optional[RequestOptions]
6670
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
6771
@@ -106,6 +110,7 @@ def bytes(
106110
),
107111
"duration": duration,
108112
"speed": speed,
113+
"pronunciation_dict_id": pronunciation_dict_id,
109114
},
110115
request_options=request_options,
111116
omit=OMIT,
@@ -137,6 +142,7 @@ def sse(
137142
add_phoneme_timestamps: typing.Optional[bool] = OMIT,
138143
use_normalized_timestamps: typing.Optional[bool] = OMIT,
139144
context_id: typing.Optional[ContextId] = OMIT,
145+
pronunciation_dict_id: typing.Optional[str] = OMIT,
140146
request_options: typing.Optional[RequestOptions] = None,
141147
) -> typing.Iterator[WebSocketResponse]:
142148
"""
@@ -173,6 +179,9 @@ def sse(
173179
context_id : typing.Optional[ContextId]
174180
Optional context ID for this request.
175181
182+
pronunciation_dict_id : typing.Optional[str]
183+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
184+
176185
request_options : typing.Optional[RequestOptions]
177186
Request-specific configuration.
178187
@@ -223,6 +232,7 @@ def sse(
223232
"add_phoneme_timestamps": add_phoneme_timestamps,
224233
"use_normalized_timestamps": use_normalized_timestamps,
225234
"context_id": context_id,
235+
"pronunciation_dict_id": pronunciation_dict_id,
226236
},
227237
request_options=request_options,
228238
omit=OMIT,
@@ -264,6 +274,7 @@ async def bytes(
264274
generation_config: typing.Optional[GenerationConfigParams] = OMIT,
265275
duration: typing.Optional[float] = OMIT,
266276
speed: typing.Optional[ModelSpeed] = OMIT,
277+
pronunciation_dict_id: typing.Optional[str] = OMIT,
267278
request_options: typing.Optional[RequestOptions] = None,
268279
) -> typing.AsyncIterator[bytes]:
269280
"""
@@ -288,6 +299,9 @@ async def bytes(
288299
289300
speed : typing.Optional[ModelSpeed]
290301
302+
pronunciation_dict_id : typing.Optional[str]
303+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
304+
291305
request_options : typing.Optional[RequestOptions]
292306
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
293307
@@ -340,6 +354,7 @@ async def main() -> None:
340354
),
341355
"duration": duration,
342356
"speed": speed,
357+
"pronunciation_dict_id": pronunciation_dict_id,
343358
},
344359
request_options=request_options,
345360
omit=OMIT,
@@ -371,6 +386,7 @@ async def sse(
371386
add_phoneme_timestamps: typing.Optional[bool] = OMIT,
372387
use_normalized_timestamps: typing.Optional[bool] = OMIT,
373388
context_id: typing.Optional[ContextId] = OMIT,
389+
pronunciation_dict_id: typing.Optional[str] = OMIT,
374390
request_options: typing.Optional[RequestOptions] = None,
375391
) -> typing.AsyncIterator[WebSocketResponse]:
376392
"""
@@ -407,6 +423,9 @@ async def sse(
407423
context_id : typing.Optional[ContextId]
408424
Optional context ID for this request.
409425
426+
pronunciation_dict_id : typing.Optional[str]
427+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
428+
410429
request_options : typing.Optional[RequestOptions]
411430
Request-specific configuration.
412431
@@ -465,6 +484,7 @@ async def main() -> None:
465484
"add_phoneme_timestamps": add_phoneme_timestamps,
466485
"use_normalized_timestamps": use_normalized_timestamps,
467486
"context_id": context_id,
487+
"pronunciation_dict_id": pronunciation_dict_id,
468488
},
469489
request_options=request_options,
470490
omit=OMIT,

src/cartesia/tts/requests/generation_request.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,8 @@ class GenerationRequestParams(typing_extensions.TypedDict):
6969
"""
7070
Whether to use normalized timestamps (True) or original timestamps (False).
7171
"""
72+
73+
pronunciation_dict_id: typing_extensions.NotRequired[str]
74+
"""
75+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
76+
"""

src/cartesia/tts/requests/tts_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ class TtsRequestParams(typing_extensions.TypedDict):
2727
"""
2828

2929
speed: typing_extensions.NotRequired[ModelSpeed]
30+
pronunciation_dict_id: typing_extensions.NotRequired[str]
31+
"""
32+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
33+
"""

src/cartesia/tts/requests/ttssse_request.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,8 @@ class TtssseRequestParams(typing_extensions.TypedDict):
4747
"""
4848
Optional context ID for this request.
4949
"""
50+
51+
pronunciation_dict_id: typing_extensions.NotRequired[str]
52+
"""
53+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
54+
"""

src/cartesia/tts/requests/web_socket_tts_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ class WebSocketTtsRequestParams(typing_extensions.TypedDict):
3636
context_id: typing_extensions.NotRequired[str]
3737
max_buffer_delay_ms: typing_extensions.NotRequired[int]
3838
speed: typing_extensions.NotRequired[ModelSpeed]
39+
pronunciation_dict_id: typing_extensions.NotRequired[str]
40+
"""
41+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
42+
"""

src/cartesia/tts/types/generation_request.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ class GenerationRequest(UniversalBaseModel):
7474
Whether to use normalized timestamps (True) or original timestamps (False).
7575
"""
7676

77+
pronunciation_dict_id: typing.Optional[str] = pydantic.Field(default=None)
78+
"""
79+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
80+
"""
81+
7782
if IS_PYDANTIC_V2:
7883
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
7984
else:

src/cartesia/tts/types/tts_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class TtsRequest(UniversalBaseModel):
2929
"""
3030

3131
speed: typing.Optional[ModelSpeed] = None
32+
pronunciation_dict_id: typing.Optional[str] = pydantic.Field(default=None)
33+
"""
34+
A pronunciation dict ID to use for the generation. This will be applied to this TTS generation only.
35+
"""
3236

3337
if IS_PYDANTIC_V2:
3438
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

0 commit comments

Comments
 (0)