murf 1.2.2__py3-none-any.whl → 2.0.0__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.
Potentially problematic release.
This version of murf might be problematic. Click here for more details.
- murf/__init__.py +31 -1
- murf/auth/client.py +11 -9
- murf/base_client.py +3 -20
- murf/client.py +9 -8
- murf/core/__init__.py +4 -0
- murf/core/client_wrapper.py +18 -17
- murf/core/unchecked_base_model.py +305 -0
- murf/dubbing/jobs/client.py +37 -31
- murf/dubbing/languages/client.py +25 -21
- murf/dubbing/projects/client.py +37 -31
- murf/dubbing_client.py +9 -8
- murf/environment.py +10 -3
- murf/stream_input/__init__.py +5 -0
- murf/stream_input/types/__init__.py +6 -0
- murf/stream_input/types/receive_message.py +7 -0
- murf/stream_input/types/send_message.py +9 -0
- murf/text/client.py +15 -13
- murf/text_to_speech/client.py +43 -37
- murf/types/__init__.py +34 -0
- murf/types/api_job_response.py +2 -2
- murf/types/api_project_response.py +2 -2
- murf/types/api_voice.py +2 -2
- murf/types/audio_output.py +27 -0
- murf/types/auth_token_response.py +2 -2
- murf/types/character_count.py +2 -2
- murf/types/clear_context.py +20 -0
- murf/types/dub_api_detail_response.py +2 -2
- murf/types/dub_job_status_response.py +2 -2
- murf/types/final_output.py +27 -0
- murf/types/form_data_content_disposition.py +2 -2
- murf/types/generate_speech_response.py +2 -2
- murf/types/group_api_project_response.py +2 -2
- murf/types/locale_response.py +2 -2
- murf/types/metadata.py +2 -2
- murf/types/murf_api_translation_response.py +2 -2
- murf/types/pronunciation_detail.py +2 -2
- murf/types/send_text.py +32 -0
- murf/types/set_advanced_settings.py +20 -0
- murf/types/set_voice_configuration.py +20 -0
- murf/types/set_voice_configuration_voice_config.py +57 -0
- murf/types/set_voice_configuration_voice_config_pronunciation_dictionary_value.py +30 -0
- murf/types/set_voice_configuration_voice_config_pronunciation_dictionary_value_type.py +7 -0
- murf/types/source_locale_response.py +2 -2
- murf/types/speech_to_speech_response.py +2 -2
- murf/types/style_details.py +2 -2
- murf/types/translation.py +2 -2
- murf/types/tts_request_both_payload.py +29 -0
- murf/types/tts_request_both_payload_voice_config.py +44 -0
- murf/types/tts_request_both_payload_voice_config_pronunciation_dictionary.py +22 -0
- murf/types/tts_request_both_payload_voice_config_pronunciation_dictionary_guess.py +20 -0
- murf/types/word_duration_response.py +2 -2
- murf/voice_changer/client.py +17 -15
- {murf-1.2.2.dist-info → murf-2.0.0.dist-info}/METADATA +1 -1
- murf-2.0.0.dist-info/RECORD +98 -0
- murf-1.2.2.dist-info/RECORD +0 -80
- {murf-1.2.2.dist-info → murf-2.0.0.dist-info}/LICENSE +0 -0
- {murf-1.2.2.dist-info → murf-2.0.0.dist-info}/WHEEL +0 -0
murf/text/client.py
CHANGED
|
@@ -4,7 +4,7 @@ import typing
|
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from ..core.request_options import RequestOptions
|
|
6
6
|
from ..types.murf_api_translation_response import MurfApiTranslationResponse
|
|
7
|
-
from ..core.
|
|
7
|
+
from ..core.unchecked_base_model import construct_type
|
|
8
8
|
from ..errors.bad_request_error import BadRequestError
|
|
9
9
|
from ..errors.payment_required_error import PaymentRequiredError
|
|
10
10
|
from ..errors.forbidden_error import ForbiddenError
|
|
@@ -60,6 +60,7 @@ class TextClient:
|
|
|
60
60
|
"""
|
|
61
61
|
_response = self._client_wrapper.httpx_client.request(
|
|
62
62
|
"v1/text/translate",
|
|
63
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
63
64
|
method="POST",
|
|
64
65
|
json={
|
|
65
66
|
"targetLanguage": target_language,
|
|
@@ -75,7 +76,7 @@ class TextClient:
|
|
|
75
76
|
if 200 <= _response.status_code < 300:
|
|
76
77
|
return typing.cast(
|
|
77
78
|
MurfApiTranslationResponse,
|
|
78
|
-
|
|
79
|
+
construct_type(
|
|
79
80
|
type_=MurfApiTranslationResponse, # type: ignore
|
|
80
81
|
object_=_response.json(),
|
|
81
82
|
),
|
|
@@ -84,7 +85,7 @@ class TextClient:
|
|
|
84
85
|
raise BadRequestError(
|
|
85
86
|
typing.cast(
|
|
86
87
|
typing.Optional[typing.Any],
|
|
87
|
-
|
|
88
|
+
construct_type(
|
|
88
89
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
89
90
|
object_=_response.json(),
|
|
90
91
|
),
|
|
@@ -94,7 +95,7 @@ class TextClient:
|
|
|
94
95
|
raise PaymentRequiredError(
|
|
95
96
|
typing.cast(
|
|
96
97
|
typing.Optional[typing.Any],
|
|
97
|
-
|
|
98
|
+
construct_type(
|
|
98
99
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
99
100
|
object_=_response.json(),
|
|
100
101
|
),
|
|
@@ -104,7 +105,7 @@ class TextClient:
|
|
|
104
105
|
raise ForbiddenError(
|
|
105
106
|
typing.cast(
|
|
106
107
|
typing.Optional[typing.Any],
|
|
107
|
-
|
|
108
|
+
construct_type(
|
|
108
109
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
109
110
|
object_=_response.json(),
|
|
110
111
|
),
|
|
@@ -114,7 +115,7 @@ class TextClient:
|
|
|
114
115
|
raise InternalServerError(
|
|
115
116
|
typing.cast(
|
|
116
117
|
typing.Optional[typing.Any],
|
|
117
|
-
|
|
118
|
+
construct_type(
|
|
118
119
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
119
120
|
object_=_response.json(),
|
|
120
121
|
),
|
|
@@ -124,7 +125,7 @@ class TextClient:
|
|
|
124
125
|
raise ServiceUnavailableError(
|
|
125
126
|
typing.cast(
|
|
126
127
|
typing.Optional[typing.Any],
|
|
127
|
-
|
|
128
|
+
construct_type(
|
|
128
129
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
129
130
|
object_=_response.json(),
|
|
130
131
|
),
|
|
@@ -186,6 +187,7 @@ class AsyncTextClient:
|
|
|
186
187
|
"""
|
|
187
188
|
_response = await self._client_wrapper.httpx_client.request(
|
|
188
189
|
"v1/text/translate",
|
|
190
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
189
191
|
method="POST",
|
|
190
192
|
json={
|
|
191
193
|
"targetLanguage": target_language,
|
|
@@ -201,7 +203,7 @@ class AsyncTextClient:
|
|
|
201
203
|
if 200 <= _response.status_code < 300:
|
|
202
204
|
return typing.cast(
|
|
203
205
|
MurfApiTranslationResponse,
|
|
204
|
-
|
|
206
|
+
construct_type(
|
|
205
207
|
type_=MurfApiTranslationResponse, # type: ignore
|
|
206
208
|
object_=_response.json(),
|
|
207
209
|
),
|
|
@@ -210,7 +212,7 @@ class AsyncTextClient:
|
|
|
210
212
|
raise BadRequestError(
|
|
211
213
|
typing.cast(
|
|
212
214
|
typing.Optional[typing.Any],
|
|
213
|
-
|
|
215
|
+
construct_type(
|
|
214
216
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
215
217
|
object_=_response.json(),
|
|
216
218
|
),
|
|
@@ -220,7 +222,7 @@ class AsyncTextClient:
|
|
|
220
222
|
raise PaymentRequiredError(
|
|
221
223
|
typing.cast(
|
|
222
224
|
typing.Optional[typing.Any],
|
|
223
|
-
|
|
225
|
+
construct_type(
|
|
224
226
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
225
227
|
object_=_response.json(),
|
|
226
228
|
),
|
|
@@ -230,7 +232,7 @@ class AsyncTextClient:
|
|
|
230
232
|
raise ForbiddenError(
|
|
231
233
|
typing.cast(
|
|
232
234
|
typing.Optional[typing.Any],
|
|
233
|
-
|
|
235
|
+
construct_type(
|
|
234
236
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
235
237
|
object_=_response.json(),
|
|
236
238
|
),
|
|
@@ -240,7 +242,7 @@ class AsyncTextClient:
|
|
|
240
242
|
raise InternalServerError(
|
|
241
243
|
typing.cast(
|
|
242
244
|
typing.Optional[typing.Any],
|
|
243
|
-
|
|
245
|
+
construct_type(
|
|
244
246
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
245
247
|
object_=_response.json(),
|
|
246
248
|
),
|
|
@@ -250,7 +252,7 @@ class AsyncTextClient:
|
|
|
250
252
|
raise ServiceUnavailableError(
|
|
251
253
|
typing.cast(
|
|
252
254
|
typing.Optional[typing.Any],
|
|
253
|
-
|
|
255
|
+
construct_type(
|
|
254
256
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
255
257
|
object_=_response.json(),
|
|
256
258
|
),
|
murf/text_to_speech/client.py
CHANGED
|
@@ -7,7 +7,7 @@ from ..types.pronunciation_detail import PronunciationDetail
|
|
|
7
7
|
from ..core.request_options import RequestOptions
|
|
8
8
|
from ..types.generate_speech_response import GenerateSpeechResponse
|
|
9
9
|
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
10
|
-
from ..core.
|
|
10
|
+
from ..core.unchecked_base_model import construct_type
|
|
11
11
|
from ..errors.bad_request_error import BadRequestError
|
|
12
12
|
from ..errors.payment_required_error import PaymentRequiredError
|
|
13
13
|
from ..errors.forbidden_error import ForbiddenError
|
|
@@ -54,7 +54,7 @@ class TextToSpeechClient:
|
|
|
54
54
|
The text that is to be synthesised. e.g. 'Hello there [pause 1s] friend'
|
|
55
55
|
|
|
56
56
|
voice_id : str
|
|
57
|
-
Use the GET /v1/speech/voices
|
|
57
|
+
Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
|
|
58
58
|
|
|
59
59
|
audio_duration : typing.Optional[float]
|
|
60
60
|
This parameter allows specifying the duration (in seconds) for the generated audio. If the value is 0, this parameter will be ignored. Only available for Gen2 model.
|
|
@@ -119,6 +119,7 @@ class TextToSpeechClient:
|
|
|
119
119
|
"""
|
|
120
120
|
_response = self._client_wrapper.httpx_client.request(
|
|
121
121
|
"v1/speech/generate",
|
|
122
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
122
123
|
method="POST",
|
|
123
124
|
json={
|
|
124
125
|
"audioDuration": audio_duration,
|
|
@@ -150,7 +151,7 @@ class TextToSpeechClient:
|
|
|
150
151
|
if 200 <= _response.status_code < 300:
|
|
151
152
|
return typing.cast(
|
|
152
153
|
GenerateSpeechResponse,
|
|
153
|
-
|
|
154
|
+
construct_type(
|
|
154
155
|
type_=GenerateSpeechResponse, # type: ignore
|
|
155
156
|
object_=_response.json(),
|
|
156
157
|
),
|
|
@@ -159,7 +160,7 @@ class TextToSpeechClient:
|
|
|
159
160
|
raise BadRequestError(
|
|
160
161
|
typing.cast(
|
|
161
162
|
typing.Optional[typing.Any],
|
|
162
|
-
|
|
163
|
+
construct_type(
|
|
163
164
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
164
165
|
object_=_response.json(),
|
|
165
166
|
),
|
|
@@ -169,7 +170,7 @@ class TextToSpeechClient:
|
|
|
169
170
|
raise PaymentRequiredError(
|
|
170
171
|
typing.cast(
|
|
171
172
|
typing.Optional[typing.Any],
|
|
172
|
-
|
|
173
|
+
construct_type(
|
|
173
174
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
174
175
|
object_=_response.json(),
|
|
175
176
|
),
|
|
@@ -179,7 +180,7 @@ class TextToSpeechClient:
|
|
|
179
180
|
raise ForbiddenError(
|
|
180
181
|
typing.cast(
|
|
181
182
|
typing.Optional[typing.Any],
|
|
182
|
-
|
|
183
|
+
construct_type(
|
|
183
184
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
184
185
|
object_=_response.json(),
|
|
185
186
|
),
|
|
@@ -189,7 +190,7 @@ class TextToSpeechClient:
|
|
|
189
190
|
raise InternalServerError(
|
|
190
191
|
typing.cast(
|
|
191
192
|
typing.Optional[typing.Any],
|
|
192
|
-
|
|
193
|
+
construct_type(
|
|
193
194
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
194
195
|
object_=_response.json(),
|
|
195
196
|
),
|
|
@@ -199,7 +200,7 @@ class TextToSpeechClient:
|
|
|
199
200
|
raise ServiceUnavailableError(
|
|
200
201
|
typing.cast(
|
|
201
202
|
typing.Optional[typing.Any],
|
|
202
|
-
|
|
203
|
+
construct_type(
|
|
203
204
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
204
205
|
object_=_response.json(),
|
|
205
206
|
),
|
|
@@ -234,7 +235,7 @@ class TextToSpeechClient:
|
|
|
234
235
|
The text that is to be synthesised. e.g. 'Hello there [pause 1s] friend'
|
|
235
236
|
|
|
236
237
|
voice_id : str
|
|
237
|
-
Use the GET /v1/speech/voices
|
|
238
|
+
Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
|
|
238
239
|
|
|
239
240
|
channel_type : typing.Optional[str]
|
|
240
241
|
Valid values: STEREO, MONO
|
|
@@ -280,6 +281,7 @@ class TextToSpeechClient:
|
|
|
280
281
|
"""
|
|
281
282
|
with self._client_wrapper.httpx_client.stream(
|
|
282
283
|
"v1/speech/stream",
|
|
284
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
283
285
|
method="POST",
|
|
284
286
|
json={
|
|
285
287
|
"channelType": channel_type,
|
|
@@ -310,7 +312,7 @@ class TextToSpeechClient:
|
|
|
310
312
|
raise BadRequestError(
|
|
311
313
|
typing.cast(
|
|
312
314
|
typing.Optional[typing.Any],
|
|
313
|
-
|
|
315
|
+
construct_type(
|
|
314
316
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
315
317
|
object_=_response.json(),
|
|
316
318
|
),
|
|
@@ -320,7 +322,7 @@ class TextToSpeechClient:
|
|
|
320
322
|
raise PaymentRequiredError(
|
|
321
323
|
typing.cast(
|
|
322
324
|
typing.Optional[typing.Any],
|
|
323
|
-
|
|
325
|
+
construct_type(
|
|
324
326
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
325
327
|
object_=_response.json(),
|
|
326
328
|
),
|
|
@@ -330,7 +332,7 @@ class TextToSpeechClient:
|
|
|
330
332
|
raise ForbiddenError(
|
|
331
333
|
typing.cast(
|
|
332
334
|
typing.Optional[typing.Any],
|
|
333
|
-
|
|
335
|
+
construct_type(
|
|
334
336
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
335
337
|
object_=_response.json(),
|
|
336
338
|
),
|
|
@@ -340,7 +342,7 @@ class TextToSpeechClient:
|
|
|
340
342
|
raise InternalServerError(
|
|
341
343
|
typing.cast(
|
|
342
344
|
typing.Optional[typing.Any],
|
|
343
|
-
|
|
345
|
+
construct_type(
|
|
344
346
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
345
347
|
object_=_response.json(),
|
|
346
348
|
),
|
|
@@ -350,7 +352,7 @@ class TextToSpeechClient:
|
|
|
350
352
|
raise ServiceUnavailableError(
|
|
351
353
|
typing.cast(
|
|
352
354
|
typing.Optional[typing.Any],
|
|
353
|
-
|
|
355
|
+
construct_type(
|
|
354
356
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
355
357
|
object_=_response.json(),
|
|
356
358
|
),
|
|
@@ -390,6 +392,7 @@ class TextToSpeechClient:
|
|
|
390
392
|
"""
|
|
391
393
|
_response = self._client_wrapper.httpx_client.request(
|
|
392
394
|
"v1/speech/voices",
|
|
395
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
393
396
|
method="GET",
|
|
394
397
|
headers={
|
|
395
398
|
"token": str(token) if token is not None else None,
|
|
@@ -400,7 +403,7 @@ class TextToSpeechClient:
|
|
|
400
403
|
if 200 <= _response.status_code < 300:
|
|
401
404
|
return typing.cast(
|
|
402
405
|
typing.List[ApiVoice],
|
|
403
|
-
|
|
406
|
+
construct_type(
|
|
404
407
|
type_=typing.List[ApiVoice], # type: ignore
|
|
405
408
|
object_=_response.json(),
|
|
406
409
|
),
|
|
@@ -409,7 +412,7 @@ class TextToSpeechClient:
|
|
|
409
412
|
raise BadRequestError(
|
|
410
413
|
typing.cast(
|
|
411
414
|
typing.Optional[typing.Any],
|
|
412
|
-
|
|
415
|
+
construct_type(
|
|
413
416
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
414
417
|
object_=_response.json(),
|
|
415
418
|
),
|
|
@@ -419,7 +422,7 @@ class TextToSpeechClient:
|
|
|
419
422
|
raise ForbiddenError(
|
|
420
423
|
typing.cast(
|
|
421
424
|
typing.Optional[typing.Any],
|
|
422
|
-
|
|
425
|
+
construct_type(
|
|
423
426
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
424
427
|
object_=_response.json(),
|
|
425
428
|
),
|
|
@@ -429,7 +432,7 @@ class TextToSpeechClient:
|
|
|
429
432
|
raise InternalServerError(
|
|
430
433
|
typing.cast(
|
|
431
434
|
typing.Optional[typing.Any],
|
|
432
|
-
|
|
435
|
+
construct_type(
|
|
433
436
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
434
437
|
object_=_response.json(),
|
|
435
438
|
),
|
|
@@ -439,7 +442,7 @@ class TextToSpeechClient:
|
|
|
439
442
|
raise ServiceUnavailableError(
|
|
440
443
|
typing.cast(
|
|
441
444
|
typing.Optional[typing.Any],
|
|
442
|
-
|
|
445
|
+
construct_type(
|
|
443
446
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
444
447
|
object_=_response.json(),
|
|
445
448
|
),
|
|
@@ -483,7 +486,7 @@ class AsyncTextToSpeechClient:
|
|
|
483
486
|
The text that is to be synthesised. e.g. 'Hello there [pause 1s] friend'
|
|
484
487
|
|
|
485
488
|
voice_id : str
|
|
486
|
-
Use the GET /v1/speech/voices
|
|
489
|
+
Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
|
|
487
490
|
|
|
488
491
|
audio_duration : typing.Optional[float]
|
|
489
492
|
This parameter allows specifying the duration (in seconds) for the generated audio. If the value is 0, this parameter will be ignored. Only available for Gen2 model.
|
|
@@ -556,6 +559,7 @@ class AsyncTextToSpeechClient:
|
|
|
556
559
|
"""
|
|
557
560
|
_response = await self._client_wrapper.httpx_client.request(
|
|
558
561
|
"v1/speech/generate",
|
|
562
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
559
563
|
method="POST",
|
|
560
564
|
json={
|
|
561
565
|
"audioDuration": audio_duration,
|
|
@@ -587,7 +591,7 @@ class AsyncTextToSpeechClient:
|
|
|
587
591
|
if 200 <= _response.status_code < 300:
|
|
588
592
|
return typing.cast(
|
|
589
593
|
GenerateSpeechResponse,
|
|
590
|
-
|
|
594
|
+
construct_type(
|
|
591
595
|
type_=GenerateSpeechResponse, # type: ignore
|
|
592
596
|
object_=_response.json(),
|
|
593
597
|
),
|
|
@@ -596,7 +600,7 @@ class AsyncTextToSpeechClient:
|
|
|
596
600
|
raise BadRequestError(
|
|
597
601
|
typing.cast(
|
|
598
602
|
typing.Optional[typing.Any],
|
|
599
|
-
|
|
603
|
+
construct_type(
|
|
600
604
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
601
605
|
object_=_response.json(),
|
|
602
606
|
),
|
|
@@ -606,7 +610,7 @@ class AsyncTextToSpeechClient:
|
|
|
606
610
|
raise PaymentRequiredError(
|
|
607
611
|
typing.cast(
|
|
608
612
|
typing.Optional[typing.Any],
|
|
609
|
-
|
|
613
|
+
construct_type(
|
|
610
614
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
611
615
|
object_=_response.json(),
|
|
612
616
|
),
|
|
@@ -616,7 +620,7 @@ class AsyncTextToSpeechClient:
|
|
|
616
620
|
raise ForbiddenError(
|
|
617
621
|
typing.cast(
|
|
618
622
|
typing.Optional[typing.Any],
|
|
619
|
-
|
|
623
|
+
construct_type(
|
|
620
624
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
621
625
|
object_=_response.json(),
|
|
622
626
|
),
|
|
@@ -626,7 +630,7 @@ class AsyncTextToSpeechClient:
|
|
|
626
630
|
raise InternalServerError(
|
|
627
631
|
typing.cast(
|
|
628
632
|
typing.Optional[typing.Any],
|
|
629
|
-
|
|
633
|
+
construct_type(
|
|
630
634
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
631
635
|
object_=_response.json(),
|
|
632
636
|
),
|
|
@@ -636,7 +640,7 @@ class AsyncTextToSpeechClient:
|
|
|
636
640
|
raise ServiceUnavailableError(
|
|
637
641
|
typing.cast(
|
|
638
642
|
typing.Optional[typing.Any],
|
|
639
|
-
|
|
643
|
+
construct_type(
|
|
640
644
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
641
645
|
object_=_response.json(),
|
|
642
646
|
),
|
|
@@ -671,7 +675,7 @@ class AsyncTextToSpeechClient:
|
|
|
671
675
|
The text that is to be synthesised. e.g. 'Hello there [pause 1s] friend'
|
|
672
676
|
|
|
673
677
|
voice_id : str
|
|
674
|
-
Use the GET /v1/speech/voices
|
|
678
|
+
Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
|
|
675
679
|
|
|
676
680
|
channel_type : typing.Optional[str]
|
|
677
681
|
Valid values: STEREO, MONO
|
|
@@ -725,6 +729,7 @@ class AsyncTextToSpeechClient:
|
|
|
725
729
|
"""
|
|
726
730
|
async with self._client_wrapper.httpx_client.stream(
|
|
727
731
|
"v1/speech/stream",
|
|
732
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
728
733
|
method="POST",
|
|
729
734
|
json={
|
|
730
735
|
"channelType": channel_type,
|
|
@@ -755,7 +760,7 @@ class AsyncTextToSpeechClient:
|
|
|
755
760
|
raise BadRequestError(
|
|
756
761
|
typing.cast(
|
|
757
762
|
typing.Optional[typing.Any],
|
|
758
|
-
|
|
763
|
+
construct_type(
|
|
759
764
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
760
765
|
object_=_response.json(),
|
|
761
766
|
),
|
|
@@ -765,7 +770,7 @@ class AsyncTextToSpeechClient:
|
|
|
765
770
|
raise PaymentRequiredError(
|
|
766
771
|
typing.cast(
|
|
767
772
|
typing.Optional[typing.Any],
|
|
768
|
-
|
|
773
|
+
construct_type(
|
|
769
774
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
770
775
|
object_=_response.json(),
|
|
771
776
|
),
|
|
@@ -775,7 +780,7 @@ class AsyncTextToSpeechClient:
|
|
|
775
780
|
raise ForbiddenError(
|
|
776
781
|
typing.cast(
|
|
777
782
|
typing.Optional[typing.Any],
|
|
778
|
-
|
|
783
|
+
construct_type(
|
|
779
784
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
780
785
|
object_=_response.json(),
|
|
781
786
|
),
|
|
@@ -785,7 +790,7 @@ class AsyncTextToSpeechClient:
|
|
|
785
790
|
raise InternalServerError(
|
|
786
791
|
typing.cast(
|
|
787
792
|
typing.Optional[typing.Any],
|
|
788
|
-
|
|
793
|
+
construct_type(
|
|
789
794
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
790
795
|
object_=_response.json(),
|
|
791
796
|
),
|
|
@@ -795,7 +800,7 @@ class AsyncTextToSpeechClient:
|
|
|
795
800
|
raise ServiceUnavailableError(
|
|
796
801
|
typing.cast(
|
|
797
802
|
typing.Optional[typing.Any],
|
|
798
|
-
|
|
803
|
+
construct_type(
|
|
799
804
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
800
805
|
object_=_response.json(),
|
|
801
806
|
),
|
|
@@ -843,6 +848,7 @@ class AsyncTextToSpeechClient:
|
|
|
843
848
|
"""
|
|
844
849
|
_response = await self._client_wrapper.httpx_client.request(
|
|
845
850
|
"v1/speech/voices",
|
|
851
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
846
852
|
method="GET",
|
|
847
853
|
headers={
|
|
848
854
|
"token": str(token) if token is not None else None,
|
|
@@ -853,7 +859,7 @@ class AsyncTextToSpeechClient:
|
|
|
853
859
|
if 200 <= _response.status_code < 300:
|
|
854
860
|
return typing.cast(
|
|
855
861
|
typing.List[ApiVoice],
|
|
856
|
-
|
|
862
|
+
construct_type(
|
|
857
863
|
type_=typing.List[ApiVoice], # type: ignore
|
|
858
864
|
object_=_response.json(),
|
|
859
865
|
),
|
|
@@ -862,7 +868,7 @@ class AsyncTextToSpeechClient:
|
|
|
862
868
|
raise BadRequestError(
|
|
863
869
|
typing.cast(
|
|
864
870
|
typing.Optional[typing.Any],
|
|
865
|
-
|
|
871
|
+
construct_type(
|
|
866
872
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
867
873
|
object_=_response.json(),
|
|
868
874
|
),
|
|
@@ -872,7 +878,7 @@ class AsyncTextToSpeechClient:
|
|
|
872
878
|
raise ForbiddenError(
|
|
873
879
|
typing.cast(
|
|
874
880
|
typing.Optional[typing.Any],
|
|
875
|
-
|
|
881
|
+
construct_type(
|
|
876
882
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
877
883
|
object_=_response.json(),
|
|
878
884
|
),
|
|
@@ -882,7 +888,7 @@ class AsyncTextToSpeechClient:
|
|
|
882
888
|
raise InternalServerError(
|
|
883
889
|
typing.cast(
|
|
884
890
|
typing.Optional[typing.Any],
|
|
885
|
-
|
|
891
|
+
construct_type(
|
|
886
892
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
887
893
|
object_=_response.json(),
|
|
888
894
|
),
|
|
@@ -892,7 +898,7 @@ class AsyncTextToSpeechClient:
|
|
|
892
898
|
raise ServiceUnavailableError(
|
|
893
899
|
typing.cast(
|
|
894
900
|
typing.Optional[typing.Any],
|
|
895
|
-
|
|
901
|
+
construct_type(
|
|
896
902
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
897
903
|
object_=_response.json(),
|
|
898
904
|
),
|
murf/types/__init__.py
CHANGED
|
@@ -7,10 +7,13 @@ from .api_project_response import ApiProjectResponse
|
|
|
7
7
|
from .api_project_response_dubbing_type import ApiProjectResponseDubbingType
|
|
8
8
|
from .api_voice import ApiVoice
|
|
9
9
|
from .api_voice_gender import ApiVoiceGender
|
|
10
|
+
from .audio_output import AudioOutput
|
|
10
11
|
from .auth_token_response import AuthTokenResponse
|
|
11
12
|
from .character_count import CharacterCount
|
|
13
|
+
from .clear_context import ClearContext
|
|
12
14
|
from .dub_api_detail_response import DubApiDetailResponse
|
|
13
15
|
from .dub_job_status_response import DubJobStatusResponse
|
|
16
|
+
from .final_output import FinalOutput
|
|
14
17
|
from .form_data_content_disposition import FormDataContentDisposition
|
|
15
18
|
from .generate_speech_response import GenerateSpeechResponse
|
|
16
19
|
from .group_api_project_response import GroupApiProjectResponse
|
|
@@ -20,10 +23,28 @@ from .metadata import Metadata
|
|
|
20
23
|
from .murf_api_translation_response import MurfApiTranslationResponse
|
|
21
24
|
from .pronunciation_detail import PronunciationDetail
|
|
22
25
|
from .pronunciation_detail_type import PronunciationDetailType
|
|
26
|
+
from .send_text import SendText
|
|
27
|
+
from .set_advanced_settings import SetAdvancedSettings
|
|
28
|
+
from .set_voice_configuration import SetVoiceConfiguration
|
|
29
|
+
from .set_voice_configuration_voice_config import SetVoiceConfigurationVoiceConfig
|
|
30
|
+
from .set_voice_configuration_voice_config_pronunciation_dictionary_value import (
|
|
31
|
+
SetVoiceConfigurationVoiceConfigPronunciationDictionaryValue,
|
|
32
|
+
)
|
|
33
|
+
from .set_voice_configuration_voice_config_pronunciation_dictionary_value_type import (
|
|
34
|
+
SetVoiceConfigurationVoiceConfigPronunciationDictionaryValueType,
|
|
35
|
+
)
|
|
23
36
|
from .source_locale_response import SourceLocaleResponse
|
|
24
37
|
from .speech_to_speech_response import SpeechToSpeechResponse
|
|
25
38
|
from .style_details import StyleDetails
|
|
26
39
|
from .translation import Translation
|
|
40
|
+
from .tts_request_both_payload import TtsRequestBothPayload
|
|
41
|
+
from .tts_request_both_payload_voice_config import TtsRequestBothPayloadVoiceConfig
|
|
42
|
+
from .tts_request_both_payload_voice_config_pronunciation_dictionary import (
|
|
43
|
+
TtsRequestBothPayloadVoiceConfigPronunciationDictionary,
|
|
44
|
+
)
|
|
45
|
+
from .tts_request_both_payload_voice_config_pronunciation_dictionary_guess import (
|
|
46
|
+
TtsRequestBothPayloadVoiceConfigPronunciationDictionaryGuess,
|
|
47
|
+
)
|
|
27
48
|
from .word_duration_response import WordDurationResponse
|
|
28
49
|
|
|
29
50
|
__all__ = [
|
|
@@ -34,10 +55,13 @@ __all__ = [
|
|
|
34
55
|
"ApiProjectResponseDubbingType",
|
|
35
56
|
"ApiVoice",
|
|
36
57
|
"ApiVoiceGender",
|
|
58
|
+
"AudioOutput",
|
|
37
59
|
"AuthTokenResponse",
|
|
38
60
|
"CharacterCount",
|
|
61
|
+
"ClearContext",
|
|
39
62
|
"DubApiDetailResponse",
|
|
40
63
|
"DubJobStatusResponse",
|
|
64
|
+
"FinalOutput",
|
|
41
65
|
"FormDataContentDisposition",
|
|
42
66
|
"GenerateSpeechResponse",
|
|
43
67
|
"GroupApiProjectResponse",
|
|
@@ -47,9 +71,19 @@ __all__ = [
|
|
|
47
71
|
"MurfApiTranslationResponse",
|
|
48
72
|
"PronunciationDetail",
|
|
49
73
|
"PronunciationDetailType",
|
|
74
|
+
"SendText",
|
|
75
|
+
"SetAdvancedSettings",
|
|
76
|
+
"SetVoiceConfiguration",
|
|
77
|
+
"SetVoiceConfigurationVoiceConfig",
|
|
78
|
+
"SetVoiceConfigurationVoiceConfigPronunciationDictionaryValue",
|
|
79
|
+
"SetVoiceConfigurationVoiceConfigPronunciationDictionaryValueType",
|
|
50
80
|
"SourceLocaleResponse",
|
|
51
81
|
"SpeechToSpeechResponse",
|
|
52
82
|
"StyleDetails",
|
|
53
83
|
"Translation",
|
|
84
|
+
"TtsRequestBothPayload",
|
|
85
|
+
"TtsRequestBothPayloadVoiceConfig",
|
|
86
|
+
"TtsRequestBothPayloadVoiceConfigPronunciationDictionary",
|
|
87
|
+
"TtsRequestBothPayloadVoiceConfigPronunciationDictionaryGuess",
|
|
54
88
|
"WordDurationResponse",
|
|
55
89
|
]
|
murf/types/api_job_response.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from .api_job_response_dubbing_type import ApiJobResponseDubbingType
|
|
6
6
|
import pydantic
|
|
@@ -8,7 +8,7 @@ from .api_job_response_priority import ApiJobResponsePriority
|
|
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class ApiJobResponse(
|
|
11
|
+
class ApiJobResponse(UncheckedBaseModel):
|
|
12
12
|
file_url: typing.Optional[str] = None
|
|
13
13
|
dubbing_type: ApiJobResponseDubbingType = pydantic.Field()
|
|
14
14
|
"""
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import pydantic
|
|
5
5
|
import typing
|
|
6
6
|
from .api_project_response_dubbing_type import ApiProjectResponseDubbingType
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class ApiProjectResponse(
|
|
10
|
+
class ApiProjectResponse(UncheckedBaseModel):
|
|
11
11
|
project_id: str = pydantic.Field()
|
|
12
12
|
"""
|
|
13
13
|
Your Project Id
|
murf/types/api_voice.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
import pydantic
|
|
6
6
|
import typing_extensions
|
|
@@ -10,7 +10,7 @@ from .style_details import StyleDetails
|
|
|
10
10
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class ApiVoice(
|
|
13
|
+
class ApiVoice(UncheckedBaseModel):
|
|
14
14
|
accent: typing.Optional[str] = pydantic.Field(default=None)
|
|
15
15
|
"""
|
|
16
16
|
This field has been deprecated. Please refer to 'supportedLocales.detail' instead.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import pydantic
|
|
5
|
+
import typing
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AudioOutput(UncheckedBaseModel):
|
|
10
|
+
audio: str = pydantic.Field()
|
|
11
|
+
"""
|
|
12
|
+
Base64 encoded audio data
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
context_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
Optional context identifier
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
if IS_PYDANTIC_V2:
|
|
21
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
|
+
else:
|
|
23
|
+
|
|
24
|
+
class Config:
|
|
25
|
+
frozen = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing_extensions
|
|
5
5
|
import typing
|
|
6
6
|
from ..core.serialization import FieldMetadata
|
|
@@ -8,7 +8,7 @@ import pydantic
|
|
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class AuthTokenResponse(
|
|
11
|
+
class AuthTokenResponse(UncheckedBaseModel):
|
|
12
12
|
expiry_in_epoch_millis: typing_extensions.Annotated[
|
|
13
13
|
typing.Optional[int], FieldMetadata(alias="expiryInEpochMillis")
|
|
14
14
|
] = pydantic.Field(default=None)
|