camb-sdk 1.5.4__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.
Files changed (167) hide show
  1. camb/__init__.py +335 -0
  2. camb/audio_separation/__init__.py +4 -0
  3. camb/audio_separation/client.py +406 -0
  4. camb/audio_separation/raw_client.py +534 -0
  5. camb/client.py +717 -0
  6. camb/core/__init__.py +105 -0
  7. camb/core/api_error.py +23 -0
  8. camb/core/client_wrapper.py +113 -0
  9. camb/core/datetime_utils.py +28 -0
  10. camb/core/file.py +67 -0
  11. camb/core/force_multipart.py +18 -0
  12. camb/core/http_client.py +663 -0
  13. camb/core/http_response.py +55 -0
  14. camb/core/http_sse/__init__.py +42 -0
  15. camb/core/http_sse/_api.py +112 -0
  16. camb/core/http_sse/_decoders.py +61 -0
  17. camb/core/http_sse/_exceptions.py +7 -0
  18. camb/core/http_sse/_models.py +17 -0
  19. camb/core/jsonable_encoder.py +100 -0
  20. camb/core/pydantic_utilities.py +260 -0
  21. camb/core/query_encoder.py +58 -0
  22. camb/core/remove_none_from_dict.py +11 -0
  23. camb/core/request_options.py +35 -0
  24. camb/core/serialization.py +276 -0
  25. camb/deprecated_streaming/__init__.py +4 -0
  26. camb/deprecated_streaming/client.py +532 -0
  27. camb/deprecated_streaming/raw_client.py +639 -0
  28. camb/dictionaries/__init__.py +4 -0
  29. camb/dictionaries/client.py +785 -0
  30. camb/dictionaries/raw_client.py +1048 -0
  31. camb/dub/__init__.py +49 -0
  32. camb/dub/client.py +846 -0
  33. camb/dub/raw_client.py +1194 -0
  34. camb/dub/types/__init__.py +53 -0
  35. camb/dub/types/dubbed_output_in_alt_format_request_payload_output_format.py +8 -0
  36. camb/dub/types/get_dubbed_output_in_alt_format_dub_alt_format_run_id_language_post_response.py +9 -0
  37. camb/dub/types/get_dubbed_run_info_dub_result_run_id_get_response.py +7 -0
  38. camb/dub/types/get_dubbing_runs_results_dubbing_results_post_response_value.py +7 -0
  39. camb/environment.py +7 -0
  40. camb/errors/__init__.py +34 -0
  41. camb/errors/unprocessable_entity_error.py +11 -0
  42. camb/folders/__init__.py +4 -0
  43. camb/folders/client.py +213 -0
  44. camb/folders/raw_client.py +278 -0
  45. camb/languages/__init__.py +4 -0
  46. camb/languages/client.py +168 -0
  47. camb/languages/raw_client.py +223 -0
  48. camb/project_setup/__init__.py +4 -0
  49. camb/project_setup/client.py +537 -0
  50. camb/project_setup/raw_client.py +655 -0
  51. camb/py.typed +0 -0
  52. camb/raw_client.py +236 -0
  53. camb/story/__init__.py +37 -0
  54. camb/story/client.py +579 -0
  55. camb/story/raw_client.py +743 -0
  56. camb/story/types/__init__.py +38 -0
  57. camb/story/types/create_story_story_post_response.py +8 -0
  58. camb/story/types/setup_story_story_setup_post_response.py +8 -0
  59. camb/streaming/__init__.py +4 -0
  60. camb/streaming/client.py +645 -0
  61. camb/streaming/raw_client.py +796 -0
  62. camb/text_to_audio/__init__.py +4 -0
  63. camb/text_to_audio/client.py +469 -0
  64. camb/text_to_audio/raw_client.py +610 -0
  65. camb/text_to_speech/__init__.py +49 -0
  66. camb/text_to_speech/baseten.py +214 -0
  67. camb/text_to_speech/client.py +742 -0
  68. camb/text_to_speech/raw_client.py +995 -0
  69. camb/text_to_speech/types/__init__.py +47 -0
  70. camb/text_to_speech/types/create_stream_tts_request_payload_language.py +71 -0
  71. camb/text_to_speech/types/create_stream_tts_request_payload_speech_model.py +7 -0
  72. camb/text_to_speech/types/get_tts_results_tts_results_post_response_value.py +7 -0
  73. camb/text_to_speech/types/get_tts_run_info_tts_result_run_id_get_response.py +7 -0
  74. camb/text_to_voice/__init__.py +4 -0
  75. camb/text_to_voice/client.py +329 -0
  76. camb/text_to_voice/raw_client.py +405 -0
  77. camb/transcription/__init__.py +4 -0
  78. camb/transcription/client.py +465 -0
  79. camb/transcription/raw_client.py +587 -0
  80. camb/translated_story/__init__.py +4 -0
  81. camb/translated_story/client.py +309 -0
  82. camb/translated_story/raw_client.py +381 -0
  83. camb/translated_tts/__init__.py +4 -0
  84. camb/translated_tts/client.py +313 -0
  85. camb/translated_tts/raw_client.py +357 -0
  86. camb/translation/__init__.py +4 -0
  87. camb/translation/client.py +631 -0
  88. camb/translation/raw_client.py +787 -0
  89. camb/types/__init__.py +236 -0
  90. camb/types/add_target_language_out.py +20 -0
  91. camb/types/audio_output_type.py +5 -0
  92. camb/types/audio_stream.py +31 -0
  93. camb/types/config_stream.py +22 -0
  94. camb/types/config_stream_pipeline.py +28 -0
  95. camb/types/create_custom_voice_out.py +19 -0
  96. camb/types/create_project_setup_out.py +19 -0
  97. camb/types/create_stream_out.py +22 -0
  98. camb/types/create_stream_request_payload.py +70 -0
  99. camb/types/create_translated_tts_out.py +19 -0
  100. camb/types/create_tts_out.py +19 -0
  101. camb/types/data_stream.py +24 -0
  102. camb/types/demixing_option.py +10 -0
  103. camb/types/dictionary_term.py +21 -0
  104. camb/types/dictionary_with_terms.py +28 -0
  105. camb/types/dubbing_result.py +22 -0
  106. camb/types/exception_reasons.py +30 -0
  107. camb/types/folder.py +20 -0
  108. camb/types/formalities.py +3 -0
  109. camb/types/gender.py +3 -0
  110. camb/types/get_audio_separation_result_out.py +20 -0
  111. camb/types/get_create_project_setup_response.py +21 -0
  112. camb/types/get_probe_stream_in.py +21 -0
  113. camb/types/get_probe_stream_out.py +24 -0
  114. camb/types/get_setup_story_result_response.py +21 -0
  115. camb/types/get_text_to_voice_result_out.py +19 -0
  116. camb/types/get_tts_result_out_file_url.py +19 -0
  117. camb/types/http_validation_error.py +20 -0
  118. camb/types/language_enums.py +154 -0
  119. camb/types/language_pydantic_model.py +21 -0
  120. camb/types/languages.py +3 -0
  121. camb/types/orchestrator_pipeline_call_result.py +19 -0
  122. camb/types/orchestrator_pipeline_result.py +25 -0
  123. camb/types/orchestrator_pipeline_result_exception_reason.py +7 -0
  124. camb/types/orchestrator_pipeline_result_message.py +5 -0
  125. camb/types/output_format.py +10 -0
  126. camb/types/overdub_config.py +37 -0
  127. camb/types/project_details.py +28 -0
  128. camb/types/revoicing_option.py +5 -0
  129. camb/types/run_i_ds_request_payload.py +19 -0
  130. camb/types/segmenting_option.py +5 -0
  131. camb/types/source_stream.py +30 -0
  132. camb/types/story_details.py +27 -0
  133. camb/types/stream_category.py +3 -0
  134. camb/types/stream_tts_inference_options.py +38 -0
  135. camb/types/stream_tts_output_configuration.py +33 -0
  136. camb/types/stream_tts_voice_settings.py +28 -0
  137. camb/types/stream_type.py +3 -0
  138. camb/types/stream_url_for_languages.py +21 -0
  139. camb/types/target_stream.py +34 -0
  140. camb/types/task_status.py +5 -0
  141. camb/types/term_translation_input.py +21 -0
  142. camb/types/term_translation_output.py +20 -0
  143. camb/types/text_to_audio_result.py +19 -0
  144. camb/types/text_to_audio_type.py +5 -0
  145. camb/types/transcribing_option.py +5 -0
  146. camb/types/transcript.py +22 -0
  147. camb/types/transcript_data_type.py +5 -0
  148. camb/types/transcript_file_format.py +5 -0
  149. camb/types/transcription_result.py +20 -0
  150. camb/types/translating_option.py +5 -0
  151. camb/types/translation_result.py +19 -0
  152. camb/types/tts_provider.py +3 -0
  153. camb/types/validation_error.py +22 -0
  154. camb/types/validation_error_loc_item.py +5 -0
  155. camb/types/video_output_type_without_avi.py +5 -0
  156. camb/types/video_stream.py +28 -0
  157. camb/types/voice.py +28 -0
  158. camb/voice_cloning/__init__.py +34 -0
  159. camb/voice_cloning/client.py +265 -0
  160. camb/voice_cloning/raw_client.py +320 -0
  161. camb/voice_cloning/types/__init__.py +36 -0
  162. camb/voice_cloning/types/list_voices_list_voices_get_response_item.py +7 -0
  163. camb_sdk-1.5.4.dist-info/METADATA +282 -0
  164. camb_sdk-1.5.4.dist-info/RECORD +167 -0
  165. camb_sdk-1.5.4.dist-info/WHEEL +5 -0
  166. camb_sdk-1.5.4.dist-info/licenses/LICENSE +21 -0
  167. camb_sdk-1.5.4.dist-info/top_level.txt +1 -0
