speechify-api 1.2.1__tar.gz → 1.2.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 (74) hide show
  1. {speechify_api-1.2.1 → speechify_api-1.2.2}/PKG-INFO +3 -3
  2. {speechify_api-1.2.1 → speechify_api-1.2.2}/README.md +2 -2
  3. {speechify_api-1.2.1 → speechify_api-1.2.2}/pyproject.toml +1 -1
  4. {speechify_api-1.2.1/src/speechify/tts/audio → speechify_api-1.2.2/src/speechify/api}/types/audio_stream_request_accept.py +1 -1
  5. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/client_wrapper.py +1 -1
  6. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/__init__.py +0 -6
  7. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/audio/client.py +41 -0
  8. {speechify_api-1.2.1/src/speechify/api → speechify_api-1.2.2/src/speechify/tts/audio}/types/audio_stream_request_accept.py +1 -1
  9. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/audio/types/get_speech_request_audio_format.py +1 -1
  10. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/auth/client.py +21 -0
  11. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/__init__.py +0 -6
  12. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_speech_response_audio_format.py +1 -1
  13. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/voices/client.py +61 -1
  14. speechify_api-1.2.1/src/speechify/tts/types/experimental_stream_request.py +0 -49
  15. speechify_api-1.2.1/src/speechify/tts/types/experimental_stream_request_model.py +0 -7
  16. speechify_api-1.2.1/src/speechify/tts/types/experimental_stream_response.py +0 -33
  17. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/__init__.py +0 -0
  18. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/api/__init__.py +0 -0
  19. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/api/types/__init__.py +0 -0
  20. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/client.py +0 -0
  21. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/__init__.py +0 -0
  22. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/api_error.py +0 -0
  23. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/datetime_utils.py +0 -0
  24. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/file.py +0 -0
  25. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/http_client.py +0 -0
  26. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/jsonable_encoder.py +0 -0
  27. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/pydantic_utilities.py +0 -0
  28. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/query_encoder.py +0 -0
  29. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/remove_none_from_dict.py +0 -0
  30. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/request_options.py +0 -0
  31. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/core/serialization.py +0 -0
  32. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/environment.py +0 -0
  33. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/py.typed +0 -0
  34. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/audio/__init__.py +0 -0
  35. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/audio/types/__init__.py +0 -0
  36. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/audio/types/get_speech_request_model.py +0 -0
  37. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/audio/types/get_stream_request_model.py +0 -0
  38. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/auth/__init__.py +0 -0
  39. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/auth/types/__init__.py +0 -0
  40. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/auth/types/create_access_token_request_scope.py +0 -0
  41. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/client.py +0 -0
  42. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/errors/__init__.py +0 -0
  43. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/errors/bad_request_error.py +0 -0
  44. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/errors/forbidden_error.py +0 -0
  45. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/errors/internal_server_error.py +0 -0
  46. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/errors/not_found_error.py +0 -0
  47. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/errors/payment_required_error.py +0 -0
  48. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/errors/unauthorized_error.py +0 -0
  49. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/access_token.py +0 -0
  50. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/access_token_scope.py +0 -0
  51. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/api_key.py +0 -0
  52. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/create_voice_language.py +0 -0
  53. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/create_voice_model.py +0 -0
  54. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/create_voice_model_name.py +0 -0
  55. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/created_voice.py +0 -0
  56. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/created_voice_gender.py +0 -0
  57. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/created_voice_type.py +0 -0
  58. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_speech_options_request.py +0 -0
  59. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_speech_response.py +0 -0
  60. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_stream_options_request.py +0 -0
  61. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_voice.py +0 -0
  62. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_voice_gender.py +0 -0
  63. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_voice_language.py +0 -0
  64. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_voice_type.py +0 -0
  65. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_voices_model.py +0 -0
  66. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/get_voices_model_name.py +0 -0
  67. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/nested_chunk.py +0 -0
  68. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/o_auth_error.py +0 -0
  69. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/o_auth_error_error.py +0 -0
  70. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/types/speech_marks.py +0 -0
  71. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/voices/__init__.py +0 -0
  72. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/voices/types/__init__.py +0 -0
  73. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/tts/voices/types/voices_create_request_gender.py +0 -0
  74. {speechify_api-1.2.1 → speechify_api-1.2.2}/src/speechify/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: speechify-api
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Official Speechify API SDK
5
5
  Keywords: speechify,ai,api,sdk,text-to-speech,tts
