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.
- camb/__init__.py +335 -0
- camb/audio_separation/__init__.py +4 -0
- camb/audio_separation/client.py +406 -0
- camb/audio_separation/raw_client.py +534 -0
- camb/client.py +717 -0
- camb/core/__init__.py +105 -0
- camb/core/api_error.py +23 -0
- camb/core/client_wrapper.py +113 -0
- camb/core/datetime_utils.py +28 -0
- camb/core/file.py +67 -0
- camb/core/force_multipart.py +18 -0
- camb/core/http_client.py +663 -0
- camb/core/http_response.py +55 -0
- camb/core/http_sse/__init__.py +42 -0
- camb/core/http_sse/_api.py +112 -0
- camb/core/http_sse/_decoders.py +61 -0
- camb/core/http_sse/_exceptions.py +7 -0
- camb/core/http_sse/_models.py +17 -0
- camb/core/jsonable_encoder.py +100 -0
- camb/core/pydantic_utilities.py +260 -0
- camb/core/query_encoder.py +58 -0
- camb/core/remove_none_from_dict.py +11 -0
- camb/core/request_options.py +35 -0
- camb/core/serialization.py +276 -0
- camb/deprecated_streaming/__init__.py +4 -0
- camb/deprecated_streaming/client.py +532 -0
- camb/deprecated_streaming/raw_client.py +639 -0
- camb/dictionaries/__init__.py +4 -0
- camb/dictionaries/client.py +785 -0
- camb/dictionaries/raw_client.py +1048 -0
- camb/dub/__init__.py +49 -0
- camb/dub/client.py +846 -0
- camb/dub/raw_client.py +1194 -0
- camb/dub/types/__init__.py +53 -0
- camb/dub/types/dubbed_output_in_alt_format_request_payload_output_format.py +8 -0
- camb/dub/types/get_dubbed_output_in_alt_format_dub_alt_format_run_id_language_post_response.py +9 -0
- camb/dub/types/get_dubbed_run_info_dub_result_run_id_get_response.py +7 -0
- camb/dub/types/get_dubbing_runs_results_dubbing_results_post_response_value.py +7 -0
- camb/environment.py +7 -0
- camb/errors/__init__.py +34 -0
- camb/errors/unprocessable_entity_error.py +11 -0
- camb/folders/__init__.py +4 -0
- camb/folders/client.py +213 -0
- camb/folders/raw_client.py +278 -0
- camb/languages/__init__.py +4 -0
- camb/languages/client.py +168 -0
- camb/languages/raw_client.py +223 -0
- camb/project_setup/__init__.py +4 -0
- camb/project_setup/client.py +537 -0
- camb/project_setup/raw_client.py +655 -0
- camb/py.typed +0 -0
- camb/raw_client.py +236 -0
- camb/story/__init__.py +37 -0
- camb/story/client.py +579 -0
- camb/story/raw_client.py +743 -0
- camb/story/types/__init__.py +38 -0
- camb/story/types/create_story_story_post_response.py +8 -0
- camb/story/types/setup_story_story_setup_post_response.py +8 -0
- camb/streaming/__init__.py +4 -0
- camb/streaming/client.py +645 -0
- camb/streaming/raw_client.py +796 -0
- camb/text_to_audio/__init__.py +4 -0
- camb/text_to_audio/client.py +469 -0
- camb/text_to_audio/raw_client.py +610 -0
- camb/text_to_speech/__init__.py +49 -0
- camb/text_to_speech/baseten.py +214 -0
- camb/text_to_speech/client.py +742 -0
- camb/text_to_speech/raw_client.py +995 -0
- camb/text_to_speech/types/__init__.py +47 -0
- camb/text_to_speech/types/create_stream_tts_request_payload_language.py +71 -0
- camb/text_to_speech/types/create_stream_tts_request_payload_speech_model.py +7 -0
- camb/text_to_speech/types/get_tts_results_tts_results_post_response_value.py +7 -0
- camb/text_to_speech/types/get_tts_run_info_tts_result_run_id_get_response.py +7 -0
- camb/text_to_voice/__init__.py +4 -0
- camb/text_to_voice/client.py +329 -0
- camb/text_to_voice/raw_client.py +405 -0
- camb/transcription/__init__.py +4 -0
- camb/transcription/client.py +465 -0
- camb/transcription/raw_client.py +587 -0
- camb/translated_story/__init__.py +4 -0
- camb/translated_story/client.py +309 -0
- camb/translated_story/raw_client.py +381 -0
- camb/translated_tts/__init__.py +4 -0
- camb/translated_tts/client.py +313 -0
- camb/translated_tts/raw_client.py +357 -0
- camb/translation/__init__.py +4 -0
- camb/translation/client.py +631 -0
- camb/translation/raw_client.py +787 -0
- camb/types/__init__.py +236 -0
- camb/types/add_target_language_out.py +20 -0
- camb/types/audio_output_type.py +5 -0
- camb/types/audio_stream.py +31 -0
- camb/types/config_stream.py +22 -0
- camb/types/config_stream_pipeline.py +28 -0
- camb/types/create_custom_voice_out.py +19 -0
- camb/types/create_project_setup_out.py +19 -0
- camb/types/create_stream_out.py +22 -0
- camb/types/create_stream_request_payload.py +70 -0
- camb/types/create_translated_tts_out.py +19 -0
- camb/types/create_tts_out.py +19 -0
- camb/types/data_stream.py +24 -0
- camb/types/demixing_option.py +10 -0
- camb/types/dictionary_term.py +21 -0
- camb/types/dictionary_with_terms.py +28 -0
- camb/types/dubbing_result.py +22 -0
- camb/types/exception_reasons.py +30 -0
- camb/types/folder.py +20 -0
- camb/types/formalities.py +3 -0
- camb/types/gender.py +3 -0
- camb/types/get_audio_separation_result_out.py +20 -0
- camb/types/get_create_project_setup_response.py +21 -0
- camb/types/get_probe_stream_in.py +21 -0
- camb/types/get_probe_stream_out.py +24 -0
- camb/types/get_setup_story_result_response.py +21 -0
- camb/types/get_text_to_voice_result_out.py +19 -0
- camb/types/get_tts_result_out_file_url.py +19 -0
- camb/types/http_validation_error.py +20 -0
- camb/types/language_enums.py +154 -0
- camb/types/language_pydantic_model.py +21 -0
- camb/types/languages.py +3 -0
- camb/types/orchestrator_pipeline_call_result.py +19 -0
- camb/types/orchestrator_pipeline_result.py +25 -0
- camb/types/orchestrator_pipeline_result_exception_reason.py +7 -0
- camb/types/orchestrator_pipeline_result_message.py +5 -0
- camb/types/output_format.py +10 -0
- camb/types/overdub_config.py +37 -0
- camb/types/project_details.py +28 -0
- camb/types/revoicing_option.py +5 -0
- camb/types/run_i_ds_request_payload.py +19 -0
- camb/types/segmenting_option.py +5 -0
- camb/types/source_stream.py +30 -0
- camb/types/story_details.py +27 -0
- camb/types/stream_category.py +3 -0
- camb/types/stream_tts_inference_options.py +38 -0
- camb/types/stream_tts_output_configuration.py +33 -0
- camb/types/stream_tts_voice_settings.py +28 -0
- camb/types/stream_type.py +3 -0
- camb/types/stream_url_for_languages.py +21 -0
- camb/types/target_stream.py +34 -0
- camb/types/task_status.py +5 -0
- camb/types/term_translation_input.py +21 -0
- camb/types/term_translation_output.py +20 -0
- camb/types/text_to_audio_result.py +19 -0
- camb/types/text_to_audio_type.py +5 -0
- camb/types/transcribing_option.py +5 -0
- camb/types/transcript.py +22 -0
- camb/types/transcript_data_type.py +5 -0
- camb/types/transcript_file_format.py +5 -0
- camb/types/transcription_result.py +20 -0
- camb/types/translating_option.py +5 -0
- camb/types/translation_result.py +19 -0
- camb/types/tts_provider.py +3 -0
- camb/types/validation_error.py +22 -0
- camb/types/validation_error_loc_item.py +5 -0
- camb/types/video_output_type_without_avi.py +5 -0
- camb/types/video_stream.py +28 -0
- camb/types/voice.py +28 -0
- camb/voice_cloning/__init__.py +34 -0
- camb/voice_cloning/client.py +265 -0
- camb/voice_cloning/raw_client.py +320 -0
- camb/voice_cloning/types/__init__.py +36 -0
- camb/voice_cloning/types/list_voices_list_voices_get_response_item.py +7 -0
- camb_sdk-1.5.4.dist-info/METADATA +282 -0
- camb_sdk-1.5.4.dist-info/RECORD +167 -0
- camb_sdk-1.5.4.dist-info/WHEEL +5 -0
- camb_sdk-1.5.4.dist-info/licenses/LICENSE +21 -0
- camb_sdk-1.5.4.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,405 @@
|
|
|
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 ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
|
10
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
11
|
+
from ..core.request_options import RequestOptions
|
|
12
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
13
|
+
from ..types.get_text_to_voice_result_out import GetTextToVoiceResultOut
|
|
14
|
+
from ..types.http_validation_error import HttpValidationError
|
|
15
|
+
from ..types.orchestrator_pipeline_call_result import OrchestratorPipelineCallResult
|
|
16
|
+
from ..types.orchestrator_pipeline_result import OrchestratorPipelineResult
|
|
17
|
+
|
|
18
|
+
# this is used as the default value for optional parameters
|
|
19
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class RawTextToVoiceClient:
|
|
23
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
24
|
+
self._client_wrapper = client_wrapper
|
|
25
|
+
|
|
26
|
+
def create_text_to_voice(
|
|
27
|
+
self,
|
|
28
|
+
*,
|
|
29
|
+
text: str,
|
|
30
|
+
voice_description: str,
|
|
31
|
+
traceparent: typing.Optional[str] = None,
|
|
32
|
+
project_name: typing.Optional[str] = OMIT,
|
|
33
|
+
project_description: typing.Optional[str] = OMIT,
|
|
34
|
+
folder_id: typing.Optional[int] = OMIT,
|
|
35
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
36
|
+
) -> HttpResponse[OrchestratorPipelineCallResult]:
|
|
37
|
+
"""
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
text : str
|
|
41
|
+
The text to be converted to voice
|
|
42
|
+
|
|
43
|
+
voice_description : str
|
|
44
|
+
Description to use for the created voice
|
|
45
|
+
|
|
46
|
+
traceparent : typing.Optional[str]
|
|
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
|
+
"text-to-voice",
|
|
64
|
+
method="POST",
|
|
65
|
+
json={
|
|
66
|
+
"project_name": project_name,
|
|
67
|
+
"project_description": project_description,
|
|
68
|
+
"folder_id": folder_id,
|
|
69
|
+
"text": text,
|
|
70
|
+
"voice_description": voice_description,
|
|
71
|
+
},
|
|
72
|
+
headers={
|
|
73
|
+
"content-type": "application/json",
|
|
74
|
+
"traceparent": str(traceparent) if traceparent is not None else None,
|
|
75
|
+
},
|
|
76
|
+
request_options=request_options,
|
|
77
|
+
omit=OMIT,
|
|
78
|
+
)
|
|
79
|
+
try:
|
|
80
|
+
if 200 <= _response.status_code < 300:
|
|
81
|
+
_data = typing.cast(
|
|
82
|
+
OrchestratorPipelineCallResult,
|
|
83
|
+
parse_obj_as(
|
|
84
|
+
type_=OrchestratorPipelineCallResult, # type: ignore
|
|
85
|
+
object_=_response.json(),
|
|
86
|
+
),
|
|
87
|
+
)
|
|
88
|
+
return HttpResponse(response=_response, data=_data)
|
|
89
|
+
if _response.status_code == 422:
|
|
90
|
+
raise UnprocessableEntityError(
|
|
91
|
+
headers=dict(_response.headers),
|
|
92
|
+
body=typing.cast(
|
|
93
|
+
HttpValidationError,
|
|
94
|
+
parse_obj_as(
|
|
95
|
+
type_=HttpValidationError, # type: ignore
|
|
96
|
+
object_=_response.json(),
|
|
97
|
+
),
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
_response_json = _response.json()
|
|
101
|
+
except JSONDecodeError:
|
|
102
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
103
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
104
|
+
|
|
105
|
+
def get_text_to_voice_status(
|
|
106
|
+
self,
|
|
107
|
+
task_id: str,
|
|
108
|
+
*,
|
|
109
|
+
run_id: typing.Optional[int] = None,
|
|
110
|
+
traceparent: typing.Optional[str] = None,
|
|
111
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
112
|
+
) -> HttpResponse[OrchestratorPipelineResult]:
|
|
113
|
+
"""
|
|
114
|
+
Parameters
|
|
115
|
+
----------
|
|
116
|
+
task_id : str
|
|
117
|
+
|
|
118
|
+
run_id : typing.Optional[int]
|
|
119
|
+
|
|
120
|
+
traceparent : typing.Optional[str]
|
|
121
|
+
|
|
122
|
+
request_options : typing.Optional[RequestOptions]
|
|
123
|
+
Request-specific configuration.
|
|
124
|
+
|
|
125
|
+
Returns
|
|
126
|
+
-------
|
|
127
|
+
HttpResponse[OrchestratorPipelineResult]
|
|
128
|
+
Successful Response
|
|
129
|
+
"""
|
|
130
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
131
|
+
f"text-to-voice/{jsonable_encoder(task_id)}",
|
|
132
|
+
method="GET",
|
|
133
|
+
params={
|
|
134
|
+
"run_id": run_id,
|
|
135
|
+
},
|
|
136
|
+
headers={
|
|
137
|
+
"traceparent": str(traceparent) if traceparent is not None else None,
|
|
138
|
+
},
|
|
139
|
+
request_options=request_options,
|
|
140
|
+
)
|
|
141
|
+
try:
|
|
142
|
+
if 200 <= _response.status_code < 300:
|
|
143
|
+
_data = typing.cast(
|
|
144
|
+
OrchestratorPipelineResult,
|
|
145
|
+
parse_obj_as(
|
|
146
|
+
type_=OrchestratorPipelineResult, # type: ignore
|
|
147
|
+
object_=_response.json(),
|
|
148
|
+
),
|
|
149
|
+
)
|
|
150
|
+
return HttpResponse(response=_response, data=_data)
|
|
151
|
+
if _response.status_code == 422:
|
|
152
|
+
raise UnprocessableEntityError(
|
|
153
|
+
headers=dict(_response.headers),
|
|
154
|
+
body=typing.cast(
|
|
155
|
+
HttpValidationError,
|
|
156
|
+
parse_obj_as(
|
|
157
|
+
type_=HttpValidationError, # type: ignore
|
|
158
|
+
object_=_response.json(),
|
|
159
|
+
),
|
|
160
|
+
),
|
|
161
|
+
)
|
|
162
|
+
_response_json = _response.json()
|
|
163
|
+
except JSONDecodeError:
|
|
164
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
165
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
166
|
+
|
|
167
|
+
def get_text_to_voice_result(
|
|
168
|
+
self, run_id: typing.Optional[int], *, request_options: typing.Optional[RequestOptions] = None
|
|
169
|
+
) -> HttpResponse[GetTextToVoiceResultOut]:
|
|
170
|
+
"""
|
|
171
|
+
Parameters
|
|
172
|
+
----------
|
|
173
|
+
run_id : typing.Optional[int]
|
|
174
|
+
|
|
175
|
+
request_options : typing.Optional[RequestOptions]
|
|
176
|
+
Request-specific configuration.
|
|
177
|
+
|
|
178
|
+
Returns
|
|
179
|
+
-------
|
|
180
|
+
HttpResponse[GetTextToVoiceResultOut]
|
|
181
|
+
Successful Response
|
|
182
|
+
"""
|
|
183
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
184
|
+
f"text-to-voice-result/{jsonable_encoder(run_id)}",
|
|
185
|
+
method="GET",
|
|
186
|
+
request_options=request_options,
|
|
187
|
+
)
|
|
188
|
+
try:
|
|
189
|
+
if 200 <= _response.status_code < 300:
|
|
190
|
+
_data = typing.cast(
|
|
191
|
+
GetTextToVoiceResultOut,
|
|
192
|
+
parse_obj_as(
|
|
193
|
+
type_=GetTextToVoiceResultOut, # type: ignore
|
|
194
|
+
object_=_response.json(),
|
|
195
|
+
),
|
|
196
|
+
)
|
|
197
|
+
return HttpResponse(response=_response, data=_data)
|
|
198
|
+
if _response.status_code == 422:
|
|
199
|
+
raise UnprocessableEntityError(
|
|
200
|
+
headers=dict(_response.headers),
|
|
201
|
+
body=typing.cast(
|
|
202
|
+
HttpValidationError,
|
|
203
|
+
parse_obj_as(
|
|
204
|
+
type_=HttpValidationError, # type: ignore
|
|
205
|
+
object_=_response.json(),
|
|
206
|
+
),
|
|
207
|
+
),
|
|
208
|
+
)
|
|
209
|
+
_response_json = _response.json()
|
|
210
|
+
except JSONDecodeError:
|
|
211
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
212
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class AsyncRawTextToVoiceClient:
|
|
216
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
217
|
+
self._client_wrapper = client_wrapper
|
|
218
|
+
|
|
219
|
+
async def create_text_to_voice(
|
|
220
|
+
self,
|
|
221
|
+
*,
|
|
222
|
+
text: str,
|
|
223
|
+
voice_description: str,
|
|
224
|
+
traceparent: typing.Optional[str] = None,
|
|
225
|
+
project_name: typing.Optional[str] = OMIT,
|
|
226
|
+
project_description: typing.Optional[str] = OMIT,
|
|
227
|
+
folder_id: typing.Optional[int] = OMIT,
|
|
228
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
229
|
+
) -> AsyncHttpResponse[OrchestratorPipelineCallResult]:
|
|
230
|
+
"""
|
|
231
|
+
Parameters
|
|
232
|
+
----------
|
|
233
|
+
text : str
|
|
234
|
+
The text to be converted to voice
|
|
235
|
+
|
|
236
|
+
voice_description : str
|
|
237
|
+
Description to use for the created voice
|
|
238
|
+
|
|
239
|
+
traceparent : typing.Optional[str]
|
|
240
|
+
|
|
241
|
+
project_name : typing.Optional[str]
|
|
242
|
+
|
|
243
|
+
project_description : typing.Optional[str]
|
|
244
|
+
|
|
245
|
+
folder_id : typing.Optional[int]
|
|
246
|
+
|
|
247
|
+
request_options : typing.Optional[RequestOptions]
|
|
248
|
+
Request-specific configuration.
|
|
249
|
+
|
|
250
|
+
Returns
|
|
251
|
+
-------
|
|
252
|
+
AsyncHttpResponse[OrchestratorPipelineCallResult]
|
|
253
|
+
Successful Response
|
|
254
|
+
"""
|
|
255
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
256
|
+
"text-to-voice",
|
|
257
|
+
method="POST",
|
|
258
|
+
json={
|
|
259
|
+
"project_name": project_name,
|
|
260
|
+
"project_description": project_description,
|
|
261
|
+
"folder_id": folder_id,
|
|
262
|
+
"text": text,
|
|
263
|
+
"voice_description": voice_description,
|
|
264
|
+
},
|
|
265
|
+
headers={
|
|
266
|
+
"content-type": "application/json",
|
|
267
|
+
"traceparent": str(traceparent) if traceparent is not None else None,
|
|
268
|
+
},
|
|
269
|
+
request_options=request_options,
|
|
270
|
+
omit=OMIT,
|
|
271
|
+
)
|
|
272
|
+
try:
|
|
273
|
+
if 200 <= _response.status_code < 300:
|
|
274
|
+
_data = typing.cast(
|
|
275
|
+
OrchestratorPipelineCallResult,
|
|
276
|
+
parse_obj_as(
|
|
277
|
+
type_=OrchestratorPipelineCallResult, # type: ignore
|
|
278
|
+
object_=_response.json(),
|
|
279
|
+
),
|
|
280
|
+
)
|
|
281
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
282
|
+
if _response.status_code == 422:
|
|
283
|
+
raise UnprocessableEntityError(
|
|
284
|
+
headers=dict(_response.headers),
|
|
285
|
+
body=typing.cast(
|
|
286
|
+
HttpValidationError,
|
|
287
|
+
parse_obj_as(
|
|
288
|
+
type_=HttpValidationError, # type: ignore
|
|
289
|
+
object_=_response.json(),
|
|
290
|
+
),
|
|
291
|
+
),
|
|
292
|
+
)
|
|
293
|
+
_response_json = _response.json()
|
|
294
|
+
except JSONDecodeError:
|
|
295
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
296
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
297
|
+
|
|
298
|
+
async def get_text_to_voice_status(
|
|
299
|
+
self,
|
|
300
|
+
task_id: str,
|
|
301
|
+
*,
|
|
302
|
+
run_id: typing.Optional[int] = None,
|
|
303
|
+
traceparent: typing.Optional[str] = None,
|
|
304
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
305
|
+
) -> AsyncHttpResponse[OrchestratorPipelineResult]:
|
|
306
|
+
"""
|
|
307
|
+
Parameters
|
|
308
|
+
----------
|
|
309
|
+
task_id : str
|
|
310
|
+
|
|
311
|
+
run_id : typing.Optional[int]
|
|
312
|
+
|
|
313
|
+
traceparent : typing.Optional[str]
|
|
314
|
+
|
|
315
|
+
request_options : typing.Optional[RequestOptions]
|
|
316
|
+
Request-specific configuration.
|
|
317
|
+
|
|
318
|
+
Returns
|
|
319
|
+
-------
|
|
320
|
+
AsyncHttpResponse[OrchestratorPipelineResult]
|
|
321
|
+
Successful Response
|
|
322
|
+
"""
|
|
323
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
324
|
+
f"text-to-voice/{jsonable_encoder(task_id)}",
|
|
325
|
+
method="GET",
|
|
326
|
+
params={
|
|
327
|
+
"run_id": run_id,
|
|
328
|
+
},
|
|
329
|
+
headers={
|
|
330
|
+
"traceparent": str(traceparent) if traceparent is not None else None,
|
|
331
|
+
},
|
|
332
|
+
request_options=request_options,
|
|
333
|
+
)
|
|
334
|
+
try:
|
|
335
|
+
if 200 <= _response.status_code < 300:
|
|
336
|
+
_data = typing.cast(
|
|
337
|
+
OrchestratorPipelineResult,
|
|
338
|
+
parse_obj_as(
|
|
339
|
+
type_=OrchestratorPipelineResult, # type: ignore
|
|
340
|
+
object_=_response.json(),
|
|
341
|
+
),
|
|
342
|
+
)
|
|
343
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
344
|
+
if _response.status_code == 422:
|
|
345
|
+
raise UnprocessableEntityError(
|
|
346
|
+
headers=dict(_response.headers),
|
|
347
|
+
body=typing.cast(
|
|
348
|
+
HttpValidationError,
|
|
349
|
+
parse_obj_as(
|
|
350
|
+
type_=HttpValidationError, # type: ignore
|
|
351
|
+
object_=_response.json(),
|
|
352
|
+
),
|
|
353
|
+
),
|
|
354
|
+
)
|
|
355
|
+
_response_json = _response.json()
|
|
356
|
+
except JSONDecodeError:
|
|
357
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
358
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
359
|
+
|
|
360
|
+
async def get_text_to_voice_result(
|
|
361
|
+
self, run_id: typing.Optional[int], *, request_options: typing.Optional[RequestOptions] = None
|
|
362
|
+
) -> AsyncHttpResponse[GetTextToVoiceResultOut]:
|
|
363
|
+
"""
|
|
364
|
+
Parameters
|
|
365
|
+
----------
|
|
366
|
+
run_id : typing.Optional[int]
|
|
367
|
+
|
|
368
|
+
request_options : typing.Optional[RequestOptions]
|
|
369
|
+
Request-specific configuration.
|
|
370
|
+
|
|
371
|
+
Returns
|
|
372
|
+
-------
|
|
373
|
+
AsyncHttpResponse[GetTextToVoiceResultOut]
|
|
374
|
+
Successful Response
|
|
375
|
+
"""
|
|
376
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
377
|
+
f"text-to-voice-result/{jsonable_encoder(run_id)}",
|
|
378
|
+
method="GET",
|
|
379
|
+
request_options=request_options,
|
|
380
|
+
)
|
|
381
|
+
try:
|
|
382
|
+
if 200 <= _response.status_code < 300:
|
|
383
|
+
_data = typing.cast(
|
|
384
|
+
GetTextToVoiceResultOut,
|
|
385
|
+
parse_obj_as(
|
|
386
|
+
type_=GetTextToVoiceResultOut, # type: ignore
|
|
387
|
+
object_=_response.json(),
|
|
388
|
+
),
|
|
389
|
+
)
|
|
390
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
391
|
+
if _response.status_code == 422:
|
|
392
|
+
raise UnprocessableEntityError(
|
|
393
|
+
headers=dict(_response.headers),
|
|
394
|
+
body=typing.cast(
|
|
395
|
+
HttpValidationError,
|
|
396
|
+
parse_obj_as(
|
|
397
|
+
type_=HttpValidationError, # type: ignore
|
|
398
|
+
object_=_response.json(),
|
|
399
|
+
),
|
|
400
|
+
),
|
|
401
|
+
)
|
|
402
|
+
_response_json = _response.json()
|
|
403
|
+
except JSONDecodeError:
|
|
404
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
405
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|