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.

Files changed (57) hide show
  1. murf/__init__.py +31 -1
  2. murf/auth/client.py +11 -9
  3. murf/base_client.py +3 -20
  4. murf/client.py +9 -8
  5. murf/core/__init__.py +4 -0
  6. murf/core/client_wrapper.py +18 -17
  7. murf/core/unchecked_base_model.py +305 -0
  8. murf/dubbing/jobs/client.py +37 -31
  9. murf/dubbing/languages/client.py +25 -21
  10. murf/dubbing/projects/client.py +37 -31
  11. murf/dubbing_client.py +9 -8
  12. murf/environment.py +10 -3
  13. murf/stream_input/__init__.py +5 -0
  14. murf/stream_input/types/__init__.py +6 -0
  15. murf/stream_input/types/receive_message.py +7 -0
  16. murf/stream_input/types/send_message.py +9 -0
  17. murf/text/client.py +15 -13
  18. murf/text_to_speech/client.py +43 -37
  19. murf/types/__init__.py +34 -0
  20. murf/types/api_job_response.py +2 -2
  21. murf/types/api_project_response.py +2 -2
  22. murf/types/api_voice.py +2 -2
  23. murf/types/audio_output.py +27 -0
  24. murf/types/auth_token_response.py +2 -2
  25. murf/types/character_count.py +2 -2
  26. murf/types/clear_context.py +20 -0
  27. murf/types/dub_api_detail_response.py +2 -2
  28. murf/types/dub_job_status_response.py +2 -2
  29. murf/types/final_output.py +27 -0
  30. murf/types/form_data_content_disposition.py +2 -2
  31. murf/types/generate_speech_response.py +2 -2
  32. murf/types/group_api_project_response.py +2 -2
  33. murf/types/locale_response.py +2 -2
  34. murf/types/metadata.py +2 -2
  35. murf/types/murf_api_translation_response.py +2 -2
  36. murf/types/pronunciation_detail.py +2 -2
  37. murf/types/send_text.py +32 -0
  38. murf/types/set_advanced_settings.py +20 -0
  39. murf/types/set_voice_configuration.py +20 -0
  40. murf/types/set_voice_configuration_voice_config.py +57 -0
  41. murf/types/set_voice_configuration_voice_config_pronunciation_dictionary_value.py +30 -0
  42. murf/types/set_voice_configuration_voice_config_pronunciation_dictionary_value_type.py +7 -0
  43. murf/types/source_locale_response.py +2 -2
  44. murf/types/speech_to_speech_response.py +2 -2
  45. murf/types/style_details.py +2 -2
  46. murf/types/translation.py +2 -2
  47. murf/types/tts_request_both_payload.py +29 -0
  48. murf/types/tts_request_both_payload_voice_config.py +44 -0
  49. murf/types/tts_request_both_payload_voice_config_pronunciation_dictionary.py +22 -0
  50. murf/types/tts_request_both_payload_voice_config_pronunciation_dictionary_guess.py +20 -0
  51. murf/types/word_duration_response.py +2 -2
  52. murf/voice_changer/client.py +17 -15
  53. {murf-1.2.2.dist-info → murf-2.0.0.dist-info}/METADATA +1 -1
  54. murf-2.0.0.dist-info/RECORD +98 -0
  55. murf-1.2.2.dist-info/RECORD +0 -80
  56. {murf-1.2.2.dist-info → murf-2.0.0.dist-info}/LICENSE +0 -0
  57. {murf-1.2.2.dist-info → murf-2.0.0.dist-info}/WHEEL +0 -0
@@ -4,7 +4,7 @@ from ...core.client_wrapper import SyncClientWrapper
4
4
  import typing
5
5
  from ...core.request_options import RequestOptions
6
6
  from ...types.locale_response import LocaleResponse
7
- from ...core.pydantic_utilities import parse_obj_as
7
+ from ...core.unchecked_base_model import construct_type
8
8
  from ...errors.bad_request_error import BadRequestError