6
6
  Author: Speechify
@@ -32,7 +32,7 @@ Description-Content-Type: text/markdown
32
32
  [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fspeechifyinc%2Fspeechify-api-sdk-python)
33
33
  [![pypi](https://img.shields.io/pypi/v/speechify-api)](https://pypi.python.org/pypi/speechify-api)
34
34
 
35
- The Speechifyinc Python library provides convenient access to the Speechifyinc API from Python.
35
+ The Speechifyinc Python library provides convenient access to the Speechifyinc APIs from Python.
36
36
 
37
37
  ## Documentation
38
38
 
@@ -46,7 +46,7 @@ pip install speechify-api
46
46
 
47
47
  ## Reference
48
48
 
49
- A full reference for this library is available [here](./reference.md).
49
+ A full reference for this library is available [here](https://github.com/speechifyinc/speechify-api-sdk-python/blob/HEAD/./reference.md).
50
50
 
51
51
  ## Usage
52
52
 
@@ -3,7 +3,7 @@
3
3
  [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fspeechifyinc%2Fspeechify-api-sdk-python)
4
4
  [![pypi](https://img.shields.io/pypi/v/speechify-api)](https://pypi.python.org/pypi/speechify-api)
5
5
 
6
- The Speechifyinc Python library provides convenient access to the Speechifyinc API from Python.
6
+ The Speechifyinc Python library provides convenient access to the Speechifyinc APIs from Python.
7
7
 
8
8
  ## Documentation
9
9
 
@@ -17,7 +17,7 @@ pip install speechify-api
17
17
 
18
18
  ## Reference
19
19
 
20
- A full reference for this library is available [here](./reference.md).
20
+ A full reference for this library is available [here](https://github.com/speechifyinc/speechify-api-sdk-python/blob/HEAD/./reference.md).
21
21
 
22
22
  ## Usage
23
23
 
@@ -3,7 +3,7 @@ name = "speechify-api"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "speechify-api"
6
- version = "1.2.1"
6
+ version = "1.2.2"
7
7
  description = "Official Speechify API SDK"
8
8
  readme = "README.md"
9
9
  authors = [
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- AudioStreamRequestAccept = typing.Union[typing.Literal["audio/mpeg", "audio/ogg", "audio/aac"], typing.Any]
5
+ AudioStreamRequestAccept = typing.Union[typing.Literal["audio/mpeg", "audio/ogg", "audio/aac", "audio/pcm"], typing.Any]
@@ -22,7 +22,7 @@ class BaseClientWrapper:
22
22
  headers: typing.Dict[str, str] = {
23
23
  "X-Fern-Language": "Python",
24
24
  "X-Fern-SDK-Name": "speechify-api",
25
- "X-Fern-SDK-Version": "1.2.1",
25
+ "X-Fern-SDK-Version": "1.2.2",
26
26
  }
27
27
  headers["Authorization"] = f"Bearer {self._get_token()}"
28
28
  return headers
@@ -10,9 +10,6 @@ from .types import (
10
10
  CreatedVoice,
11
11
  CreatedVoiceGender,
12
12
  CreatedVoiceType,
13
- ExperimentalStreamRequest,
14
- ExperimentalStreamRequestModel,
15
- ExperimentalStreamResponse,
16
13
  GetSpeechOptionsRequest,
17
14
  GetSpeechResponse,
18
15
  GetSpeechResponseAudioFormat,
@@ -54,9 +51,6 @@ __all__ = [
54
51
  "CreatedVoice",
55
52
  "CreatedVoiceGender",
56
53
  "CreatedVoiceType",
57
- "ExperimentalStreamRequest",
58
- "ExperimentalStreamRequestModel",
59
- "ExperimentalStreamResponse",
60
54
  "ForbiddenError",
61
55
  "GetSpeechOptionsRequest",
62
56
  "GetSpeechRequestAudioFormat",
@@ -10,6 +10,7 @@ from ..types.get_speech_response import GetSpeechResponse
10
10
  from ...core.serialization import convert_and_respect_annotation_metadata
11
11
  from ...core.pydantic_utilities import parse_obj_as
12
12
  from ..errors.bad_request_error import BadRequestError
13
+ from ..errors.unauthorized_error import UnauthorizedError
13
14
  from ..errors.payment_required_error import PaymentRequiredError
14
15
  from ..errors.forbidden_error import ForbiddenError
15
16
  from ..errors.internal_server_error import InternalServerError
@@ -122,6 +123,16 @@ class AudioClient:
122
123
  ),
123
124
  )
124
125
  )
126
+ if _response.status_code == 401:
127
+ raise UnauthorizedError(
128
+ typing.cast(
129
+ typing.Optional[typing.Any],
130
+ parse_obj_as(
131
+ type_=typing.Optional[typing.Any], # type: ignore
132
+ object_=_response.json(),
133
+ ),
134
+ )
135
+ )
125
136
  if _response.status_code == 402:
126
137
  raise PaymentRequiredError(
127
138
  typing.cast(
@@ -236,6 +247,16 @@ class AudioClient:
236
247
  ),
237
248
  )
238
249
  )
250
+ if _response.status_code == 401:
251
+ raise UnauthorizedError(
252
+ typing.cast(
253
+ typing.Optional[typing.Any],
254
+ parse_obj_as(
255
+ type_=typing.Optional[typing.Any], # type: ignore
256
+ object_=_response.json(),
257
+ ),
258
+ )
259
+ )
239
260
  if _response.status_code == 402:
240
261
  raise PaymentRequiredError(
241
262
  typing.cast(
@@ -378,6 +399,16 @@ class AsyncAudioClient:
378
399
  ),
379
400
  )
380
401
  )
402
+ if _response.status_code == 401:
403
+ raise UnauthorizedError(
404
+ typing.cast(
405
+ typing.Optional[typing.Any],
406
+ parse_obj_as(
407
+ type_=typing.Optional[typing.Any], # type: ignore
408
+ object_=_response.json(),
409
+ ),
410
+ )
411
+ )
381
412
  if _response.status_code == 402:
382
413
  raise PaymentRequiredError(
383
414
  typing.cast(
@@ -492,6 +523,16 @@ class AsyncAudioClient:
492
523
  ),
493
524
  )
494
525
  )
526
+ if _response.status_code == 401:
527
+ raise UnauthorizedError(
528
+ typing.cast(
529
+ typing.Optional[typing.Any],
530
+ parse_obj_as(
531
+ type_=typing.Optional[typing.Any], # type: ignore
532
+ object_=_response.json(),
533
+ ),
534
+ )
535
+ )
495
536
  if _response.status_code == 402:
496
537
  raise PaymentRequiredError(
497
538
  typing.cast(
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- AudioStreamRequestAccept = typing.Union[typing.Literal["audio/mpeg", "audio/ogg", "audio/aac"], typing.Any]
5
+ AudioStreamRequestAccept = typing.Union[typing.Literal["audio/mpeg", "audio/ogg", "audio/aac", "audio/pcm"], typing.Any]
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- GetSpeechRequestAudioFormat = typing.Union[typing.Literal["wav", "mp3", "ogg", "aac"], typing.Any]
5
+ GetSpeechRequestAudioFormat = typing.Union[typing.Literal["wav", "mp3", "ogg", "aac", "pcm"], typing.Any]
@@ -7,6 +7,7 @@ from ...core.request_options import RequestOptions
7
7
  from ..types.access_token import AccessToken
8
8
  from ...core.pydantic_utilities import parse_obj_as
9
9
  from ..errors.bad_request_error import BadRequestError
10
+ from ..errors.unauthorized_error import UnauthorizedError
10
11
  from json.decoder import JSONDecodeError
11
12
  from ...core.api_error import ApiError
12
13
  from ...core.client_wrapper import AsyncClientWrapper
@@ -83,6 +84,16 @@ class AuthClient:
83
84
  ),
84
85
  )
85
86
  )
87
+ if _response.status_code == 401:
88
+ raise UnauthorizedError(
89
+ typing.cast(
90
+ typing.Optional[typing.Any],
91
+ parse_obj_as(
92
+ type_=typing.Optional[typing.Any], # type: ignore
93
+ object_=_response.json(),
94
+ ),
95
+ )
96
+ )
86
97
  _response_json = _response.json()
87
98
  except JSONDecodeError:
88
99
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -165,6 +176,16 @@ class AsyncAuthClient:
165
176
  ),
166
177
  )
