Skip to content

Commit 4ddaf89

Browse files
committed
Add comprehensive type definitions for text-to-speech streaming and processing
1 parent b26aa0b commit 4ddaf89

8 files changed

+154
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from .body_text_to_speech_streaming_v_1_text_to_speech_voice_id_stream_post_apply_text_normalization import (
4+
BodyTextToSpeechStreamingV1TextToSpeechVoiceIdStreamPostApplyTextNormalization,
5+
)
6+
from .body_text_to_speech_streaming_with_timestamps_v_1_text_to_speech_voice_id_stream_with_timestamps_post_apply_text_normalization import (
7+
BodyTextToSpeechStreamingWithTimestampsV1TextToSpeechVoiceIdStreamWithTimestampsPostApplyTextNormalization,
8+
)
9+
from .body_text_to_speech_v_1_text_to_speech_voice_id_post_apply_text_normalization import (
10+
BodyTextToSpeechV1TextToSpeechVoiceIdPostApplyTextNormalization,
11+
)
12+
from .body_text_to_speech_with_timestamps_v_1_text_to_speech_voice_id_with_timestamps_post_apply_text_normalization import (
13+
BodyTextToSpeechWithTimestampsV1TextToSpeechVoiceIdWithTimestampsPostApplyTextNormalization,
14+
)
15+
from .text_to_speech_stream_with_timestamps_response import TextToSpeechStreamWithTimestampsResponse
16+
from .text_to_speech_stream_with_timestamps_response_alignment import TextToSpeechStreamWithTimestampsResponseAlignment
17+
from .text_to_speech_stream_with_timestamps_response_normalized_alignment import (
18+
TextToSpeechStreamWithTimestampsResponseNormalizedAlignment,
19+
)
20+
21+
__all__ = [
22+
"BodyTextToSpeechStreamingV1TextToSpeechVoiceIdStreamPostApplyTextNormalization",
23+
"BodyTextToSpeechStreamingWithTimestampsV1TextToSpeechVoiceIdStreamWithTimestampsPostApplyTextNormalization",
24+
"BodyTextToSpeechV1TextToSpeechVoiceIdPostApplyTextNormalization",
25+
"BodyTextToSpeechWithTimestampsV1TextToSpeechVoiceIdWithTimestampsPostApplyTextNormalization",
26+
"TextToSpeechStreamWithTimestampsResponse",
27+
"TextToSpeechStreamWithTimestampsResponseAlignment",
28+
"TextToSpeechStreamWithTimestampsResponseNormalizedAlignment",
29+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
BodyTextToSpeechStreamingV1TextToSpeechVoiceIdStreamPostApplyTextNormalization = typing.Union[
6+
typing.Literal["auto", "on", "off"], typing.Any
7+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
BodyTextToSpeechStreamingWithTimestampsV1TextToSpeechVoiceIdStreamWithTimestampsPostApplyTextNormalization = (
6+
typing.Union[typing.Literal["auto", "on", "off"], typing.Any]
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
BodyTextToSpeechV1TextToSpeechVoiceIdPostApplyTextNormalization = typing.Union[
6+
typing.Literal["auto", "on", "off"], typing.Any
7+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
BodyTextToSpeechWithTimestampsV1TextToSpeechVoiceIdWithTimestampsPostApplyTextNormalization = typing.Union[
6+
typing.Literal["auto", "on", "off"], typing.Any
7+
]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from ...core.unchecked_base_model import UncheckedBaseModel
4+
import typing_extensions
5+
import typing
6+
from ...core.serialization import FieldMetadata
7+
import pydantic
8+
from .text_to_speech_stream_with_timestamps_response_alignment import TextToSpeechStreamWithTimestampsResponseAlignment
9+
from .text_to_speech_stream_with_timestamps_response_normalized_alignment import (
10+
TextToSpeechStreamWithTimestampsResponseNormalizedAlignment,
11+
)
12+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
13+
14+
15+
class TextToSpeechStreamWithTimestampsResponse(UncheckedBaseModel):
16+
audio_base_64: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="audio_base64")] = (
17+
pydantic.Field(default=None)
18+
)
19+
"""
20+
Base64 encoded audio chunk
21+
"""
22+
23+
alignment: typing.Optional[TextToSpeechStreamWithTimestampsResponseAlignment] = None
24+
normalized_alignment: typing.Optional[TextToSpeechStreamWithTimestampsResponseNormalizedAlignment] = None
25+
26+
if IS_PYDANTIC_V2:
27+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
28+
else:
29+
30+
class Config:
31+
frozen = True
32+
smart_union = True
33+
extra = pydantic.Extra.allow
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from ...core.unchecked_base_model import UncheckedBaseModel
4+
import typing
5+
import pydantic
6+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
7+
8+
9+
class TextToSpeechStreamWithTimestampsResponseAlignment(UncheckedBaseModel):
10+
characters: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
11+
"""
12+
Array of individual characters from the input text
13+
"""
14+
15+
character_start_times_seconds: typing.Optional[typing.List[float]] = pydantic.Field(default=None)
16+
"""
17+
Array of start times (in seconds) for each character
18+
"""
19+
20+
character_end_times_seconds: typing.Optional[typing.List[float]] = pydantic.Field(default=None)
21+
"""
22+
Array of end times (in seconds) for each character
23+
"""
24+
25+
if IS_PYDANTIC_V2:
26+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
27+
else:
28+
29+
class Config:
30+
frozen = True
31+
smart_union = True
32+
extra = pydantic.Extra.allow
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from ...core.unchecked_base_model import UncheckedBaseModel
4+
import typing
5+
import pydantic
6+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
7+
8+
9+
class TextToSpeechStreamWithTimestampsResponseNormalizedAlignment(UncheckedBaseModel):
10+
characters: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
11+
"""
12+
Array of individual characters from the normalized text
13+
"""
14+
15+
character_start_times_seconds: typing.Optional[typing.List[float]] = pydantic.Field(default=None)
16+
"""
17+
Array of start times (in seconds) for each normalized character
18+
"""
19+
20+
character_end_times_seconds: typing.Optional[typing.List[float]] = pydantic.Field(default=None)
21+
"""
22+
Array of end times (in seconds) for each normalized character
23+
"""
24+
25+
if IS_PYDANTIC_V2:
26+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
27+
else:
28+
29+
class Config:
30+
frozen = True
31+
smart_union = True
32+
extra = pydantic.Extra.allow

0 commit comments

Comments
 (0)