9
9
  from ...errors.forbidden_error import ForbiddenError
10
10
  from ...errors.internal_server_error import InternalServerError
@@ -44,6 +44,7 @@ class LanguagesClient:
44
44
  """
45
45
  _response = self._client_wrapper.httpx_client.request(
46
46
  "v1/murfdub/list-destination-languages",
47
+ base_url=self._client_wrapper.get_environment().base,
47
48
  method="GET",
48
49
  request_options=request_options,
49
50
  )
@@ -51,7 +52,7 @@ class LanguagesClient:
51
52
  if 200 <= _response.status_code < 300:
52
53
  return typing.cast(
53
54
  typing.List[LocaleResponse],
54
- parse_obj_as(
55
+ construct_type(
55
56
  type_=typing.List[LocaleResponse], # type: ignore
56
57
  object_=_response.json(),
57
58
  ),
@@ -60,7 +61,7 @@ class LanguagesClient:
60
61
  raise BadRequestError(
61
62
  typing.cast(
62
63
  typing.Optional[typing.Any],
63
- parse_obj_as(
64
+ construct_type(
64
65
  type_=typing.Optional[typing.Any], # type: ignore
65
66
  object_=_response.json(),
66
67
  ),
@@ -70,7 +71,7 @@ class LanguagesClient:
70
71
  raise ForbiddenError(
71
72
  typing.cast(
72
73
  typing.Optional[typing.Any],
73
- parse_obj_as(
74
+ construct_type(
74
75
  type_=typing.Optional[typing.Any], # type: ignore
75
76
  object_=_response.json(),
76
77
  ),
@@ -80,7 +81,7 @@ class LanguagesClient:
80
81
  raise InternalServerError(
81
82
  typing.cast(
82
83
  typing.Optional[typing.Any],
83
- parse_obj_as(
84
+ construct_type(
84
85
  type_=typing.Optional[typing.Any], # type: ignore
85
86
  object_=_response.json(),
86
87
  ),
@@ -90,7 +91,7 @@ class LanguagesClient:
90
91
  raise ServiceUnavailableError(
91
92
  typing.cast(
92
93
  typing.Optional[typing.Any],
93
- parse_obj_as(
94
+ construct_type(
94
95
  type_=typing.Optional[typing.Any], # type: ignore
95
96
  object_=_response.json(),
96
97
  ),
@@ -126,6 +127,7 @@ class LanguagesClient:
126
127
  """
127
128
  _response = self._client_wrapper.httpx_client.request(
128
129
  "v1/murfdub/list-source-languages",
130
+ base_url=self._client_wrapper.get_environment().base,
129
131
  method="GET",
130
132
  request_options=request_options,
131
133
  )
@@ -133,7 +135,7 @@ class LanguagesClient:
133
135
  if 200 <= _response.status_code < 300:
134
136
  return typing.cast(
135
137
  typing.List[SourceLocaleResponse],
136
- parse_obj_as(
138
+ construct_type(
137
139
  type_=typing.List[SourceLocaleResponse], # type: ignore
138
140
  object_=_response.json(),
139
141
  ),
@@ -142,7 +144,7 @@ class LanguagesClient:
142
144
  raise BadRequestError(
143
145
  typing.cast(
144
146
  typing.Optional[typing.Any],
145
- parse_obj_as(
147
+ construct_type(
146
148
  type_=typing.Optional[typing.Any], # type: ignore
147
149
  object_=_response.json(),
148
150
  ),
@@ -152,7 +154,7 @@ class LanguagesClient:
152
154
  raise ForbiddenError(
153
155
  typing.cast(
154
156
  typing.Optional[typing.Any],
155
- parse_obj_as(
157
+ construct_type(
156
158
  type_=typing.Optional[typing.Any], # type: ignore
157
159
  object_=_response.json(),
158
160
  ),
@@ -162,7 +164,7 @@ class LanguagesClient:
162
164
  raise InternalServerError(
163
165
  typing.cast(
164
166
  typing.Optional[typing.Any],
165
- parse_obj_as(
167
+ construct_type(
166
168
  type_=typing.Optional[typing.Any], # type: ignore
167
169
  object_=_response.json(),
168
170
  ),
@@ -172,7 +174,7 @@ class LanguagesClient:
172
174
  raise ServiceUnavailableError(
173
175
  typing.cast(
174
176
  typing.Optional[typing.Any],
175
- parse_obj_as(
177
+ construct_type(
176
178
  type_=typing.Optional[typing.Any], # type: ignore
177
179
  object_=_response.json(),
178
180
  ),
@@ -221,6 +223,7 @@ class AsyncLanguagesClient:
221
223
  """
222
224
  _response = await self._client_wrapper.httpx_client.request(
223
225
  "v1/murfdub/list-destination-languages",
226
+ base_url=self._client_wrapper.get_environment().base,
224
227
  method="GET",
225
228
  request_options=request_options,
226
229
  )
@@ -228,7 +231,7 @@ class AsyncLanguagesClient:
228
231
  if 200 <= _response.status_code < 300:
229
232
  return typing.cast(
230
233
  typing.List[LocaleResponse],
231
- parse_obj_as(
234
+ construct_type(
232
235
  type_=typing.List[LocaleResponse], # type: ignore
233
236
  object_=_response.json(),
234
237
  ),
@@ -237,7 +240,7 @@ class AsyncLanguagesClient:
237
240
  raise BadRequestError(
238
241
  typing.cast(
239
242
  typing.Optional[typing.Any],
240
- parse_obj_as(
243
+ construct_type(
241
244
  type_=typing.Optional[typing.Any], # type: ignore
242
245
  object_=_response.json(),
243
246
  ),
@@ -247,7 +250,7 @@ class AsyncLanguagesClient:
247
250
  raise ForbiddenError(
248
251
  typing.cast(
249
252
  typing.Optional[typing.Any],
250
- parse_obj_as(
253
+ construct_type(
251
254
  type_=typing.Optional[typing.Any], # type: ignore
252
255
  object_=_response.json(),
253
256
  ),
@@ -257,7 +260,7 @@ class AsyncLanguagesClient:
257
260
  raise InternalServerError(
258
261
  typing.cast(
259
262
  typing.Optional[typing.Any],
260
- parse_obj_as(
263
+ construct_type(
261
264
  type_=typing.Optional[typing.Any], # type: ignore
262
265
  object_=_response.json(),
263
266
  ),
@@ -267,7 +270,7 @@ class AsyncLanguagesClient:
267
270
  raise ServiceUnavailableError(
268
271
  typing.cast(
269
272
  typing.Optional[typing.Any],
270
- parse_obj_as(
273
+ construct_type(
271
274
  type_=typing.Optional[typing.Any], # type: ignore
272
275
  object_=_response.json(),
273
276
  ),
@@ -311,6 +314,7 @@ class AsyncLanguagesClient:
311
314
  """
312
315
  _response = await self._client_wrapper.httpx_client.request(
313
316
  "v1/murfdub/list-source-languages",
317
+ base_url=self._client_wrapper.get_environment().base,
314
318
  method="GET",
315
319
  request_options=request_options,
316
320
  )
@@ -318,7 +322,7 @@ class AsyncLanguagesClient:
318
322
  if 200 <= _response.status_code < 300:
319
323
  return typing.cast(
320
324
  typing.List[SourceLocaleResponse],
321
- parse_obj_as(
325
+ construct_type(
322
326
  type_=typing.List[SourceLocaleResponse], # type: ignore
323
327
  object_=_response.json(),
324
328
  ),
@@ -327,7 +331,7 @@ class AsyncLanguagesClient:
327
331
  raise BadRequestError(
328
332
  typing.cast(
329
333
  typing.Optional[typing.Any],
330
- parse_obj_as(
334
+ construct_type(
331
335
  type_=typing.Optional[typing.Any], # type: ignore
332
336
  object_=_response.json(),
333
337
  ),
@@ -337,7 +341,7 @@ class AsyncLanguagesClient:
337
341
  raise ForbiddenError(
338
342
  typing.cast(
339
343
  typing.Optional[typing.Any],
340
- parse_obj_as(
344
+ construct_type(
341
345
  type_=typing.Optional[typing.Any], # type: ignore
342
346
  object_=_response.json(),
343
347
  ),
@@ -347,7 +351,7 @@ class AsyncLanguagesClient:
347
351
  raise InternalServerError(
348
352
  typing.cast(
349
353
  typing.Optional[typing.Any],
350
- parse_obj_as(
354
+ construct_type(
351
355
  type_=typing.Optional[typing.Any], # type: ignore
352
356
  object_=_response.json(),
353
357
  ),
@@ -357,7 +361,7 @@ class AsyncLanguagesClient:
357
361
  raise ServiceUnavailableError(
358
362
  typing.cast(
359
363
  typing.Optional[typing.Any],
360
- parse_obj_as(
364
+ construct_type(
361
365
  type_=typing.Optional[typing.Any], # type: ignore
362
366
  object_=_response.json(),
363
367
  ),
@@ -5,7 +5,7 @@ from ...core.client_wrapper import SyncClientWrapper
5
5
  from .types.api_create_project_request_dubbing_type import ApiCreateProjectRequestDubbingType
6
6
  from ...core.request_options import RequestOptions
7
7
  from ...types.api_project_response import ApiProjectResponse
8
- from ...core.pydantic_utilities import parse_obj_as
8
+ from ...core.unchecked_base_model import construct_type
9
9
  from ...errors.bad_request_error import BadRequestError
10
10
  from ...errors.forbidden_error import ForbiddenError
11
11
  from ...errors.internal_server_error import InternalServerError
@@ -73,6 +73,7 @@ class ProjectsClient:
73
73
  """
74
74
  _response = self._client_wrapper.httpx_client.request(
75
75
  "v1/murfdub/projects/create",
76
+ base_url=self._client_wrapper.get_environment().base,
76
77
  method="POST",
77
78
  json={
78
79
  "name": name,
@@ -91,7 +92,7 @@ class ProjectsClient:
91
92
  if 200 <= _response.status_code < 300:
92
93
  return typing.cast(
93
94
  ApiProjectResponse,
94
- parse_obj_as(
95
+ construct_type(
95
96
  type_=ApiProjectResponse, # type: ignore
96
97
  object_=_response.json(),
97
98
  ),
@@ -100,7 +101,7 @@ class ProjectsClient:
100
101
  raise BadRequestError(
101
102
  typing.cast(
102
103
  typing.Optional[typing.Any],
103
- parse_obj_as(
104
+ construct_type(
104
105
  type_=typing.Optional[typing.Any], # type: ignore
105
106
  object_=_response.json(),
106
107
  ),
@@ -110,7 +111,7 @@ class ProjectsClient:
110
111
  raise ForbiddenError(
111
112
  typing.cast(
112
113
  typing.Optional[typing.Any],
113
- parse_obj_as(
114
+ construct_type(
114
115
  type_=typing.Optional[typing.Any], # type: ignore
115
116
  object_=_response.json(),
116
117
  ),
@@ -120,7 +121,7 @@ class ProjectsClient:
120
121
  raise InternalServerError(
121
122
  typing.cast(
122
123
  typing.Optional[typing.Any],
123
- parse_obj_as(
124
+ construct_type(
124
125
  type_=typing.Optional[typing.Any], # type: ignore
125
126
  object_=_response.json(),
126
127
  ),
@@ -130,7 +131,7 @@ class ProjectsClient:
130
131
  raise ServiceUnavailableError(
131
132
  typing.cast(
132
133
  typing.Optional[typing.Any],
133
- parse_obj_as(
134
+ construct_type(
134
135
  type_=typing.Optional[typing.Any], # type: ignore
135
136
  object_=_response.json(),
136
137
  ),
@@ -176,6 +177,7 @@ class ProjectsClient:
176
177
  """
177
178
  _response = self._client_wrapper.httpx_client.request(
178
179
  "v1/murfdub/projects/list",
180
+ base_url=self._client_wrapper.get_environment().base,
179
181
  method="GET",
180
182
  params={
181
183
  "limit": limit,
@@ -187,7 +189,7 @@ class ProjectsClient:
187
189
  if 200 <= _response.status_code < 300:
188
190
  return typing.cast(
189
191
  GroupApiProjectResponse,
190
- parse_obj_as(
192
+ construct_type(
191
193
  type_=GroupApiProjectResponse, # type: ignore
192
194
  object_=_response.json(),
193
195
  ),
@@ -196,7 +198,7 @@ class ProjectsClient:
196
198
  raise BadRequestError(
197
199
  typing.cast(
198
200
  typing.Optional[typing.Any],
199
- parse_obj_as(
201
+ construct_type(
200
202
  type_=typing.Optional[typing.Any], # type: ignore
201
203
  object_=_response.json(),
202
204
  ),
@@ -206,7 +208,7 @@ class ProjectsClient:
206
208
  raise ForbiddenError(
207
209
  typing.cast(
208
210
  typing.Optional[typing.Any],
209
- parse_obj_as(
211
+ construct_type(
210
212
  type_=typing.Optional[typing.Any], # type: ignore
211
213
  object_=_response.json(),
212
214
  ),
@@ -216,7 +218,7 @@ class ProjectsClient:
216
218
  raise InternalServerError(
217
219
  typing.cast(
218
220
  typing.Optional[typing.Any],
219
- parse_obj_as(
221
+ construct_type(
220
222
  type_=typing.Optional[typing.Any], # type: ignore
221
223
  object_=_response.json(),
222
224
  ),
@@ -226,7 +228,7 @@ class ProjectsClient:
226
228
  raise ServiceUnavailableError(
227
229
  typing.cast(
228
230
  typing.Optional[typing.Any],
229
- parse_obj_as(
231
+ construct_type(
230
232
  type_=typing.Optional[typing.Any], # type: ignore
231
233
  object_=_response.json(),
232
234
  ),
@@ -274,6 +276,7 @@ class ProjectsClient:
274
276
  """
275
277
  _response = self._client_wrapper.httpx_client.request(
276
278
  f"v1/murfdub/projects/{jsonable_encoder(project_id)}/update",
279
+ base_url=self._client_wrapper.get_environment().base,
277
280
  method="PUT",
278
281
  json={
279
282
  "target_locales": target_locales,
@@ -288,7 +291,7 @@ class ProjectsClient:
288
291
  if 200 <= _response.status_code < 300:
289
292
  return typing.cast(
290
293
  ApiProjectResponse,
291
- parse_obj_as(
294
+ construct_type(
292
295
  type_=ApiProjectResponse, # type: ignore
293
296
  object_=_response.json(),
294
297
  ),
@@ -297,7 +300,7 @@ class ProjectsClient:
297
300
  raise BadRequestError(
298
301
  typing.cast(
299
302
  typing.Optional[typing.Any],
300
- parse_obj_as(
303
+ construct_type(
301
304
  type_=typing.Optional[typing.Any], # type: ignore
302
305
  object_=_response.json(),
303
306
  ),
@@ -307,7 +310,7 @@ class ProjectsClient:
307
310
  raise ForbiddenError(
308
311
  typing.cast(
309
312
  typing.Optional[typing.Any],
310
- parse_obj_as(
313
+ construct_type(
311
314
  type_=typing.Optional[typing.Any], # type: ignore
312
315
  object_=_response.json(),
313
316
  ),
@@ -317,7 +320,7 @@ class ProjectsClient:
317
320
  raise InternalServerError(
318
321
  typing.cast(
319
322
  typing.Optional[typing.Any],
320
- parse_obj_as(
323
+ construct_type(
321
324
  type_=typing.Optional[typing.Any], # type: ignore
322
325
  object_=_response.json(),
323
326
  ),
@@ -327,7 +330,7 @@ class ProjectsClient:
327
330
  raise ServiceUnavailableError(
328
331
  typing.cast(
329
332
  typing.Optional[typing.Any],
330
- parse_obj_as(
333
+ construct_type(
331
334
  type_=typing.Optional[typing.Any], # type: ignore
332
335
  object_=_response.json(),
333
336
  ),
@@ -400,6 +403,7 @@ class AsyncProjectsClient:
400
403
  """
401
404
  _response = await self._client_wrapper.httpx_client.request(
402
405
  "v1/murfdub/projects/create",
406
+ base_url=self._client_wrapper.get_environment().base,
403
407
  method="POST",
404
408
  json={
405
409
  "name": name,
@@ -418,7 +422,7 @@ class AsyncProjectsClient:
418
422
  if 200 <= _response.status_code < 300:
419
423
  return typing.cast(
420
424
  ApiProjectResponse,
421
- parse_obj_as(
425
+ construct_type(
422
426
  type_=ApiProjectResponse, # type: ignore
423
427
  object_=_response.json(),
424
428
  ),
@@ -427,7 +431,7 @@ class AsyncProjectsClient:
427
431
  raise BadRequestError(
428
432
  typing.cast(
429
433
  typing.Optional[typing.Any],
430
- parse_obj_as(
434
+ construct_type(
431
435
  type_=typing.Optional[typing.Any], # type: ignore
432
436
  object_=_response.json(),
433
437
  ),
@@ -437,7 +441,7 @@ class AsyncProjectsClient:
437
441
  raise ForbiddenError(
438
442
  typing.cast(
439
443
  typing.Optional[typing.Any],
440
- parse_obj_as(
444
+ construct_type(
441
445
  type_=typing.Optional[typing.Any], # type: ignore
442
446
  object_=_response.json(),
443
447
  ),
@@ -447,7 +451,7 @@ class AsyncProjectsClient:
447
451
  raise InternalServerError(
448
452
  typing.cast(
449
453
  typing.Optional[typing.Any],
450
- parse_obj_as(
454
+ construct_type(
451
455
  type_=typing.Optional[typing.Any], # type: ignore
452
456
  object_=_response.json(),
453
457
  ),
@@ -457,7 +461,7 @@ class AsyncProjectsClient:
457
461
  raise ServiceUnavailableError(
458
462
  typing.cast(
459
463
  typing.Optional[typing.Any],
460
- parse_obj_as(
464
+ construct_type(
461
465
  type_=typing.Optional[typing.Any], # type: ignore
462
466
  object_=_response.json(),
463
467
  ),
@@ -511,6 +515,7 @@ class AsyncProjectsClient:
511
515
  """
512
516
  _response = await self._client_wrapper.httpx_client.request(
513
517
  "v1/murfdub/projects/list",
518
+ base_url=self._client_wrapper.get_environment().base,
514
519
  method="GET",
515
520
  params={
516
521
  "limit": limit,
@@ -522,7 +527,7 @@ class AsyncProjectsClient:
522
527
  if 200 <= _response.status_code < 300:
523
528
  return typing.cast(
524
529
  GroupApiProjectResponse,
525
- parse_obj_as(
530
+ construct_type(
526
531
  type_=GroupApiProjectResponse, # type: ignore
527
532
  object_=_response.json(),
528
533
  ),
@@ -531,7 +536,7 @@ class AsyncProjectsClient:
531
536
  raise BadRequestError(
532
537
  typing.cast(
533
538
  typing.Optional[typing.Any],
534
- parse_obj_as(
539
+ construct_type(
535
540
  type_=typing.Optional[typing.Any], # type: ignore
536
541
  object_=_response.json(),
537
542
  ),
@@ -541,7 +546,7 @@ class AsyncProjectsClient:
541
546
  raise ForbiddenError(
542
547
  typing.cast(
543
548
  typing.Optional[typing.Any],
544
- parse_obj_as(
549
+ construct_type(
545
550
  type_=typing.Optional[typing.Any], # type: ignore
546
551
  object_=_response.json(),
547
552
  ),
@@ -551,7 +556,7 @@ class AsyncProjectsClient:
551
556
  raise InternalServerError(
552
557
  typing.cast(
553
558
  typing.Optional[typing.Any],
554
- parse_obj_as(
559
+ construct_type(
555
560
  type_=typing.Optional[typing.Any], # type: ignore
556
561
  object_=_response.json(),
557
562
  ),
@@ -561,7 +566,7 @@ class AsyncProjectsClient:
561
566
  raise ServiceUnavailableError(
562
567
  typing.cast(
563
568
  typing.Optional[typing.Any],
564
- parse_obj_as(
569
+ construct_type(
565
570
  type_=typing.Optional[typing.Any], # type: ignore
566
571
  object_=_response.json(),
567
572
  ),
@@ -617,6 +622,7 @@ class AsyncProjectsClient:
617
622
  """
618
623
  _response = await self._client_wrapper.httpx_client.request(
619
624
  f"v1/murfdub/projects/{jsonable_encoder(project_id)}/update",
625
+ base_url=self._client_wrapper.get_environment().base,
620
626
  method="PUT",
621
627
  json={
622
628
  "target_locales": target_locales,
@@ -631,7 +637,7 @@ class AsyncProjectsClient:
631
637
  if 200 <= _response.status_code < 300:
632
638
  return typing.cast(
633
639
  ApiProjectResponse,
634
- parse_obj_as(
640
+ construct_type(
635
641
  type_=ApiProjectResponse, # type: ignore
636
642
  object_=_response.json(),
637
643
  ),
@@ -640,7 +646,7 @@ class AsyncProjectsClient:
640
646
  raise BadRequestError(
641
647
  typing.cast(
642
648
  typing.Optional[typing.Any],
643
- parse_obj_as(
649
+ construct_type(
644
650
  type_=typing.Optional[typing.Any], # type: ignore
645
651
  object_=_response.json(),
646
652
  ),
@@ -650,7 +656,7 @@ class AsyncProjectsClient:
650
656
  raise ForbiddenError(
651
657
  typing.cast(
652
658
  typing.Optional[typing.Any],
653
- parse_obj_as(
659
+ construct_type(
654
660
  type_=typing.Optional[typing.Any], # type: ignore
655
661
  object_=_response.json(),
656
662
  ),
@@ -660,7 +666,7 @@ class AsyncProjectsClient:
660
666
  raise InternalServerError(
661
667
  typing.cast(
662
668
  typing.Optional[typing.Any],
663
- parse_obj_as(
669
+ construct_type(
664
670
  type_=typing.Optional[typing.Any], # type: ignore
665
671
  object_=_response.json(),
666
672
  ),
@@ -670,7 +676,7 @@ class AsyncProjectsClient:
670
676
  raise ServiceUnavailableError(
671
677
  typing.cast(
672
678
  typing.Optional[typing.Any],
673
- parse_obj_as(
679
+ construct_type(
674
680
  type_=typing.Optional[typing.Any], # type: ignore
675
681
  object_=_response.json(),
676
682
  ),
murf/dubbing_client.py CHANGED
@@ -3,6 +3,7 @@ from .environment import MurfEnvironment
3
3
  import typing
4
4
  import os
5
5
  import httpx
6
+ from .version import __version__
6
7
 
7
8
  class MurfDub(BaseClient):
8
9
  """
@@ -10,8 +11,6 @@ class MurfDub(BaseClient):
10
11
 
11
12
  Parameters
12
13
  ----------
13
- base_url : typing.Optional[str]
14
- The base url to use for requests from the client.
15
14
 
16
15
  environment : MurfEnvironment
17
16
  The environment to use for requests from the client. from .environment import MurfEnvironment
@@ -44,15 +43,17 @@ class MurfDub(BaseClient):
44
43
  def __init__(
45
44
  self,
46
45
  *,
47
- base_url: typing.Optional[str] = None,
48
46
  environment: MurfEnvironment = MurfEnvironment.DEFAULT,
49
47
  api_key: typing.Optional[str] = os.getenv("MURFDUB_API_KEY"),
50
48
  timeout: typing.Optional[float] = 60,
51
49
  follow_redirects: typing.Optional[bool] = True,
52
50
  httpx_client: typing.Optional[httpx.Client] = None,
53
51
  ):
52
+ default_params = {'origin': f'python_sdk_{__version__}'}
53
+ _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
54
+ httpx_client=httpx_client if httpx_client is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout)
55
+
54
56
  super().__init__(
55
- base_url=base_url,
56
57
  environment=environment,
57
58
  api_key=api_key,
58
59
  timeout=timeout,
@@ -68,8 +69,6 @@ class AsyncMurfDub(AsyncBaseClient):
68
69
 
69
70
  Parameters
70
71
  ----------
71
- base_url : typing.Optional[str]
72
- The base url to use for requests from the client.
73
72
 
74
73
  environment : MurfEnvironment
75
74
  The environment to use for requests from the client. from .environment import MurfEnvironment
@@ -102,15 +101,17 @@ class AsyncMurfDub(AsyncBaseClient):
102
101
  def __init__(
103
102
  self,
104
103
  *,
105
- base_url: typing.Optional[str] = None,
106
104
  environment: MurfEnvironment = MurfEnvironment.DEFAULT,
107
105
  api_key: typing.Optional[str] = os.getenv("MURFDUB_API_KEY"),
108
106
  timeout: typing.Optional[float] = 60,
109
107
  follow_redirects: typing.Optional[bool] = True,
110
108
  httpx_client: typing.Optional[httpx.AsyncClient] = None,
111
109
  ):
110
+ default_params = {'origin': f'python_sdk_{__version__}'}
111
+ _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
112
+ httpx_client=httpx_client if httpx_client is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout)
113
+
112
114
  super().__init__(
113
- base_url=base_url,
114
115
  environment=environment,
115
116
  api_key=api_key,
116
117
  timeout=timeout,
murf/environment.py CHANGED
@@ -1,7 +1,14 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import enum
3
+ from __future__ import annotations
4
4
 
5
5
 
6
- class MurfEnvironment(enum.Enum):
7
- DEFAULT = "https://api.murf.ai"
6
+ class MurfEnvironment:
7
+ DEFAULT: MurfEnvironment
8
+
9
+ def __init__(self, *, base: str, production: str):
10
+ self.base = base
11
+ self.production = production
12
+
13
+
14
+ MurfEnvironment.DEFAULT = MurfEnvironment(base="https://api.murf.ai", production="wss://api.murf.ai/v1/speech")
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import ReceiveMessage, SendMessage
4
+
5
+ __all__ = ["ReceiveMessage", "SendMessage"]
@@ -0,0 +1,6 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .receive_message import ReceiveMessage
4
+ from .send_message import SendMessage
5
+
6
+ __all__ = ["ReceiveMessage", "SendMessage"]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from ...types.audio_output import AudioOutput
5
+ from ...types.final_output import FinalOutput
6
+
7
+ ReceiveMessage = typing.Union[AudioOutput, FinalOutput]
@@ -0,0 +1,9 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from ...types.set_voice_configuration import SetVoiceConfiguration
5
+ from ...types.send_text import SendText
6
+ from ...types.set_advanced_settings import SetAdvancedSettings
7
+ from ...types.clear_context import ClearContext
8
+
9
+ SendMessage = typing.Union[SetVoiceConfiguration, SendText, SetAdvancedSettings, ClearContext]