167
178
  )
179
+ if _response.status_code == 401:
180
+ raise UnauthorizedError(
181
+ typing.cast(
182
+ typing.Optional[typing.Any],
183
+ parse_obj_as(
184
+ type_=typing.Optional[typing.Any], # type: ignore
185
+ object_=_response.json(),
186
+ ),
187
+ )
188
+ )
168
189
  _response_json = _response.json()
169
190
  except JSONDecodeError:
170
191
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -9,9 +9,6 @@ from .create_voice_model_name import CreateVoiceModelName
9
9
  from .created_voice import CreatedVoice
10
10
  from .created_voice_gender import CreatedVoiceGender
11
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
12
  from .get_speech_options_request import GetSpeechOptionsRequest
16
13
  from .get_speech_response import GetSpeechResponse
17
14
  from .get_speech_response_audio_format import GetSpeechResponseAudioFormat
@@ -37,9 +34,6 @@ __all__ = [
37
34
  "CreatedVoice",
38
35
  "CreatedVoiceGender",
39
36
  "CreatedVoiceType",
40
- "ExperimentalStreamRequest",
41
- "ExperimentalStreamRequestModel",
42
- "ExperimentalStreamResponse",
43
37
  "GetSpeechOptionsRequest",
44
38
  "GetSpeechResponse",
45
39
  "GetSpeechResponseAudioFormat",
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- GetSpeechResponseAudioFormat = typing.Union[typing.Literal["wav", "mp3", "ogg", "aac"], typing.Any]
5
+ GetSpeechResponseAudioFormat = typing.Union[typing.Literal["wav", "mp3", "ogg", "aac", "pcm"], typing.Any]
@@ -5,6 +5,7 @@ from ...core.client_wrapper import SyncClientWrapper
5
5
  from ...core.request_options import RequestOptions
6
6
  from ..types.get_voice import GetVoice
7
7
  from ...core.pydantic_utilities import parse_obj_as
8
+ from ..errors.unauthorized_error import UnauthorizedError
8
9
  from ..errors.not_found_error import NotFoundError
9
10
  from ..errors.internal_server_error import InternalServerError
10
11
  from json.decoder import JSONDecodeError
@@ -15,7 +16,6 @@ from ..types.created_voice import CreatedVoice
15
16
  from ..errors.bad_request_error import BadRequestError
16
17
  from ..errors.payment_required_error import PaymentRequiredError
17
18
  from ...core.jsonable_encoder import jsonable_encoder
18
- from ..errors.unauthorized_error import UnauthorizedError
19
19
  from ...core.client_wrapper import AsyncClientWrapper
20
20
 
21
21
  # this is used as the default value for optional parameters
@@ -63,6 +63,16 @@ class VoicesClient:
63
63
  object_=_response.json(),
64
64
  ),
