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
camb/dub/client.py
ADDED
|
@@ -0,0 +1,846 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.languages import Languages
|
|
8
|
+
from ..types.orchestrator_pipeline_call_result import OrchestratorPipelineCallResult
|
|
9
|
+
from ..types.orchestrator_pipeline_result import OrchestratorPipelineResult
|
|
10
|
+
from ..types.transcript_data_type import TranscriptDataType
|
|
11
|
+
from ..types.transcript_file_format import TranscriptFileFormat
|
|
12
|
+
from .raw_client import AsyncRawDubClient, RawDubClient
|
|
13
|
+
from .types.dubbed_output_in_alt_format_request_payload_output_format import (
|
|
14
|
+
DubbedOutputInAltFormatRequestPayloadOutputFormat,
|
|
15
|
+
)
|
|
16
|
+
from .types.get_dubbed_output_in_alt_format_dub_alt_format_run_id_language_post_response import (
|
|
17
|
+
GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse,
|
|
18
|
+
)
|
|
19
|
+
from .types.get_dubbed_run_info_dub_result_run_id_get_response import GetDubbedRunInfoDubResultRunIdGetResponse
|
|
20
|
+
from .types.get_dubbing_runs_results_dubbing_results_post_response_value import (
|
|
21
|
+
GetDubbingRunsResultsDubbingResultsPostResponseValue,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# this is used as the default value for optional parameters
|
|
25
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DubClient:
|
|
29
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
30
|
+
self._raw_client = RawDubClient(client_wrapper=client_wrapper)
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def with_raw_response(self) -> RawDubClient:
|
|
34
|
+
"""
|
|
35
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
RawDubClient
|
|
40
|
+
"""
|
|
41
|
+
return self._raw_client
|
|
42
|
+
|
|
43
|
+
def create_dub(
|
|
44
|
+
self,
|
|
45
|
+
*,
|
|
46
|
+
video_url: str,
|
|
47
|
+
source_language: Languages,
|
|
48
|
+
run_id: typing.Optional[int] = None,
|
|
49
|
+
project_name: typing.Optional[str] = OMIT,
|
|
50
|
+
project_description: typing.Optional[str] = OMIT,
|
|
51
|
+
folder_id: typing.Optional[int] = OMIT,
|
|
52
|
+
target_language: typing.Optional[Languages] = OMIT,
|
|
53
|
+
target_languages: typing.Optional[typing.Sequence[Languages]] = OMIT,
|
|
54
|
+
selected_audio_tracks: typing.Optional[typing.Sequence[int]] = OMIT,
|
|
55
|
+
add_output_as_an_audio_track: typing.Optional[bool] = OMIT,
|
|
56
|
+
chosen_dictionaries: typing.Optional[typing.Sequence[int]] = OMIT,
|
|
57
|
+
ai_optimization: typing.Optional[bool] = OMIT,
|
|
58
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
59
|
+
) -> OrchestratorPipelineCallResult:
|
|
60
|
+
"""
|
|
61
|
+
Parameters
|
|
62
|
+
----------
|
|
63
|
+
video_url : str
|
|
64
|
+
|
|
65
|
+
source_language : Languages
|
|
66
|
+
|
|
67
|
+
run_id : typing.Optional[int]
|
|
68
|
+
|
|
69
|
+
project_name : typing.Optional[str]
|
|
70
|
+
|
|
71
|
+
project_description : typing.Optional[str]
|
|
72
|
+
|
|
73
|
+
folder_id : typing.Optional[int]
|
|
74
|
+
|
|
75
|
+
target_language : typing.Optional[Languages]
|
|
76
|
+
|
|
77
|
+
target_languages : typing.Optional[typing.Sequence[Languages]]
|
|
78
|
+
|
|
79
|
+
selected_audio_tracks : typing.Optional[typing.Sequence[int]]
|
|
80
|
+
|
|
81
|
+
add_output_as_an_audio_track : typing.Optional[bool]
|
|
82
|
+
|
|
83
|
+
chosen_dictionaries : typing.Optional[typing.Sequence[int]]
|
|
84
|
+
|
|
85
|
+
ai_optimization : typing.Optional[bool]
|
|
86
|
+
|
|
87
|
+
request_options : typing.Optional[RequestOptions]
|
|
88
|
+
Request-specific configuration.
|
|
89
|
+
|
|
90
|
+
Returns
|
|
91
|
+
-------
|
|
92
|
+
OrchestratorPipelineCallResult
|
|
93
|
+
Successful Response
|
|
94
|
+
|
|
95
|
+
Examples
|
|
96
|
+
--------
|
|
97
|
+
from camb import CambApi
|
|
98
|
+
|
|
99
|
+
client = CambApi(
|
|
100
|
+
api_key="YOUR_API_KEY",
|
|
101
|
+
)
|
|
102
|
+
client.dub.end_to_end_dubbing(
|
|
103
|
+
video_url="video_url",
|
|
104
|
+
source_language=1,
|
|
105
|
+
)
|
|
106
|
+
"""
|
|
107
|
+
_response = self._raw_client.end_to_end_dubbing(
|
|
108
|
+
video_url=video_url,
|
|
109
|
+
source_language=source_language,
|
|
110
|
+
run_id=run_id,
|
|
111
|
+
project_name=project_name,
|
|
112
|
+
project_description=project_description,
|
|
113
|
+
folder_id=folder_id,
|
|
114
|
+
target_language=target_language,
|
|
115
|
+
target_languages=target_languages,
|
|
116
|
+
selected_audio_tracks=selected_audio_tracks,
|
|
117
|
+
add_output_as_an_audio_track=add_output_as_an_audio_track,
|
|
118
|
+
chosen_dictionaries=chosen_dictionaries,
|
|
119
|
+
ai_optimization=ai_optimization,
|
|
120
|
+
request_options=request_options,
|
|
121
|
+
)
|
|
122
|
+
return _response.data
|
|
123
|
+
|
|
124
|
+
def get_dubbing_status(
|
|
125
|
+
self,
|
|
126
|
+
task_id: str,
|
|
127
|
+
*,
|
|
128
|
+
run_id: typing.Optional[int] = None,
|
|
129
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
130
|
+
) -> OrchestratorPipelineResult:
|
|
131
|
+
"""
|
|
132
|
+
Parameters
|
|
133
|
+
----------
|
|
134
|
+
task_id : str
|
|
135
|
+
|
|
136
|
+
run_id : typing.Optional[int]
|
|
137
|
+
|
|
138
|
+
request_options : typing.Optional[RequestOptions]
|
|
139
|
+
Request-specific configuration.
|
|
140
|
+
|
|
141
|
+
Returns
|
|
142
|
+
-------
|
|
143
|
+
OrchestratorPipelineResult
|
|
144
|
+
Successful Response
|
|
145
|
+
|
|
146
|
+
Examples
|
|
147
|
+
--------
|
|
148
|
+
from camb import CambApi
|
|
149
|
+
|
|
150
|
+
client = CambApi(
|
|
151
|
+
api_key="YOUR_API_KEY",
|
|
152
|
+
)
|
|
153
|
+
client.dub.get_dubbing_status(
|
|
154
|
+
task_id="task_id",
|
|
155
|
+
)
|
|
156
|
+
"""
|
|
157
|
+
_response = self._raw_client.get_end_to_end_dubbing_status(
|
|
158
|
+
task_id, run_id=run_id, request_options=request_options
|
|
159
|
+
)
|
|
160
|
+
return _response.data
|
|
161
|
+
|
|
162
|
+
def get_dubbed_run_info(
|
|
163
|
+
self, run_id: typing.Optional[int], *, request_options: typing.Optional[RequestOptions] = None
|
|
164
|
+
) -> GetDubbedRunInfoDubResultRunIdGetResponse:
|
|
165
|
+
"""
|
|
166
|
+
NOTE: This endpoint should be called only by the users to get values for their runs via API.
|
|
167
|
+
Further we need to validate if the user has access to the run_id, otherwise we should not return the output urls.
|
|
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
|
+
GetDubbedRunInfoDubResultRunIdGetResponse
|
|
179
|
+
Successful Response
|
|
180
|
+
|
|
181
|
+
Examples
|
|
182
|
+
--------
|
|
183
|
+
from camb import CambApi
|
|
184
|
+
|
|
185
|
+
client = CambApi(
|
|
186
|
+
api_key="YOUR_API_KEY",
|
|
187
|
+
)
|
|
188
|
+
client.dub.get_dubbed_run_info(
|
|
189
|
+
run_id=1,
|
|
190
|
+
)
|
|
191
|
+
"""
|
|
192
|
+
_response = self._raw_client.get_dubbed_run_info(run_id, request_options=request_options)
|
|
193
|
+
return _response.data
|
|
194
|
+
|
|
195
|
+
def get_dubbed_runs_results(
|
|
196
|
+
self,
|
|
197
|
+
*,
|
|
198
|
+
run_ids: typing.Sequence[int],
|
|
199
|
+
run_id: typing.Optional[int] = None,
|
|
200
|
+
traceparent: typing.Optional[str] = None,
|
|
201
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
202
|
+
) -> typing.Dict[str, GetDubbingRunsResultsDubbingResultsPostResponseValue]:
|
|
203
|
+
"""
|
|
204
|
+
Parameters
|
|
205
|
+
----------
|
|
206
|
+
run_ids : typing.Sequence[int]
|
|
207
|
+
|
|
208
|
+
run_id : typing.Optional[int]
|
|
209
|
+
|
|
210
|
+
traceparent : typing.Optional[str]
|
|
211
|
+
|
|
212
|
+
request_options : typing.Optional[RequestOptions]
|
|
213
|
+
Request-specific configuration.
|
|
214
|
+
|
|
215
|
+
Returns
|
|
216
|
+
-------
|
|
217
|
+
typing.Dict[str, GetDubbingRunsResultsDubbingResultsPostResponseValue]
|
|
218
|
+
Successful Response
|
|
219
|
+
|
|
220
|
+
Examples
|
|
221
|
+
--------
|
|
222
|
+
from camb import CambApi
|
|
223
|
+
|
|
224
|
+
client = CambApi(
|
|
225
|
+
api_key="YOUR_API_KEY",
|
|
226
|
+
)
|
|
227
|
+
client.dub.get_dubbed_runs_results(
|
|
228
|
+
run_ids=[1],
|
|
229
|
+
)
|
|
230
|
+
"""
|
|
231
|
+
_response = self._raw_client.get_dubbing_runs_results(
|
|
232
|
+
run_ids=run_ids, run_id=run_id, traceparent=traceparent, request_options=request_options
|
|
233
|
+
)
|
|
234
|
+
return _response.data
|
|
235
|
+
|
|
236
|
+
def get_dubbed_run_transcript(
|
|
237
|
+
self,
|
|
238
|
+
run_id: typing.Optional[int],
|
|
239
|
+
language: Languages,
|
|
240
|
+
*,
|
|
241
|
+
format_type: typing.Optional[TranscriptFileFormat] = None,
|
|
242
|
+
data_type: typing.Optional[TranscriptDataType] = None,
|
|
243
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
244
|
+
) -> typing.Dict[str, str]:
|
|
245
|
+
"""
|
|
246
|
+
Parameters
|
|
247
|
+
----------
|
|
248
|
+
run_id : typing.Optional[int]
|
|
249
|
+
|
|
250
|
+
language : Languages
|
|
251
|
+
|
|
252
|
+
format_type : typing.Optional[TranscriptFileFormat]
|
|
253
|
+
Format to use for the transcription. Either `srt`, `vtt` or `txt`. Defaults to `txt`.
|
|
254
|
+
|
|
255
|
+
data_type : typing.Optional[TranscriptDataType]
|
|
256
|
+
Data type for the transcription being returned. Returns the raw data of the transcription or a presigned url for the file that holds the transcription data.
|
|
257
|
+
|
|
258
|
+
request_options : typing.Optional[RequestOptions]
|
|
259
|
+
Request-specific configuration.
|
|
260
|
+
|
|
261
|
+
Returns
|
|
262
|
+
-------
|
|
263
|
+
typing.Dict[str, str]
|
|
264
|
+
Successful Response
|
|
265
|
+
|
|
266
|
+
Examples
|
|
267
|
+
--------
|
|
268
|
+
from camb import CambApi
|
|
269
|
+
|
|
270
|
+
client = CambApi(
|
|
271
|
+
api_key="YOUR_API_KEY",
|
|
272
|
+
)
|
|
273
|
+
client.dub.get_dubbed_run_transcript(
|
|
274
|
+
run_id=1,
|
|
275
|
+
language=1,
|
|
276
|
+
)
|
|
277
|
+
"""
|
|
278
|
+
_response = self._raw_client.get_dubbed_run_transcript(
|
|
279
|
+
run_id, language, format_type=format_type, data_type=data_type, request_options=request_options
|
|
280
|
+
)
|
|
281
|
+
return _response.data
|
|
282
|
+
|
|
283
|
+
def get_dubbed_output_in_alt_format(
|
|
284
|
+
self,
|
|
285
|
+
run_id: typing.Optional[int],
|
|
286
|
+
language: Languages,
|
|
287
|
+
*,
|
|
288
|
+
output_format: DubbedOutputInAltFormatRequestPayloadOutputFormat,
|
|
289
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
290
|
+
) -> GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse:
|
|
291
|
+
"""
|
|
292
|
+
Parameters
|
|
293
|
+
----------
|
|
294
|
+
run_id : typing.Optional[int]
|
|
295
|
+
|
|
296
|
+
language : Languages
|
|
297
|
+
|
|
298
|
+
output_format : DubbedOutputInAltFormatRequestPayloadOutputFormat
|
|
299
|
+
|
|
300
|
+
request_options : typing.Optional[RequestOptions]
|
|
301
|
+
Request-specific configuration.
|
|
302
|
+
|
|
303
|
+
Returns
|
|
304
|
+
-------
|
|
305
|
+
GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse
|
|
306
|
+
Successful Response
|
|
307
|
+
|
|
308
|
+
Examples
|
|
309
|
+
--------
|
|
310
|
+
from camb import CambApi
|
|
311
|
+
|
|
312
|
+
client = CambApi(
|
|
313
|
+
api_key="YOUR_API_KEY",
|
|
314
|
+
)
|
|
315
|
+
client.dub.get_dubbed_output_in_alt_format(
|
|
316
|
+
run_id=1,
|
|
317
|
+
language=1,
|
|
318
|
+
output_format="flac",
|
|
319
|
+
)
|
|
320
|
+
"""
|
|
321
|
+
_response = self._raw_client.get_dubbed_output_in_alt_format(
|
|
322
|
+
run_id, language, output_format=output_format, request_options=request_options
|
|
323
|
+
)
|
|
324
|
+
return _response.data
|
|
325
|
+
|
|
326
|
+
def get_dubbed_output_in_alt_format_status(
|
|
327
|
+
self,
|
|
328
|
+
task_id: str,
|
|
329
|
+
*,
|
|
330
|
+
run_id: typing.Optional[int] = None,
|
|
331
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
332
|
+
) -> OrchestratorPipelineResult:
|
|
333
|
+
"""
|
|
334
|
+
Parameters
|
|
335
|
+
----------
|
|
336
|
+
task_id : str
|
|
337
|
+
|
|
338
|
+
run_id : typing.Optional[int]
|
|
339
|
+
|
|
340
|
+
request_options : typing.Optional[RequestOptions]
|
|
341
|
+
Request-specific configuration.
|
|
342
|
+
|
|
343
|
+
Returns
|
|
344
|
+
-------
|
|
345
|
+
OrchestratorPipelineResult
|
|
346
|
+
Successful Response
|
|
347
|
+
|
|
348
|
+
Examples
|
|
349
|
+
--------
|
|
350
|
+
from camb import CambApi
|
|
351
|
+
|
|
352
|
+
client = CambApi(
|
|
353
|
+
api_key="YOUR_API_KEY",
|
|
354
|
+
)
|
|
355
|
+
client.dub.get_dubbed_output_in_alt_format_status(
|
|
356
|
+
task_id="task_id",
|
|
357
|
+
)
|
|
358
|
+
"""
|
|
359
|
+
_response = self._raw_client.get_dubbed_output_in_alt_format_status(
|
|
360
|
+
task_id, run_id=run_id, request_options=request_options
|
|
361
|
+
)
|
|
362
|
+
return _response.data
|
|
363
|
+
|
|
364
|
+
class AsyncDubClient:
|
|
365
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
366
|
+
self._raw_client = AsyncRawDubClient(client_wrapper=client_wrapper)
|
|
367
|
+
|
|
368
|
+
@property
|
|
369
|
+
def with_raw_response(self) -> AsyncRawDubClient:
|
|
370
|
+
"""
|
|
371
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
372
|
+
|
|
373
|
+
Returns
|
|
374
|
+
-------
|
|
375
|
+
AsyncRawDubClient
|
|
376
|
+
"""
|
|
377
|
+
return self._raw_client
|
|
378
|
+
|
|
379
|
+
async def create_dub(
|
|
380
|
+
self,
|
|
381
|
+
*,
|
|
382
|
+
video_url: str,
|
|
383
|
+
source_language: Languages,
|
|
384
|
+
run_id: typing.Optional[int] = None,
|
|
385
|
+
project_name: typing.Optional[str] = OMIT,
|
|
386
|
+
project_description: typing.Optional[str] = OMIT,
|
|
387
|
+
folder_id: typing.Optional[int] = OMIT,
|
|
388
|
+
target_language: typing.Optional[Languages] = OMIT,
|
|
389
|
+
target_languages: typing.Optional[typing.Sequence[Languages]] = OMIT,
|
|
390
|
+
selected_audio_tracks: typing.Optional[typing.Sequence[int]] = OMIT,
|
|
391
|
+
add_output_as_an_audio_track: typing.Optional[bool] = OMIT,
|
|
392
|
+
chosen_dictionaries: typing.Optional[typing.Sequence[int]] = OMIT,
|
|
393
|
+
ai_optimization: typing.Optional[bool] = OMIT,
|
|
394
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
395
|
+
) -> OrchestratorPipelineCallResult:
|
|
396
|
+
"""
|
|
397
|
+
Parameters
|
|
398
|
+
----------
|
|
399
|
+
video_url : str
|
|
400
|
+
|
|
401
|
+
source_language : Languages
|
|
402
|
+
|
|
403
|
+
run_id : typing.Optional[int]
|
|
404
|
+
|
|
405
|
+
project_name : typing.Optional[str]
|
|
406
|
+
|
|
407
|
+
project_description : typing.Optional[str]
|
|
408
|
+
|
|
409
|
+
folder_id : typing.Optional[int]
|
|
410
|
+
|
|
411
|
+
target_language : typing.Optional[Languages]
|
|
412
|
+
|
|
413
|
+
target_languages : typing.Optional[typing.Sequence[Languages]]
|
|
414
|
+
|
|
415
|
+
selected_audio_tracks : typing.Optional[typing.Sequence[int]]
|
|
416
|
+
|
|
417
|
+
add_output_as_an_audio_track : typing.Optional[bool]
|
|
418
|
+
|
|
419
|
+
chosen_dictionaries : typing.Optional[typing.Sequence[int]]
|
|
420
|
+
|
|
421
|
+
ai_optimization : typing.Optional[bool]
|
|
422
|
+
|
|
423
|
+
request_options : typing.Optional[RequestOptions]
|
|
424
|
+
Request-specific configuration.
|
|
425
|
+
|
|
426
|
+
Returns
|
|
427
|
+
-------
|
|
428
|
+
OrchestratorPipelineCallResult
|
|
429
|
+
Successful Response
|
|
430
|
+
|
|
431
|
+
Examples
|
|
432
|
+
--------
|
|
433
|
+
import asyncio
|
|
434
|
+
|
|
435
|
+
from camb import AsyncCambApi
|
|
436
|
+
|
|
437
|
+
client = AsyncCambApi(
|
|
438
|
+
api_key="YOUR_API_KEY",
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
async def main() -> None:
|
|
443
|
+
await client.dub.create_dub(
|
|
444
|
+
video_url="video_url",
|
|
445
|
+
source_language=1,
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
asyncio.run(main())
|
|
450
|
+
"""
|
|
451
|
+
_response = await self._raw_client.end_to_end_dubbing(
|
|
452
|
+
video_url=video_url,
|
|
453
|
+
source_language=source_language,
|
|
454
|
+
run_id=run_id,
|
|
455
|
+
project_name=project_name,
|
|
456
|
+
project_description=project_description,
|
|
457
|
+
folder_id=folder_id,
|
|
458
|
+
target_language=target_language,
|
|
459
|
+
target_languages=target_languages,
|
|
460
|
+
selected_audio_tracks=selected_audio_tracks,
|
|
461
|
+
add_output_as_an_audio_track=add_output_as_an_audio_track,
|
|
462
|
+
chosen_dictionaries=chosen_dictionaries,
|
|
463
|
+
ai_optimization=ai_optimization,
|
|
464
|
+
request_options=request_options,
|
|
465
|
+
)
|
|
466
|
+
return _response.data
|
|
467
|
+
|
|
468
|
+
async def get_dubbing_status(
|
|
469
|
+
self,
|
|
470
|
+
task_id: str,
|
|
471
|
+
*,
|
|
472
|
+
run_id: typing.Optional[int] = None,
|
|
473
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
474
|
+
) -> OrchestratorPipelineResult:
|
|
475
|
+
"""
|
|
476
|
+
Parameters
|
|
477
|
+
----------
|
|
478
|
+
task_id : str
|
|
479
|
+
|
|
480
|
+
run_id : typing.Optional[int]
|
|
481
|
+
|
|
482
|
+
request_options : typing.Optional[RequestOptions]
|
|
483
|
+
Request-specific configuration.
|
|
484
|
+
|
|
485
|
+
Returns
|
|
486
|
+
-------
|
|
487
|
+
OrchestratorPipelineResult
|
|
488
|
+
Successful Response
|
|
489
|
+
|
|
490
|
+
Examples
|
|
491
|
+
--------
|
|
492
|
+
import asyncio
|
|
493
|
+
|
|
494
|
+
from camb import AsyncCambApi
|
|
495
|
+
|
|
496
|
+
client = AsyncCambApi(
|
|
497
|
+
api_key="YOUR_API_KEY",
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
async def main() -> None:
|
|
502
|
+
await client.dub.get_dubbing_status(
|
|
503
|
+
task_id="task_id",
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
asyncio.run(main())
|
|
508
|
+
"""
|
|
509
|
+
_response = await self._raw_client.get_end_to_end_dubbing_status(
|
|
510
|
+
task_id, run_id=run_id, request_options=request_options
|
|
511
|
+
)
|
|
512
|
+
return _response.data
|
|
513
|
+
|
|
514
|
+
async def get_dubbed_run_info(
|
|
515
|
+
self, run_id: typing.Optional[int], *, request_options: typing.Optional[RequestOptions] = None
|
|
516
|
+
) -> GetDubbedRunInfoDubResultRunIdGetResponse:
|
|
517
|
+
"""
|
|
518
|
+
NOTE: This endpoint should be called only by the users to get values for their runs via API.
|
|
519
|
+
Further we need to validate if the user has access to the run_id, otherwise we should not return the output urls.
|
|
520
|
+
|
|
521
|
+
Parameters
|
|
522
|
+
----------
|
|
523
|
+
run_id : typing.Optional[int]
|
|
524
|
+
|
|
525
|
+
request_options : typing.Optional[RequestOptions]
|
|
526
|
+
Request-specific configuration.
|
|
527
|
+
|
|
528
|
+
Returns
|
|
529
|
+
-------
|
|
530
|
+
GetDubbedRunInfoDubResultRunIdGetResponse
|
|
531
|
+
Successful Response
|
|
532
|
+
|
|
533
|
+
Examples
|
|
534
|
+
--------
|
|
535
|
+
import asyncio
|
|
536
|
+
|
|
537
|
+
from camb import AsyncCambApi
|
|
538
|
+
|
|
539
|
+
client = AsyncCambApi(
|
|
540
|
+
api_key="YOUR_API_KEY",
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
async def main() -> None:
|
|
545
|
+
await client.dub.get_dubbed_run_info(
|
|
546
|
+
run_id=1,
|
|
547
|
+
)
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
asyncio.run(main())
|
|
551
|
+
"""
|
|
552
|
+
_response = await self._raw_client.get_dubbed_run_info(run_id, request_options=request_options)
|
|
553
|
+
return _response.data
|
|
554
|
+
|
|
555
|
+
async def get_dubbed_runs_results(
|
|
556
|
+
self,
|
|
557
|
+
*,
|
|
558
|
+
run_ids: typing.Sequence[int],
|
|
559
|
+
run_id: typing.Optional[int] = None,
|
|
560
|
+
traceparent: typing.Optional[str] = None,
|
|
561
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
562
|
+
) -> typing.Dict[str, GetDubbingRunsResultsDubbingResultsPostResponseValue]:
|
|
563
|
+
"""
|
|
564
|
+
Parameters
|
|
565
|
+
----------
|
|
566
|
+
run_ids : typing.Sequence[int]
|
|
567
|
+
|
|
568
|
+
run_id : typing.Optional[int]
|
|
569
|
+
|
|
570
|
+
traceparent : typing.Optional[str]
|
|
571
|
+
|
|
572
|
+
request_options : typing.Optional[RequestOptions]
|
|
573
|
+
Request-specific configuration.
|
|
574
|
+
|
|
575
|
+
Returns
|
|
576
|
+
-------
|
|
577
|
+
typing.Dict[str, GetDubbingRunsResultsDubbingResultsPostResponseValue]
|
|
578
|
+
Successful Response
|
|
579
|
+
|
|
580
|
+
Examples
|
|
581
|
+
--------
|
|
582
|
+
import asyncio
|
|
583
|
+
|
|
584
|
+
from camb import AsyncCambApi
|
|
585
|
+
|
|
586
|
+
client = AsyncCambApi(
|
|
587
|
+
api_key="YOUR_API_KEY",
|
|
588
|
+
)
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
async def main() -> None:
|
|
592
|
+
await client.dub.get_dubbed_runs_results(
|
|
593
|
+
run_ids=[1],
|
|
594
|
+
)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
asyncio.run(main())
|
|
598
|
+
"""
|
|
599
|
+
_response = await self._raw_client.get_dubbing_runs_results(
|
|
600
|
+
run_ids=run_ids, run_id=run_id, traceparent=traceparent, request_options=request_options
|
|
601
|
+
)
|
|
602
|
+
return _response.data
|
|
603
|
+
|
|
604
|
+
async def get_dubbed_run_transcript(
|
|
605
|
+
self,
|
|
606
|
+
run_id: typing.Optional[int],
|
|
607
|
+
language: Languages,
|
|
608
|
+
*,
|
|
609
|
+
format_type: typing.Optional[TranscriptFileFormat] = None,
|
|
610
|
+
data_type: typing.Optional[TranscriptDataType] = None,
|
|
611
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
612
|
+
) -> typing.Dict[str, str]:
|
|
613
|
+
"""
|
|
614
|
+
Parameters
|
|
615
|
+
----------
|
|
616
|
+
run_id : typing.Optional[int]
|
|
617
|
+
|
|
618
|
+
language : Languages
|
|
619
|
+
|
|
620
|
+
format_type : typing.Optional[TranscriptFileFormat]
|
|
621
|
+
Format to use for the transcription. Either `srt`, `vtt` or `txt`. Defaults to `txt`.
|
|
622
|
+
|
|
623
|
+
data_type : typing.Optional[TranscriptDataType]
|
|
624
|
+
Data type for the transcription being returned. Returns the raw data of the transcription or a presigned url for the file that holds the transcription data.
|
|
625
|
+
|
|
626
|
+
request_options : typing.Optional[RequestOptions]
|
|
627
|
+
Request-specific configuration.
|
|
628
|
+
|
|
629
|
+
Returns
|
|
630
|
+
-------
|
|
631
|
+
typing.Dict[str, str]
|
|
632
|
+
Successful Response
|
|
633
|
+
|
|
634
|
+
Examples
|
|
635
|
+
--------
|
|
636
|
+
import asyncio
|
|
637
|
+
|
|
638
|
+
from camb import AsyncCambApi
|
|
639
|
+
|
|
640
|
+
client = AsyncCambApi(
|
|
641
|
+
api_key="YOUR_API_KEY",
|
|
642
|
+
)
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
async def main() -> None:
|
|
646
|
+
await client.dub.get_dubbed_run_transcript(
|
|
647
|
+
run_id=1,
|
|
648
|
+
language=1,
|
|
649
|
+
)
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
asyncio.run(main())
|
|
653
|
+
"""
|
|
654
|
+
_response = await self._raw_client.get_dubbed_run_transcript(
|
|
655
|
+
run_id, language, format_type=format_type, data_type=data_type, request_options=request_options
|
|
656
|
+
)
|
|
657
|
+
return _response.data
|
|
658
|
+
|
|
659
|
+
async def get_dubbed_output_in_alt_format(
|
|
660
|
+
self,
|
|
661
|
+
run_id: typing.Optional[int],
|
|
662
|
+
language: Languages,
|
|
663
|
+
*,
|
|
664
|
+
output_format: DubbedOutputInAltFormatRequestPayloadOutputFormat,
|
|
665
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
666
|
+
) -> GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse:
|
|
667
|
+
"""
|
|
668
|
+
Parameters
|
|
669
|
+
----------
|
|
670
|
+
run_id : typing.Optional[int]
|
|
671
|
+
|
|
672
|
+
language : Languages
|
|
673
|
+
|
|
674
|
+
output_format : DubbedOutputInAltFormatRequestPayloadOutputFormat
|
|
675
|
+
|
|
676
|
+
request_options : typing.Optional[RequestOptions]
|
|
677
|
+
Request-specific configuration.
|
|
678
|
+
|
|
679
|
+
Returns
|
|
680
|
+
-------
|
|
681
|
+
GetDubbedOutputInAltFormatDubAltFormatRunIdLanguagePostResponse
|
|
682
|
+
Successful Response
|
|
683
|
+
|
|
684
|
+
Examples
|
|
685
|
+
--------
|
|
686
|
+
import asyncio
|
|
687
|
+
|
|
688
|
+
from camb import AsyncCambApi
|
|
689
|
+
|
|
690
|
+
client = AsyncCambApi(
|
|
691
|
+
api_key="YOUR_API_KEY",
|
|
692
|
+
)
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
async def main() -> None:
|
|
696
|
+
await client.dub.get_dubbed_output_in_alt_format(
|
|
697
|
+
run_id=1,
|
|
698
|
+
language=1,
|
|
699
|
+
output_format="flac",
|
|
700
|
+
)
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
asyncio.run(main())
|
|
704
|
+
"""
|
|
705
|
+
_response = await self._raw_client.get_dubbed_output_in_alt_format(
|
|
706
|
+
run_id, language, output_format=output_format, request_options=request_options
|
|
707
|
+
)
|
|
708
|
+
return _response.data
|
|
709
|
+
|
|
710
|
+
async def get_dubbed_output_in_alt_format_status(
|
|
711
|
+
self,
|
|
712
|
+
task_id: str,
|
|
713
|
+
*,
|
|
714
|
+
run_id: typing.Optional[int] = None,
|
|
715
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
716
|
+
) -> OrchestratorPipelineResult:
|
|
717
|
+
"""
|
|
718
|
+
Parameters
|
|
719
|
+
----------
|
|
720
|
+
task_id : str
|
|
721
|
+
|
|
722
|
+
run_id : typing.Optional[int]
|
|
723
|
+
|
|
724
|
+
request_options : typing.Optional[RequestOptions]
|
|
725
|
+
Request-specific configuration.
|
|
726
|
+
|
|
727
|
+
Returns
|
|
728
|
+
-------
|
|
729
|
+
OrchestratorPipelineResult
|
|
730
|
+
Successful Response
|
|
731
|
+
|
|
732
|
+
Examples
|
|
733
|
+
--------
|
|
734
|
+
import asyncio
|
|
735
|
+
|
|
736
|
+
from camb import AsyncCambApi
|
|
737
|
+
|
|
738
|
+
client = AsyncCambApi(
|
|
739
|
+
api_key="YOUR_API_KEY",
|
|
740
|
+
)
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
async def main() -> None:
|
|
744
|
+
await client.dub.get_dubbed_output_in_alt_format_status(
|
|
745
|
+
task_id="task_id",
|
|
746
|
+
)
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
asyncio.run(main())
|
|
750
|
+
"""
|
|
751
|
+
_response = await self._raw_client.get_dubbed_output_in_alt_format_status(
|
|
752
|
+
task_id, run_id=run_id, request_options=request_options
|
|
753
|
+
)
|
|
754
|
+
return _response.data
|
|
755
|
+
|
|
756
|
+
async def poll_discord_dub_task(
|
|
757
|
+
self,
|
|
758
|
+
task_id: str,
|
|
759
|
+
*,
|
|
760
|
+
run_id: typing.Optional[int] = None,
|
|
761
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
762
|
+
) -> OrchestratorPipelineResult:
|
|
763
|
+
"""
|
|
764
|
+
Parameters
|
|
765
|
+
----------
|
|
766
|
+
task_id : str
|
|
767
|
+
|
|
768
|
+
run_id : typing.Optional[int]
|
|
769
|
+
|
|
770
|
+
request_options : typing.Optional[RequestOptions]
|
|
771
|
+
Request-specific configuration.
|
|
772
|
+
|
|
773
|
+
Returns
|
|
774
|
+
-------
|
|
775
|
+
OrchestratorPipelineResult
|
|
776
|
+
Successful Response
|
|
777
|
+
|
|
778
|
+
Examples
|
|
779
|
+
--------
|
|
780
|
+
import asyncio
|
|
781
|
+
|
|
782
|
+
from camb import AsyncCambApi
|
|
783
|
+
|
|
784
|
+
client = AsyncCambApi(
|
|
785
|
+
api_key="YOUR_API_KEY",
|
|
786
|
+
)
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
async def main() -> None:
|
|
790
|
+
await client.dub.poll_discord_dub_task(
|
|
791
|
+
task_id="task_id",
|
|
792
|
+
)
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
asyncio.run(main())
|
|
796
|
+
"""
|
|
797
|
+
_response = await self._raw_client.poll_discord_dub_task(
|
|
798
|
+
task_id, run_id=run_id, request_options=request_options
|
|
799
|
+
)
|
|
800
|
+
return _response.data
|
|
801
|
+
|
|
802
|
+
async def poll_twitter_dub_task(
|
|
803
|
+
self,
|
|
804
|
+
task_id: str,
|
|
805
|
+
*,
|
|
806
|
+
run_id: typing.Optional[int] = None,
|
|
807
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
808
|
+
) -> OrchestratorPipelineResult:
|
|
809
|
+
"""
|
|
810
|
+
Parameters
|
|
811
|
+
----------
|
|
812
|
+
task_id : str
|
|
813
|
+
|
|
814
|
+
run_id : typing.Optional[int]
|
|
815
|
+
|
|
816
|
+
request_options : typing.Optional[RequestOptions]
|
|
817
|
+
Request-specific configuration.
|
|
818
|
+
|
|
819
|
+
Returns
|
|
820
|
+
-------
|
|
821
|
+
OrchestratorPipelineResult
|
|
822
|
+
Successful Response
|
|
823
|
+
|
|
824
|
+
Examples
|
|
825
|
+
--------
|
|
826
|
+
import asyncio
|
|
827
|
+
|
|
828
|
+
from camb import AsyncCambApi
|
|
829
|
+
|
|
830
|
+
client = AsyncCambApi(
|
|
831
|
+
api_key="YOUR_API_KEY",
|
|
832
|
+
)
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
async def main() -> None:
|
|
836
|
+
await client.dub.poll_twitter_dub_task(
|
|
837
|
+
task_id="task_id",
|
|
838
|
+
)
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
asyncio.run(main())
|
|
842
|
+
"""
|
|
843
|
+
_response = await self._raw_client.poll_twitter_dub_task(
|
|
844
|
+
task_id, run_id=run_id, request_options=request_options
|
|
845
|
+
)
|
|
846
|
+
return _response.data
|