@@ -0,0 +1,534 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from .. import core
7
+ from ..core.api_error import ApiError
8
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
10
+ from ..core.jsonable_encoder import jsonable_encoder
11
+ from ..core.pydantic_utilities import parse_obj_as
12
+ from ..core.request_options import RequestOptions
13
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
14
+ from ..types.get_audio_separation_result_out import GetAudioSeparationResultOut
15
+ from ..types.http_validation_error import HttpValidationError
16
+ from ..types.orchestrator_pipeline_call_result import OrchestratorPipelineCallResult
17
+ from ..types.orchestrator_pipeline_result import OrchestratorPipelineResult
18
+
19
+ # this is used as the default value for optional parameters
20
+ OMIT = typing.cast(typing.Any, ...)
21
+
22
+
23
+ class RawAudioSeparationClient:
24
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
25
+ self._client_wrapper = client_wrapper
26
+
27
+ def create_audio_separation(
28
+ self,
29
+ *,
30
+ run_id: typing.Optional[int] = None,
31
+ traceparent: typing.Optional[str] = None,
32
+ media_file: typing.Optional[core.File] = OMIT,
33
+ project_name: typing.Optional[str] = OMIT,
34
+ project_description: typing.Optional[str] = OMIT,
35
+ folder_id: typing.Optional[int] = OMIT,
36
+ request_options: typing.Optional[RequestOptions] = None,
37
+ ) -> HttpResponse[OrchestratorPipelineCallResult]:
38
+ """
39
+ Parameters
40
+ ----------
41
+ run_id : typing.Optional[int]
42
+
43
+ traceparent : typing.Optional[str]
44
+
45
+ media_file : typing.Optional[core.File]
46
+ See core.File for more documentation
47
+
48
+ project_name : typing.Optional[str]
49
+
50
+ project_description : typing.Optional[str]
51
+
52
+ folder_id : typing.Optional[int]
53
+
54
+ request_options : typing.Optional[RequestOptions]
55
+ Request-specific configuration.
56
+
57
+ Returns
58
+ -------
59
+ HttpResponse[OrchestratorPipelineCallResult]
60
+ Successful Response
61
+ """
62
+ _response = self._client_wrapper.httpx_client.request(
63
+ "audio-separation",
64
+ method="POST",
65
+ params={
66
+ "run_id": run_id,
67
+ },
68
+ data={
69
+ "project_name": project_name,
70
+ "project_description": project_description,
71
+ "folder_id": folder_id,
72
+ },
73
+ files={
74
+ **({"media_file": media_file} if media_file is not None else {}),
75
+ },
76
+ headers={
77
+ "traceparent": str(traceparent) if traceparent is not None else None,
78
+ },
79
+ request_options=request_options,
80
+ omit=OMIT,
81
+ force_multipart=True,
82
+ )
83
+ try:
84
+ if 200 <= _response.status_code < 300:
85
+ _data = typing.cast(
86
+ OrchestratorPipelineCallResult,
87
+ parse_obj_as(
88
+ type_=OrchestratorPipelineCallResult, # type: ignore
89
+ object_=_response.json(),
90
+ ),
91
+ )
92
+ return HttpResponse(response=_response, data=_data)
93
+ if _response.status_code == 422:
94
+ raise UnprocessableEntityError(
95
+ headers=dict(_response.headers),
96
+ body=typing.cast(
97
+ HttpValidationError,
98
+ parse_obj_as(
99
+ type_=HttpValidationError, # type: ignore
100
+ object_=_response.json(),
101
+ ),
102
+ ),
103
+ )
104
+ _response_json = _response.json()
105
+ except JSONDecodeError:
106
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
107
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
108
+
109
+ def get_audio_separation_status(
110
+ self,
111
+ task_id: str,
112
+ *,
113
+ run_id: typing.Optional[int] = None,
114
+ request_options: typing.Optional[RequestOptions] = None,
115
+ ) -> HttpResponse[OrchestratorPipelineResult]:
116
+ """
117
+ Parameters
118
+ ----------
119
+ task_id : str
120
+
121
+ run_id : typing.Optional[int]
122
+
123
+ request_options : typing.Optional[RequestOptions]
124
+ Request-specific configuration.
125
+
126
+ Returns
127
+ -------
128
+ HttpResponse[OrchestratorPipelineResult]
129
+ Successful Response
130
+ """
131
+ _response = self._client_wrapper.httpx_client.request(
132
+ f"audio-separation/{jsonable_encoder(task_id)}",
133
+ method="GET",
134
+ params={
135
+ "run_id": run_id,
136
+ },
137
+ request_options=request_options,
138
+ )
139
+ try:
140
+ if 200 <= _response.status_code < 300:
141
+ _data = typing.cast(
142
+ OrchestratorPipelineResult,
143
+ parse_obj_as(
144
+ type_=OrchestratorPipelineResult, # type: ignore
145
+ object_=_response.json(),
146
+ ),
147
+ )
148
+ return HttpResponse(response=_response, data=_data)
149
+ if _response.status_code == 422:
150
+ raise UnprocessableEntityError(
151
+ headers=dict(_response.headers),
152
+ body=typing.cast(
153
+ HttpValidationError,
154
+ parse_obj_as(
155
+ type_=HttpValidationError, # type: ignore
156
+ object_=_response.json(),
157
+ ),
158
+ ),
159
+ )
160
+ _response_json = _response.json()
161
+ except JSONDecodeError:
162
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
163
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
164
+
165
+ def get_audio_separation_run_info(
166
+ self, run_id: typing.Optional[int], *, request_options: typing.Optional[RequestOptions] = None
167
+ ) -> HttpResponse[GetAudioSeparationResultOut]:
168
+ """
169
+ Parameters
170
+ ----------
171
+ run_id : typing.Optional[int]
172
+
173
+ request_options : typing.Optional[RequestOptions]
174
+ Request-specific configuration.
175
+
176
+ Returns
177
+ -------
178
+ HttpResponse[GetAudioSeparationResultOut]
179
+ Successful Response
180
+ """
181
+ _response = self._client_wrapper.httpx_client.request(
182
+ f"audio-separation-result/{jsonable_encoder(run_id)}",
183
+ method="GET",
184
+ request_options=request_options,
185
+ )
186
+ try:
187
+ if 200 <= _response.status_code < 300:
188
+ _data = typing.cast(
189
+ GetAudioSeparationResultOut,
190
+ parse_obj_as(
191
+ type_=GetAudioSeparationResultOut, # type: ignore
192
+ object_=_response.json(),
193
+ ),
194
+ )
195
+ return HttpResponse(response=_response, data=_data)
196
+ if _response.status_code == 422:
197
+ raise UnprocessableEntityError(
198
+ headers=dict(_response.headers),
199
+ body=typing.cast(
200
+ HttpValidationError,
201
+ parse_obj_as(
202
+ type_=HttpValidationError, # type: ignore
203
+ object_=_response.json(),
204
+ ),
205
+ ),
206
+ )
207
+ _response_json = _response.json()
208
+ except JSONDecodeError:
209
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
210
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
211
+
212
+ def get_audio_separation_runs_results(
213
+ self,
214
+ *,
215
+ run_ids: typing.Sequence[int],
216
+ run_id: typing.Optional[int] = None,
217
+ traceparent: typing.Optional[str] = None,
218
+ request_options: typing.Optional[RequestOptions] = None,
219
+ ) -> HttpResponse[typing.Dict[str, GetAudioSeparationResultOut]]:
220
+ """
221
+ Parameters
222
+ ----------
223
+ run_ids : typing.Sequence[int]
224
+
225
+ run_id : typing.Optional[int]
226
+
227
+ traceparent : typing.Optional[str]
228
+
229
+ request_options : typing.Optional[RequestOptions]
230
+ Request-specific configuration.
231
+
232
+ Returns
233
+ -------
234
+ HttpResponse[typing.Dict[str, GetAudioSeparationResultOut]]
235
+ Successful Response
236
+ """
237
+ _response = self._client_wrapper.httpx_client.request(
238
+ "audio-separation-results",
239
+ method="POST",
240
+ params={
241
+ "run_id": run_id,
242
+ },
243
+ json={
244
+ "run_ids": run_ids,
245
+ },
246
+ headers={
247
+ "content-type": "application/json",
248
+ "traceparent": str(traceparent) if traceparent is not None else None,
249
+ },
250
+ request_options=request_options,
251
+ omit=OMIT,
252
+ )
253
+ try:
254
+ if 200 <= _response.status_code < 300:
255
+ _data = typing.cast(
256
+ typing.Dict[str, GetAudioSeparationResultOut],
257
+ parse_obj_as(
258
+ type_=typing.Dict[str, GetAudioSeparationResultOut], # type: ignore
259
+ object_=_response.json(),
260
+ ),
261
+ )
262
+ return HttpResponse(response=_response, data=_data)
263
+ if _response.status_code == 422:
264
+ raise UnprocessableEntityError(
265
+ headers=dict(_response.headers),
266
+ body=typing.cast(
267
+ HttpValidationError,
268
+ parse_obj_as(
269
+ type_=HttpValidationError, # type: ignore
270
+ object_=_response.json(),
271
+ ),
272
+ ),
273
+ )
274
+ _response_json = _response.json()
275
+ except JSONDecodeError:
276
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
277
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
278
+
279
+
280
+ class AsyncRawAudioSeparationClient:
281
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
282
+ self._client_wrapper = client_wrapper
283
+
284
+ async def create_audio_separation(
285
+ self,
286
+ *,
287
+ run_id: typing.Optional[int] = None,
288
+ traceparent: typing.Optional[str] = None,
289
+ media_file: typing.Optional[core.File] = OMIT,
290
+ project_name: typing.Optional[str] = OMIT,
291
+ project_description: typing.Optional[str] = OMIT,
292
+ folder_id: typing.Optional[int] = OMIT,
293
+ request_options: typing.Optional[RequestOptions] = None,
294
+ ) -> AsyncHttpResponse[OrchestratorPipelineCallResult]:
295
+ """
296
+ Parameters
297
+ ----------
298
+ run_id : typing.Optional[int]
299
+
300
+ traceparent : typing.Optional[str]
301
+
302
+ media_file : typing.Optional[core.File]
303
+ See core.File for more documentation
304
+
305
+ project_name : typing.Optional[str]
306
+
307
+ project_description : typing.Optional[str]
308
+
309
+ folder_id : typing.Optional[int]
310
+
311
+ request_options : typing.Optional[RequestOptions]
312
+ Request-specific configuration.
313
+
314
+ Returns
315
+ -------
316
+ AsyncHttpResponse[OrchestratorPipelineCallResult]
317
+ Successful Response
318
+ """
319
+ _response = await self._client_wrapper.httpx_client.request(
320
+ "audio-separation",
321
+ method="POST",
322
+ params={
323
+ "run_id": run_id,
324
+ },
325
+ data={
326
+ "project_name": project_name,
327
+ "project_description": project_description,
328
+ "folder_id": folder_id,
329
+ },
330
+ files={
331
+ **({"media_file": media_file} if media_file is not None else {}),
332
+ },
333
+ headers={
334
+ "traceparent": str(traceparent) if traceparent is not None else None,
335
+ },
336
+ request_options=request_options,
337
+ omit=OMIT,
338
+ force_multipart=True,
339
+ )
340
+ try:
341
+ if 200 <= _response.status_code < 300:
342
+ _data = typing.cast(
343
+ OrchestratorPipelineCallResult,
344
+ parse_obj_as(
345
+ type_=OrchestratorPipelineCallResult, # type: ignore
346
+ object_=_response.json(),
347
+ ),
348
+ )
349
+ return AsyncHttpResponse(response=_response, data=_data)
350
+ if _response.status_code == 422:
351
+ raise UnprocessableEntityError(
352
+ headers=dict(_response.headers),
353
+ body=typing.cast(
354
+ HttpValidationError,
355
+ parse_obj_as(
356
+ type_=HttpValidationError, # type: ignore
357
+ object_=_response.json(),
358
+ ),
359
+ ),
360
+ )
361
+ _response_json = _response.json()
362
+ except JSONDecodeError:
363
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
364
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
365
+
366
+ async def get_audio_separation_status(
367
+ self,
368
+ task_id: str,
369
+ *,
370
+ run_id: typing.Optional[int] = None,
371
+ request_options: typing.Optional[RequestOptions] = None,
372
+ ) -> AsyncHttpResponse[OrchestratorPipelineResult]:
373
+ """
374
+ Parameters
375
+ ----------
376
+ task_id : str
377
+
378
+ run_id : typing.Optional[int]
379
+
380
+ request_options : typing.Optional[RequestOptions]
381
+ Request-specific configuration.
382
+
383
+ Returns
384
+ -------
385
+ AsyncHttpResponse[OrchestratorPipelineResult]
386
+ Successful Response
387
+ """
388
+ _response = await self._client_wrapper.httpx_client.request(
389
+ f"audio-separation/{jsonable_encoder(task_id)}",
390
+ method="GET",
391
+ params={
392
+ "run_id": run_id,
393
+ },
394
+ request_options=request_options,
395
+ )
396
+ try:
397
+ if 200 <= _response.status_code < 300:
398
+ _data = typing.cast(
399
+ OrchestratorPipelineResult,
400
+ parse_obj_as(
401
+ type_=OrchestratorPipelineResult, # type: ignore
402
+ object_=_response.json(),
403
+ ),
404
+ )
405
+ return AsyncHttpResponse(response=_response, data=_data)
406
+ if _response.status_code == 422:
407
+ raise UnprocessableEntityError(
408
+ headers=dict(_response.headers),
409
+ body=typing.cast(
410
+ HttpValidationError,
411
+ parse_obj_as(
412
+ type_=HttpValidationError, # type: ignore
413
+ object_=_response.json(),
414
+ ),
415
+ ),
416
+ )
417
+ _response_json = _response.json()
418
+ except JSONDecodeError:
419
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
420
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
421
+
422
+ async def get_audio_separation_run_info(
423
+ self, run_id: typing.Optional[int], *, request_options: typing.Optional[RequestOptions] = None
424
+ ) -> AsyncHttpResponse[GetAudioSeparationResultOut]:
425
+ """
426
+ Parameters
427
+ ----------
428
+ run_id : typing.Optional[int]
429
+
430
+ request_options : typing.Optional[RequestOptions]
431
+ Request-specific configuration.
432
+
433
+ Returns
434
+ -------
435
+ AsyncHttpResponse[GetAudioSeparationResultOut]
436
+ Successful Response
437
+ """
438
+ _response = await self._client_wrapper.httpx_client.request(
439
+ f"audio-separation-result/{jsonable_encoder(run_id)}",
440
+ method="GET",
441
+ request_options=request_options,
442
+ )
443
+ try:
444
+ if 200 <= _response.status_code < 300:
445
+ _data = typing.cast(
446
+ GetAudioSeparationResultOut,
447
+ parse_obj_as(
448
+ type_=GetAudioSeparationResultOut, # type: ignore
449
+ object_=_response.json(),
450
+ ),
451
+ )
452
+ return AsyncHttpResponse(response=_response, data=_data)
453
+ if _response.status_code == 422:
454
+ raise UnprocessableEntityError(
455
+ headers=dict(_response.headers),
456
+ body=typing.cast(
457
+ HttpValidationError,
458
+ parse_obj_as(
459
+ type_=HttpValidationError, # type: ignore
460
+ object_=_response.json(),
461
+ ),
462
+ ),
463
+ )
464
+ _response_json = _response.json()
465
+ except JSONDecodeError:
466
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
467
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
468
+
469
+ async def get_audio_separation_runs_results(
470
+ self,
471
+ *,
472
+ run_ids: typing.Sequence[int],
473
+ run_id: typing.Optional[int] = None,
474
+ traceparent: typing.Optional[str] = None,
475
+ request_options: typing.Optional[RequestOptions] = None,
476
+ ) -> AsyncHttpResponse[typing.Dict[str, GetAudioSeparationResultOut]]:
477
+ """
478
+ Parameters
479
+ ----------
480
+ run_ids : typing.Sequence[int]
481
+
482
+ run_id : typing.Optional[int]
483
+
484
+ traceparent : typing.Optional[str]
485
+
486
+ request_options : typing.Optional[RequestOptions]
487
+ Request-specific configuration.
488
+
489
+ Returns
490
+ -------
491
+ AsyncHttpResponse[typing.Dict[str, GetAudioSeparationResultOut]]
492
+ Successful Response
493
+ """
494
+ _response = await self._client_wrapper.httpx_client.request(
495
+ "audio-separation-results",
496
+ method="POST",
497
+ params={
498
+ "run_id": run_id,
499
+ },
500
+ json={
501
+ "run_ids": run_ids,
502
+ },
503
+ headers={
504
+ "content-type": "application/json",
505
+ "traceparent": str(traceparent) if traceparent is not None else None,
506
+ },
507
+ request_options=request_options,
508
+ omit=OMIT,
509
+ )
510
+ try:
511
+ if 200 <= _response.status_code < 300:
512
+ _data = typing.cast(
513
+ typing.Dict[str, GetAudioSeparationResultOut],
514
+ parse_obj_as(
515
+ type_=typing.Dict[str, GetAudioSeparationResultOut], # type: ignore
516
+ object_=_response.json(),
517
+ ),
518
+ )
519
+ return AsyncHttpResponse(response=_response, data=_data)
520
+ if _response.status_code == 422:
521
+ raise UnprocessableEntityError(
522
+ headers=dict(_response.headers),
523
+ body=typing.cast(
524
+ HttpValidationError,
525
+ parse_obj_as(
526
+ type_=HttpValidationError, # type: ignore
527
+ object_=_response.json(),
528
+ ),
529
+ ),
530
+ )
531
+ _response_json = _response.json()
532
+ except JSONDecodeError:
533
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
534
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)