65
65
  )
66
+ if _response.status_code == 401:
67
+ raise UnauthorizedError(
68
+ typing.cast(
69
+ typing.Optional[typing.Any],
70
+ parse_obj_as(
71
+ type_=typing.Optional[typing.Any], # type: ignore
72
+ object_=_response.json(),
73
+ ),
74
+ )
75
+ )
66
76
  if _response.status_code == 404:
67
77
  raise NotFoundError(
68
78
  typing.cast(
@@ -183,6 +193,16 @@ class VoicesClient:
183
193
  ),
184
194
  )
185
195
  )
196
+ if _response.status_code == 401:
197
+ raise UnauthorizedError(
198
+ typing.cast(
199
+ typing.Optional[typing.Any],
200
+ parse_obj_as(
201
+ type_=typing.Optional[typing.Any], # type: ignore
202
+ object_=_response.json(),
203
+ ),
204
+ )
205
+ )
186
206
  if _response.status_code == 402:
187
207
  raise PaymentRequiredError(
188
208
  typing.cast(
@@ -253,6 +273,16 @@ class VoicesClient:
253
273
  ),
254
274
  )
255
275
  )
276
+ if _response.status_code == 401:
277
+ raise UnauthorizedError(
278
+ typing.cast(
279
+ typing.Optional[typing.Any],
280
+ parse_obj_as(
281
+ type_=typing.Optional[typing.Any], # type: ignore
282
+ object_=_response.json(),
283
+ ),
284
+ )
285
+ )
256
286
  if _response.status_code == 404:
