speechify-api 0.0.145__py3-none-any.whl
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.
- speechify_api-0.0.145.dist-info/METADATA +167 -0
- speechify_api-0.0.145.dist-info/RECORD +73 -0
- speechify_api-0.0.145.dist-info/WHEEL +4 -0
- speechifyinc/__init__.py +17 -0
- speechifyinc/api/__init__.py +5 -0
- speechifyinc/api/types/__init__.py +5 -0
- speechifyinc/api/types/audio_stream_request_accept.py +5 -0
- speechifyinc/client.py +150 -0
- speechifyinc/core/__init__.py +47 -0
- speechifyinc/core/api_error.py +15 -0
- speechifyinc/core/client_wrapper.py +76 -0
- speechifyinc/core/datetime_utils.py +28 -0
- speechifyinc/core/file.py +67 -0
- speechifyinc/core/http_client.py +499 -0
- speechifyinc/core/jsonable_encoder.py +101 -0
- speechifyinc/core/pydantic_utilities.py +296 -0
- speechifyinc/core/query_encoder.py +58 -0
- speechifyinc/core/remove_none_from_dict.py +11 -0
- speechifyinc/core/request_options.py +35 -0
- speechifyinc/core/serialization.py +272 -0
- speechifyinc/environment.py +7 -0
- speechifyinc/py.typed +0 -0
- speechifyinc/tts/__init__.py +78 -0
- speechifyinc/tts/audio/__init__.py +5 -0
- speechifyinc/tts/audio/client.py +544 -0
- speechifyinc/tts/audio/types/__init__.py +8 -0
- speechifyinc/tts/audio/types/audio_stream_request_accept.py +5 -0
- speechifyinc/tts/audio/types/get_speech_request_audio_format.py +5 -0
- speechifyinc/tts/audio/types/get_speech_request_model.py +7 -0
- speechifyinc/tts/audio/types/get_stream_request_model.py +7 -0
- speechifyinc/tts/auth/__init__.py +5 -0
- speechifyinc/tts/auth/client.py +171 -0
- speechifyinc/tts/auth/types/__init__.py +5 -0
- speechifyinc/tts/auth/types/create_access_token_request_scope.py +10 -0
- speechifyinc/tts/client.py +26 -0
- speechifyinc/tts/errors/__init__.py +9 -0
- speechifyinc/tts/errors/bad_request_error.py +9 -0
- speechifyinc/tts/errors/forbidden_error.py +9 -0
- speechifyinc/tts/errors/internal_server_error.py +9 -0
- speechifyinc/tts/errors/not_found_error.py +9 -0
- speechifyinc/tts/errors/payment_required_error.py +9 -0
- speechifyinc/tts/types/__init__.py +57 -0
- speechifyinc/tts/types/access_token.py +34 -0
- speechifyinc/tts/types/access_token_scope.py +10 -0
- speechifyinc/tts/types/api_key.py +47 -0
- speechifyinc/tts/types/create_voice_language.py +20 -0
- speechifyinc/tts/types/create_voice_model.py +22 -0
- speechifyinc/tts/types/create_voice_model_name.py +7 -0
- speechifyinc/tts/types/created_voice.py +28 -0
- speechifyinc/tts/types/created_voice_gender.py +5 -0
- speechifyinc/tts/types/created_voice_type.py +5 -0
- speechifyinc/tts/types/experimental_stream_request.py +49 -0
- speechifyinc/tts/types/experimental_stream_request_model.py +7 -0
- speechifyinc/tts/types/experimental_stream_response.py +33 -0
- speechifyinc/tts/types/get_speech_options_request.py +32 -0
- speechifyinc/tts/types/get_speech_response.py +36 -0
- speechifyinc/tts/types/get_speech_response_audio_format.py +5 -0
- speechifyinc/tts/types/get_stream_options_request.py +32 -0
- speechifyinc/tts/types/get_voice.py +30 -0
- speechifyinc/tts/types/get_voice_gender.py +5 -0
- speechifyinc/tts/types/get_voice_language.py +20 -0
- speechifyinc/tts/types/get_voice_type.py +5 -0
- speechifyinc/tts/types/get_voices_model.py +22 -0
- speechifyinc/tts/types/get_voices_model_name.py +7 -0
- speechifyinc/tts/types/nested_chunk.py +28 -0
- speechifyinc/tts/types/o_auth_error.py +21 -0
- speechifyinc/tts/types/o_auth_error_error.py +10 -0
- speechifyinc/tts/types/speech_marks.py +34 -0
- speechifyinc/tts/voices/__init__.py +5 -0
- speechifyinc/tts/voices/client.py +559 -0
- speechifyinc/tts/voices/types/__init__.py +5 -0
- speechifyinc/tts/voices/types/voices_create_request_gender.py +5 -0
- speechifyinc/version.py +3 -0
|
@@ -0,0 +1,171 @@
|
|
|
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 .types.create_access_token_request_scope import CreateAccessTokenRequestScope
|
|
6
|
+
from ...core.request_options import RequestOptions
|
|
7
|
+
from ..types.access_token import AccessToken
|
|
8
|
+
from ...core.pydantic_utilities import parse_obj_as
|
|
9
|
+
from ..errors.bad_request_error import BadRequestError
|
|
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 create_access_token(
|
|
23
|
+
self,
|
|
24
|
+
*,
|
|
25
|
+
scope: typing.Optional[CreateAccessTokenRequestScope] = OMIT,
|
|
26
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
27
|
+
) -> AccessToken:
|
|
28
|
+
"""
|
|
29
|
+
Create a new API token for the logged in user
|
|
30
|
+
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
scope : typing.Optional[CreateAccessTokenRequestScope]
|
|
34
|
+
The scope, or a space-delimited list of scopes the token is requested for
|
|
35
|
+
in: body
|
|
36
|
+
|
|
37
|
+
request_options : typing.Optional[RequestOptions]
|
|
38
|
+
Request-specific configuration.
|
|
39
|
+
|
|
40
|
+
Returns
|
|
41
|
+
-------
|
|
42
|
+
AccessToken
|
|
43
|
+
Contains the details of the token which can be used by the user to access the API
|
|
44
|
+
|
|
45
|
+
Examples
|
|
46
|
+
--------
|
|
47
|
+
from speechifyinc import Speechify
|
|
48
|
+
|
|
49
|
+
client = Speechify(
|
|
50
|
+
token="YOUR_TOKEN",
|
|
51
|
+
)
|
|
52
|
+
client.tts.auth.create_access_token()
|
|
53
|
+
"""
|
|
54
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
55
|
+
"v1/auth/token",
|
|
56
|
+
method="POST",
|
|
57
|
+
json={
|
|
58
|
+
"scope": scope,
|
|
59
|
+
"grant_type": "client_credentials",
|
|
60
|
+
},
|
|
61
|
+
headers={
|
|
62
|
+
"content-type": "application/json",
|
|
63
|
+
},
|
|
64
|
+
request_options=request_options,
|
|
65
|
+
omit=OMIT,
|
|
66
|
+
)
|
|
67
|
+
try:
|
|
68
|
+
if 200 <= _response.status_code < 300:
|
|
69
|
+
return typing.cast(
|
|
70
|
+
AccessToken,
|
|
71
|
+
parse_obj_as(
|
|
72
|
+
type_=AccessToken, # type: ignore
|
|
73
|
+
object_=_response.json(),
|
|
74
|
+
),
|
|
75
|
+
)
|
|
76
|
+
if _response.status_code == 400:
|
|
77
|
+
raise BadRequestError(
|
|
78
|
+
typing.cast(
|
|
79
|
+
typing.Optional[typing.Any],
|
|
80
|
+
parse_obj_as(
|
|
81
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
82
|
+
object_=_response.json(),
|
|
83
|
+
),
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
_response_json = _response.json()
|
|
87
|
+
except JSONDecodeError:
|
|
88
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
89
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class AsyncAuthClient:
|
|
93
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
94
|
+
self._client_wrapper = client_wrapper
|
|
95
|
+
|
|
96
|
+
async def create_access_token(
|
|
97
|
+
self,
|
|
98
|
+
*,
|
|
99
|
+
scope: typing.Optional[CreateAccessTokenRequestScope] = OMIT,
|
|
100
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
101
|
+
) -> AccessToken:
|
|
102
|
+
"""
|
|
103
|
+
Create a new API token for the logged in user
|
|
104
|
+
|
|
105
|
+
Parameters
|
|
106
|
+
----------
|
|
107
|
+
scope : typing.Optional[CreateAccessTokenRequestScope]
|
|
108
|
+
The scope, or a space-delimited list of scopes the token is requested for
|
|
109
|
+
in: body
|
|
110
|
+
|
|
111
|
+
request_options : typing.Optional[RequestOptions]
|
|
112
|
+
Request-specific configuration.
|
|
113
|
+
|
|
114
|
+
Returns
|
|
115
|
+
-------
|
|
116
|
+
AccessToken
|
|
117
|
+
Contains the details of the token which can be used by the user to access the API
|
|
118
|
+
|
|
119
|
+
Examples
|
|
120
|
+
--------
|
|
121
|
+
import asyncio
|
|
122
|
+
|
|
123
|
+
from speechifyinc import AsyncSpeechify
|
|
124
|
+
|
|
125
|
+
client = AsyncSpeechify(
|
|
126
|
+
token="YOUR_TOKEN",
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
async def main() -> None:
|
|
131
|
+
await client.tts.auth.create_access_token()
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
asyncio.run(main())
|
|
135
|
+
"""
|
|
136
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
137
|
+
"v1/auth/token",
|
|
138
|
+
method="POST",
|
|
139
|
+
json={
|
|
140
|
+
"scope": scope,
|
|
141
|
+
"grant_type": "client_credentials",
|
|
142
|
+
},
|
|
143
|
+
headers={
|
|
144
|
+
"content-type": "application/json",
|
|
145
|
+
},
|
|
146
|
+
request_options=request_options,
|
|
147
|
+
omit=OMIT,
|
|
148
|
+
)
|
|
149
|
+
try:
|
|
150
|
+
if 200 <= _response.status_code < 300:
|
|
151
|
+
return typing.cast(
|
|
152
|
+
AccessToken,
|
|
153
|
+
parse_obj_as(
|
|
154
|
+
type_=AccessToken, # type: ignore
|
|
155
|
+
object_=_response.json(),
|
|
156
|
+
),
|
|
157
|
+
)
|
|
158
|
+
if _response.status_code == 400:
|
|
159
|
+
raise BadRequestError(
|
|
160
|
+
typing.cast(
|
|
161
|
+
typing.Optional[typing.Any],
|
|
162
|
+
parse_obj_as(
|
|
163
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
164
|
+
object_=_response.json(),
|
|
165
|
+
),
|
|
166
|
+
)
|
|
167
|
+
)
|
|
168
|
+
_response_json = _response.json()
|
|
169
|
+
except JSONDecodeError:
|
|
170
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
171
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
CreateAccessTokenRequestScope = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"audio:speech", "audio:stream", "audio:all", "voices:read", "voices:create", "voices:delete", "voices:all"
|
|
8
|
+
],
|
|
9
|
+
typing.Any,
|
|
10
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.client_wrapper import SyncClientWrapper
|
|
4
|
+
from .audio.client import AudioClient
|
|
5
|
+
from .auth.client import AuthClient
|
|
6
|
+
from .voices.client import VoicesClient
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper
|
|
8
|
+
from .audio.client import AsyncAudioClient
|
|
9
|
+
from .auth.client import AsyncAuthClient
|
|
10
|
+
from .voices.client import AsyncVoicesClient
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TtsClient:
|
|
14
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
15
|
+
self._client_wrapper = client_wrapper
|
|
16
|
+
self.audio = AudioClient(client_wrapper=self._client_wrapper)
|
|
17
|
+
self.auth = AuthClient(client_wrapper=self._client_wrapper)
|
|
18
|
+
self.voices = VoicesClient(client_wrapper=self._client_wrapper)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AsyncTtsClient:
|
|
22
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
23
|
+
self._client_wrapper = client_wrapper
|
|
24
|
+
self.audio = AsyncAudioClient(client_wrapper=self._client_wrapper)
|
|
25
|
+
self.auth = AsyncAuthClient(client_wrapper=self._client_wrapper)
|
|
26
|
+
self.voices = AsyncVoicesClient(client_wrapper=self._client_wrapper)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .bad_request_error import BadRequestError
|
|
4
|
+
from .forbidden_error import ForbiddenError
|
|
5
|
+
from .internal_server_error import InternalServerError
|
|
6
|
+
from .not_found_error import NotFoundError
|
|
7
|
+
from .payment_required_error import PaymentRequiredError
|
|
8
|
+
|
|
9
|
+
__all__ = ["BadRequestError", "ForbiddenError", "InternalServerError", "NotFoundError", "PaymentRequiredError"]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.api_error import ApiError
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BadRequestError(ApiError):
|
|
8
|
+
def __init__(self, body: typing.Optional[typing.Any]):
|
|
9
|
+
super().__init__(status_code=400, body=body)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.api_error import ApiError
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ForbiddenError(ApiError):
|
|
8
|
+
def __init__(self, body: typing.Optional[typing.Any]):
|
|
9
|
+
super().__init__(status_code=403, body=body)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.api_error import ApiError
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class InternalServerError(ApiError):
|
|
8
|
+
def __init__(self, body: typing.Optional[typing.Any]):
|
|
9
|
+
super().__init__(status_code=500, body=body)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.api_error import ApiError
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PaymentRequiredError(ApiError):
|
|
8
|
+
def __init__(self, body: typing.Optional[typing.Any]):
|
|
9
|
+
super().__init__(status_code=402, body=body)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .access_token import AccessToken
|
|
4
|
+
from .access_token_scope import AccessTokenScope
|
|
5
|
+
from .api_key import ApiKey
|
|
6
|
+
from .create_voice_language import CreateVoiceLanguage
|
|
7
|
+
from .create_voice_model import CreateVoiceModel
|
|
8
|
+
from .create_voice_model_name import CreateVoiceModelName
|
|
9
|
+
from .created_voice import CreatedVoice
|
|
10
|
+
from .created_voice_gender import CreatedVoiceGender
|
|
11
|
+
from .created_voice_type import CreatedVoiceType
|
|
12
|
+
from .experimental_stream_request import ExperimentalStreamRequest
|
|
13
|
+
from .experimental_stream_request_model import ExperimentalStreamRequestModel
|
|
14
|
+
from .experimental_stream_response import ExperimentalStreamResponse
|
|
15
|
+
from .get_speech_options_request import GetSpeechOptionsRequest
|
|
16
|
+
from .get_speech_response import GetSpeechResponse
|
|
17
|
+
from .get_speech_response_audio_format import GetSpeechResponseAudioFormat
|
|
18
|
+
from .get_stream_options_request import GetStreamOptionsRequest
|
|
19
|
+
from .get_voice import GetVoice
|
|
20
|
+
from .get_voice_gender import GetVoiceGender
|
|
21
|
+
from .get_voice_language import GetVoiceLanguage
|
|
22
|
+
from .get_voice_type import GetVoiceType
|
|
23
|
+
from .get_voices_model import GetVoicesModel
|
|
24
|
+
from .get_voices_model_name import GetVoicesModelName
|
|
25
|
+
from .nested_chunk import NestedChunk
|
|
26
|
+
from .o_auth_error import OAuthError
|
|
27
|
+
from .o_auth_error_error import OAuthErrorError
|
|
28
|
+
from .speech_marks import SpeechMarks
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
"AccessToken",
|
|
32
|
+
"AccessTokenScope",
|
|
33
|
+
"ApiKey",
|
|
34
|
+
"CreateVoiceLanguage",
|
|
35
|
+
"CreateVoiceModel",
|
|
36
|
+
"CreateVoiceModelName",
|
|
37
|
+
"CreatedVoice",
|
|
38
|
+
"CreatedVoiceGender",
|
|
39
|
+
"CreatedVoiceType",
|
|
40
|
+
"ExperimentalStreamRequest",
|
|
41
|
+
"ExperimentalStreamRequestModel",
|
|
42
|
+
"ExperimentalStreamResponse",
|
|
43
|
+
"GetSpeechOptionsRequest",
|
|
44
|
+
"GetSpeechResponse",
|
|
45
|
+
"GetSpeechResponseAudioFormat",
|
|
46
|
+
"GetStreamOptionsRequest",
|
|
47
|
+
"GetVoice",
|
|
48
|
+
"GetVoiceGender",
|
|
49
|
+
"GetVoiceLanguage",
|
|
50
|
+
"GetVoiceType",
|
|
51
|
+
"GetVoicesModel",
|
|
52
|
+
"GetVoicesModelName",
|
|
53
|
+
"NestedChunk",
|
|
54
|
+
"OAuthError",
|
|
55
|
+
"OAuthErrorError",
|
|
56
|
+
"SpeechMarks",
|
|
57
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
import pydantic
|
|
6
|
+
from .access_token_scope import AccessTokenScope
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AccessToken(UniversalBaseModel):
|
|
11
|
+
access_token: typing.Optional[str] = None
|
|
12
|
+
expires_in: typing.Optional[int] = pydantic.Field(default=None)
|
|
13
|
+
"""
|
|
14
|
+
Expiration time, in seconds from the issue time
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
scope: typing.Optional[AccessTokenScope] = pydantic.Field(default=None)
|
|
18
|
+
"""
|
|
19
|
+
The scope, or a space-delimited list of scopes the token is issued for
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
token_type: typing.Optional[typing.Literal["bearer"]] = pydantic.Field(default=None)
|
|
23
|
+
"""
|
|
24
|
+
Token type
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
if IS_PYDANTIC_V2:
|
|
28
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
29
|
+
else:
|
|
30
|
+
|
|
31
|
+
class Config:
|
|
32
|
+
frozen = True
|
|
33
|
+
smart_union = True
|
|
34
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
AccessTokenScope = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"audio:speech", "audio:stream", "audio:all", "voices:read", "voices:create", "voices:delete", "voices:all"
|
|
8
|
+
],
|
|
9
|
+
typing.Any,
|
|
10
|
+
]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ApiKey(UniversalBaseModel):
|
|
10
|
+
api_key: typing.Optional[str] = pydantic.Field(default=None)
|
|
11
|
+
"""
|
|
12
|
+
API key
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
created_at: typing.Optional[int] = pydantic.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
Creation time of the key
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
id: typing.Optional[int] = pydantic.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
ID of the key
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
name: typing.Optional[str] = pydantic.Field(default=None)
|
|
26
|
+
"""
|
|
27
|
+
Name of the key
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
updated_at: typing.Optional[int] = pydantic.Field(default=None)
|
|
31
|
+
"""
|
|
32
|
+
Last updated time of the key
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
user_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
36
|
+
"""
|
|
37
|
+
User ID to whom the key belongs
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
if IS_PYDANTIC_V2:
|
|
41
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
42
|
+
else:
|
|
43
|
+
|
|
44
|
+
class Config:
|
|
45
|
+
frozen = True
|
|
46
|
+
smart_union = True
|
|
47
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class CreateVoiceLanguage(UniversalBaseModel):
|
|
10
|
+
locale: typing.Optional[str] = None
|
|
11
|
+
preview_audio: typing.Optional[str] = None
|
|
12
|
+
|
|
13
|
+
if IS_PYDANTIC_V2:
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
15
|
+
else:
|
|
16
|
+
|
|
17
|
+
class Config:
|
|
18
|
+
frozen = True
|
|
19
|
+
smart_union = True
|
|
20
|
+
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 typing
|
|
5
|
+
from .create_voice_language import CreateVoiceLanguage
|
|
6
|
+
from .create_voice_model_name import CreateVoiceModelName
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
import pydantic
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CreateVoiceModel(UniversalBaseModel):
|
|
12
|
+
languages: typing.Optional[typing.List[CreateVoiceLanguage]] = None
|
|
13
|
+
name: typing.Optional[CreateVoiceModelName] = None
|
|
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
|
+
import typing
|
|
5
|
+
from .created_voice_gender import CreatedVoiceGender
|
|
6
|
+
from .create_voice_model import CreateVoiceModel
|
|
7
|
+
from .created_voice_type import CreatedVoiceType
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
|
+
import pydantic
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CreatedVoice(UniversalBaseModel):
|
|
13
|
+
avatar_image: typing.Optional[str] = None
|
|
14
|
+
display_name: typing.Optional[str] = None
|
|
15
|
+
gender: typing.Optional[CreatedVoiceGender] = None
|
|
16
|
+
locale: typing.Optional[str] = None
|
|
17
|
+
id: typing.Optional[str] = None
|
|
18
|
+
models: typing.Optional[typing.List[CreateVoiceModel]] = None
|
|
19
|
+
type: typing.Optional[CreatedVoiceType] = None
|
|
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,49 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import pydantic
|
|
5
|
+
import typing
|
|
6
|
+
from .experimental_stream_request_model import ExperimentalStreamRequestModel
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ExperimentalStreamRequest(UniversalBaseModel):
|
|
11
|
+
"""
|
|
12
|
+
ExperimentalStreamRequest is the wrapper for request parameters to the client
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
input: str = pydantic.Field()
|
|
16
|
+
"""
|
|
17
|
+
Plain text or SSML to be synthesized to speech.
|
|
18
|
+
Refer to https://docs.sws.speechify.com/docs/api-limits for the input size limits.
|
|
19
|
+
Emotion, Pitch and Speed Rate are configured in the ssml input, please refer to the ssml documentation for more information: https://docs.sws.speechify.com/docs/ssml#prosody
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
language: typing.Optional[str] = pydantic.Field(default=None)
|
|
23
|
+
"""
|
|
24
|
+
Language of the input. Follow the format of an ISO 639-1 language code and an ISO 3166-1 region code, separated by a hyphen, e.g. en-US.
|
|
25
|
+
Please refer to the list of the supported languages and recommendations regarding this parameter: https://docs.sws.speechify.com/docs/language-support.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
model: typing.Optional[ExperimentalStreamRequestModel] = pydantic.Field(default=None)
|
|
29
|
+
"""
|
|
30
|
+
Model used for audio synthesis
|
|
31
|
+
simba-base ModelBase ModelBase is deprecated. Use simba-english or simba-multilingual instead. @deprecated
|
|
32
|
+
simba-english ModelEnglish
|
|
33
|
+
simba-multilingual ModelMultilingual
|
|
34
|
+
simba-turbo ModelTurbo
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
voice_id: str = pydantic.Field()
|
|
38
|
+
"""
|
|
39
|
+
Id of the voice to be used for synthesizing speech. Refer to /v1/voices endpoint for available voices
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
if IS_PYDANTIC_V2:
|
|
43
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
44
|
+
else:
|
|
45
|
+
|
|
46
|
+
class Config:
|
|
47
|
+
frozen = True
|
|
48
|
+
smart_union = True
|
|
49
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ExperimentalStreamResponse(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
ExperimentalStreamResponse represents generated audio stream info
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
audio_url: typing.Optional[str] = pydantic.Field(default=None)
|
|
15
|
+
"""
|
|
16
|
+
URL to the synthesized audio file. It includes the expiration time and a signature in the query params.
|
|
17
|
+
The audio file will be available for download until the expiration time.
|
|
18
|
+
For the URL to work correctly, it must be used verbatim, with all the query parameters.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
expires: typing.Optional[str] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Expiry time of the audio file, in ISO-8601 format.
|
|
24
|
+
"""
|
|
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
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class GetSpeechOptionsRequest(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
GetSpeechOptionsRequest is the wrapper for request parameters to the client
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
loudness_normalization: typing.Optional[bool] = pydantic.Field(default=None)
|
|
15
|
+
"""
|
|
16
|
+
Determines whether to normalize the audio loudness to a standard level.
|
|
17
|
+
When enabled, loudness normalization aligns the audio output to the following standards:
|
|
18
|
+
Integrated loudness: -14 LUFS
|
|
19
|
+
True peak: -2 dBTP
|
|
20
|
+
Loudness range: 7 LU
|
|
21
|
+
If disabled, the audio loudness will match the original loudness of the selected voice, which may vary significantly and be either too quiet or too loud.
|
|
22
|
+
Enabling loudness normalization can increase latency due to additional processing required for audio level adjustments.
|
|
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
|