257
287
  raise NotFoundError(
258
288
  typing.cast(
@@ -404,6 +434,16 @@ class AsyncVoicesClient:
404
434
  object_=_response.json(),
405
435
  ),
406
436
  )
437
+ if _response.status_code == 401:
438
+ raise UnauthorizedError(
439
+ typing.cast(
440
+ typing.Optional[typing.Any],
441
+ parse_obj_as(
442
+ type_=typing.Optional[typing.Any], # type: ignore
443
+ object_=_response.json(),
444
+ ),
445
+ )
446
+ )
407
447
  if _response.status_code == 404:
408
448
  raise NotFoundError(
409
449
  typing.cast(
@@ -532,6 +572,16 @@ class AsyncVoicesClient:
532
572
  ),
533
573
  )
534
574
  )
575
+ if _response.status_code == 401:
576
+ raise UnauthorizedError(
577
+ typing.cast(
578
+ typing.Optional[typing.Any],
579
+ parse_obj_as(
580
+ type_=typing.Optional[typing.Any], # type: ignore
581
+ object_=_response.json(),
582
+ ),
583
+ )
584
+ )
535
585
  if _response.status_code == 402:
536
586
  raise PaymentRequiredError(
537
587
  typing.cast(
@@ -610,6 +660,16 @@ class AsyncVoicesClient:
610
660
  ),
611
661
  )
612
662
  )
663
+ if _response.status_code == 401:
664
+ raise UnauthorizedError(
665
+ typing.cast(
666
+ typing.Optional[typing.Any],
667
+ parse_obj_as(
668
+ type_=typing.Optional[typing.Any], # type: ignore
669
+ object_=_response.json(),
670
+ ),
671
+ )
672
+ )
613
673
  if _response.status_code == 404:
614
674
  raise NotFoundError(
615
675
  typing.cast(
@@ -1,49 +0,0 @@
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
@@ -1,7 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- ExperimentalStreamRequestModel = typing.Union[
6
- typing.Literal["simba-base", "simba-english", "simba-multilingual", "simba-turbo"], typing.Any
7
- ]
@@ -1,33 +0,0 @@
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