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,537 @@
|
|
|
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.create_project_setup_out import CreateProjectSetupOut
|
|
8
|
+
from ..types.get_create_project_setup_response import GetCreateProjectSetupResponse
|
|
9
|
+
from ..types.languages import Languages
|
|
10
|
+
from .raw_client import AsyncRawProjectSetupClient, RawProjectSetupClient
|
|
11
|
+
|
|
12
|
+
# this is used as the default value for optional parameters
|
|
13
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ProjectSetupClient:
|
|
17
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
|
+
self._raw_client = RawProjectSetupClient(client_wrapper=client_wrapper)
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def with_raw_response(self) -> RawProjectSetupClient:
|
|
22
|
+
"""
|
|
23
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
24
|
+
|
|
25
|
+
Returns
|
|
26
|
+
-------
|
|
27
|
+
RawProjectSetupClient
|
|
28
|
+
"""
|
|
29
|
+
return self._raw_client
|
|
30
|
+
|
|
31
|
+
def create_project(
|
|
32
|
+
self,
|
|
33
|
+
*,
|
|
34
|
+
media_url: str,
|
|
35
|
+
source_language: Languages,
|
|
36
|
+
target_languages: typing.Sequence[Languages],
|
|
37
|
+
run_id: typing.Optional[int] = None,
|
|
38
|
+
project_name: typing.Optional[str] = OMIT,
|
|
39
|
+
project_description: typing.Optional[str] = OMIT,
|
|
40
|
+
folder_id: typing.Optional[int] = OMIT,
|
|
41
|
+
selected_audio_tracks: typing.Optional[typing.Sequence[int]] = OMIT,
|
|
42
|
+
add_output_as_an_audio_track: typing.Optional[bool] = OMIT,
|
|
43
|
+
chosen_dictionaries: typing.Optional[typing.Sequence[int]] = OMIT,
|
|
44
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
45
|
+
) -> CreateProjectSetupOut:
|
|
46
|
+
"""
|
|
47
|
+
Creates a new project setup with transcription capabilities.
|
|
48
|
+
|
|
49
|
+
This endpoint allows users to create a new project by providing media content
|
|
50
|
+
(either as a file upload or URL), specifying source and target languages, and
|
|
51
|
+
other project metadata. The function validates inputs, checks file size limitations,
|
|
52
|
+
and initiates the project setup process.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
request_payload (CreateProjectSetupRequestPayload): Complete project configuration
|
|
56
|
+
including media URL, source/target languages, project metadata, and
|
|
57
|
+
processing preferences such as audio track selection and dictionary choices.
|
|
58
|
+
api_key_obj_and_subscription: Dependency injection providing validated API key
|
|
59
|
+
object and associated subscription details for authorization and usage
|
|
60
|
+
limit enforcement.
|
|
61
|
+
traceparent (str | None, optional): OpenTelemetry trace parent header for
|
|
62
|
+
distributed tracing across microservices. Enables request correlation
|
|
63
|
+
and performance monitoring throughout the processing pipeline.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
Project setup response with project details and processing status.
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
HTTPException:
|
|
70
|
+
- 400: If neither media_file nor media_url is provided
|
|
71
|
+
- 400: If uploaded file has no filename
|
|
72
|
+
- 413: If uploaded file exceeds size limit
|
|
73
|
+
|
|
74
|
+
Parameters
|
|
75
|
+
----------
|
|
76
|
+
media_url : str
|
|
77
|
+
|
|
78
|
+
source_language : Languages
|
|
79
|
+
|
|
80
|
+
target_languages : typing.Sequence[Languages]
|
|
81
|
+
|
|
82
|
+
run_id : typing.Optional[int]
|
|
83
|
+
|
|
84
|
+
project_name : typing.Optional[str]
|
|
85
|
+
|
|
86
|
+
project_description : typing.Optional[str]
|
|
87
|
+
|
|
88
|
+
folder_id : typing.Optional[int]
|
|
89
|
+
|
|
90
|
+
selected_audio_tracks : typing.Optional[typing.Sequence[int]]
|
|
91
|
+
|
|
92
|
+
add_output_as_an_audio_track : typing.Optional[bool]
|
|
93
|
+
|
|
94
|
+
chosen_dictionaries : typing.Optional[typing.Sequence[int]]
|
|
95
|
+
|
|
96
|
+
request_options : typing.Optional[RequestOptions]
|
|
97
|
+
Request-specific configuration.
|
|
98
|
+
|
|
99
|
+
Returns
|
|
100
|
+
-------
|
|
101
|
+
CreateProjectSetupOut
|
|
102
|
+
Successful Response
|
|
103
|
+
|
|
104
|
+
Examples
|
|
105
|
+
--------
|
|
106
|
+
from camb import CambApi
|
|
107
|
+
|
|
108
|
+
client = CambApi(
|
|
109
|
+
api_key="YOUR_API_KEY",
|
|
110
|
+
)
|
|
111
|
+
client.project_setup.create_project(
|
|
112
|
+
media_url="media_url",
|
|
113
|
+
source_language=1,
|
|
114
|
+
target_languages=[1],
|
|
115
|
+
)
|
|
116
|
+
"""
|
|
117
|
+
_response = self._raw_client.create_project(
|
|
118
|
+
media_url=media_url,
|
|
119
|
+
source_language=source_language,
|
|
120
|
+
target_languages=target_languages,
|
|
121
|
+
run_id=run_id,
|
|
122
|
+
project_name=project_name,
|
|
123
|
+
project_description=project_description,
|
|
124
|
+
folder_id=folder_id,
|
|
125
|
+
selected_audio_tracks=selected_audio_tracks,
|
|
126
|
+
add_output_as_an_audio_track=add_output_as_an_audio_track,
|
|
127
|
+
chosen_dictionaries=chosen_dictionaries,
|
|
128
|
+
request_options=request_options,
|
|
129
|
+
)
|
|
130
|
+
return _response.data
|
|
131
|
+
|
|
132
|
+
def create_project_setup_task_status(
|
|
133
|
+
self,
|
|
134
|
+
task_id: str,
|
|
135
|
+
*,
|
|
136
|
+
run_id: typing.Optional[int] = None,
|
|
137
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
138
|
+
) -> typing.List[GetCreateProjectSetupResponse]:
|
|
139
|
+
"""
|
|
140
|
+
Parameters
|
|
141
|
+
----------
|
|
142
|
+
task_id : str
|
|
143
|
+
|
|
144
|
+
run_id : typing.Optional[int]
|
|
145
|
+
|
|
146
|
+
request_options : typing.Optional[RequestOptions]
|
|
147
|
+
Request-specific configuration.
|
|
148
|
+
|
|
149
|
+
Returns
|
|
150
|
+
-------
|
|
151
|
+
typing.List[GetCreateProjectSetupResponse]
|
|
152
|
+
Successful Response
|
|
153
|
+
|
|
154
|
+
Examples
|
|
155
|
+
--------
|
|
156
|
+
from camb import CambApi
|
|
157
|
+
|
|
158
|
+
client = CambApi(
|
|
159
|
+
api_key="YOUR_API_KEY",
|
|
160
|
+
)
|
|
161
|
+
client.project_setup.create_project_setup_task_status(
|
|
162
|
+
task_id="task_id",
|
|
163
|
+
)
|
|
164
|
+
"""
|
|
165
|
+
_response = self._raw_client.create_project_setup_task_status(
|
|
166
|
+
task_id, run_id=run_id, request_options=request_options
|
|
167
|
+
)
|
|
168
|
+
return _response.data
|
|
169
|
+
|
|
170
|
+
def get_project_setup_result(
|
|
171
|
+
self, run_id: typing.Optional[int], *, request_options: typing.Optional[RequestOptions] = None
|
|
172
|
+
) -> typing.Optional[GetCreateProjectSetupResponse]:
|
|
173
|
+
"""
|
|
174
|
+
Retrieves the final result of a completed project setup.
|
|
175
|
+
|
|
176
|
+
This endpoint provides access to the final results of a completed project setup.
|
|
177
|
+
It verifies that the authenticated user has access to the requested run_id and
|
|
178
|
+
validates that the run is of the correct type (`DUB_PROJECT`) before returning results.
|
|
179
|
+
|
|
180
|
+
Note:
|
|
181
|
+
This endpoint should only be called by users to retrieve their run results via API.
|
|
182
|
+
Access validation is performed to ensure users can only access their own runs.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
run_id: Positive integer ID of the project setup run.
|
|
186
|
+
api_key_obj: API key authentication data from dependency.
|
|
187
|
+
traceparent: OpenTelemetry trace header for distributed tracing.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
GetCreateProjectSetupResponse: Project setup results including run details.
|
|
191
|
+
|
|
192
|
+
Raises:
|
|
193
|
+
HTTPException:
|
|
194
|
+
- 404: If the run_id is not found
|
|
195
|
+
- 400: If the run type is not valid for this endpoint (must be DUB_PROJECT)
|
|
196
|
+
|
|
197
|
+
Parameters
|
|
198
|
+
----------
|
|
199
|
+
run_id : typing.Optional[int]
|
|
200
|
+
|
|
201
|
+
request_options : typing.Optional[RequestOptions]
|
|
202
|
+
Request-specific configuration.
|
|
203
|
+
|
|
204
|
+
Returns
|
|
205
|
+
-------
|
|
206
|
+
typing.Optional[GetCreateProjectSetupResponse]
|
|
207
|
+
Successful Response
|
|
208
|
+
|
|
209
|
+
Examples
|
|
210
|
+
--------
|
|
211
|
+
from camb import CambApi
|
|
212
|
+
|
|
213
|
+
client = CambApi(
|
|
214
|
+
api_key="YOUR_API_KEY",
|
|
215
|
+
)
|
|
216
|
+
client.project_setup.get_project_setup_result(
|
|
217
|
+
run_id=1,
|
|
218
|
+
)
|
|
219
|
+
"""
|
|
220
|
+
_response = self._raw_client.get_project_setup_result(run_id, request_options=request_options)
|
|
221
|
+
return _response.data
|
|
222
|
+
|
|
223
|
+
def get_project_setup_runs_results(
|
|
224
|
+
self,
|
|
225
|
+
*,
|
|
226
|
+
run_ids: typing.Sequence[int],
|
|
227
|
+
run_id: typing.Optional[int] = None,
|
|
228
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
229
|
+
) -> typing.List[GetCreateProjectSetupResponse]:
|
|
230
|
+
"""
|
|
231
|
+
Parameters
|
|
232
|
+
----------
|
|
233
|
+
run_ids : typing.Sequence[int]
|
|
234
|
+
|
|
235
|
+
run_id : typing.Optional[int]
|
|
236
|
+
|
|
237
|
+
request_options : typing.Optional[RequestOptions]
|
|
238
|
+
Request-specific configuration.
|
|
239
|
+
|
|
240
|
+
Returns
|
|
241
|
+
-------
|
|
242
|
+
typing.List[GetCreateProjectSetupResponse]
|
|
243
|
+
Successful Response
|
|
244
|
+
|
|
245
|
+
Examples
|
|
246
|
+
--------
|
|
247
|
+
from camb import CambApi
|
|
248
|
+
|
|
249
|
+
client = CambApi(
|
|
250
|
+
api_key="YOUR_API_KEY",
|
|
251
|
+
)
|
|
252
|
+
client.project_setup.get_project_setup_runs_results(
|
|
253
|
+
run_ids=[1],
|
|
254
|
+
)
|
|
255
|
+
"""
|
|
256
|
+
_response = self._raw_client.get_project_setup_runs_results(
|
|
257
|
+
run_ids=run_ids, run_id=run_id, request_options=request_options
|
|
258
|
+
)
|
|
259
|
+
return _response.data
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
class AsyncProjectSetupClient:
|
|
263
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
264
|
+
self._raw_client = AsyncRawProjectSetupClient(client_wrapper=client_wrapper)
|
|
265
|
+
|
|
266
|
+
@property
|
|
267
|
+
def with_raw_response(self) -> AsyncRawProjectSetupClient:
|
|
268
|
+
"""
|
|
269
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
270
|
+
|
|
271
|
+
Returns
|
|
272
|
+
-------
|
|
273
|
+
AsyncRawProjectSetupClient
|
|
274
|
+
"""
|
|
275
|
+
return self._raw_client
|
|
276
|
+
|
|
277
|
+
async def create_project(
|
|
278
|
+
self,
|
|
279
|
+
*,
|
|
280
|
+
media_url: str,
|
|
281
|
+
source_language: Languages,
|
|
282
|
+
target_languages: typing.Sequence[Languages],
|
|
283
|
+
run_id: typing.Optional[int] = None,
|
|
284
|
+
project_name: typing.Optional[str] = OMIT,
|
|
285
|
+
project_description: typing.Optional[str] = OMIT,
|
|
286
|
+
folder_id: typing.Optional[int] = OMIT,
|
|
287
|
+
selected_audio_tracks: typing.Optional[typing.Sequence[int]] = OMIT,
|
|
288
|
+
add_output_as_an_audio_track: typing.Optional[bool] = OMIT,
|
|
289
|
+
chosen_dictionaries: typing.Optional[typing.Sequence[int]] = OMIT,
|
|
290
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
291
|
+
) -> CreateProjectSetupOut:
|
|
292
|
+
"""
|
|
293
|
+
Creates a new project setup with transcription capabilities.
|
|
294
|
+
|
|
295
|
+
This endpoint allows users to create a new project by providing media content
|
|
296
|
+
(either as a file upload or URL), specifying source and target languages, and
|
|
297
|
+
other project metadata. The function validates inputs, checks file size limitations,
|
|
298
|
+
and initiates the project setup process.
|
|
299
|
+
|
|
300
|
+
Args:
|
|
301
|
+
request_payload (CreateProjectSetupRequestPayload): Complete project configuration
|
|
302
|
+
including media URL, source/target languages, project metadata, and
|
|
303
|
+
processing preferences such as audio track selection and dictionary choices.
|
|
304
|
+
api_key_obj_and_subscription: Dependency injection providing validated API key
|
|
305
|
+
object and associated subscription details for authorization and usage
|
|
306
|
+
limit enforcement.
|
|
307
|
+
traceparent (str | None, optional): OpenTelemetry trace parent header for
|
|
308
|
+
distributed tracing across microservices. Enables request correlation
|
|
309
|
+
and performance monitoring throughout the processing pipeline.
|
|
310
|
+
|
|
311
|
+
Returns:
|
|
312
|
+
Project setup response with project details and processing status.
|
|
313
|
+
|
|
314
|
+
Raises:
|
|
315
|
+
HTTPException:
|
|
316
|
+
- 400: If neither media_file nor media_url is provided
|
|
317
|
+
- 400: If uploaded file has no filename
|
|
318
|
+
- 413: If uploaded file exceeds size limit
|
|
319
|
+
|
|
320
|
+
Parameters
|
|
321
|
+
----------
|
|
322
|
+
media_url : str
|
|
323
|
+
|
|
324
|
+
source_language : Languages
|
|
325
|
+
|
|
326
|
+
target_languages : typing.Sequence[Languages]
|
|
327
|
+
|
|
328
|
+
run_id : typing.Optional[int]
|
|
329
|
+
|
|
330
|
+
project_name : typing.Optional[str]
|
|
331
|
+
|
|
332
|
+
project_description : typing.Optional[str]
|
|
333
|
+
|
|
334
|
+
folder_id : typing.Optional[int]
|
|
335
|
+
|
|
336
|
+
selected_audio_tracks : typing.Optional[typing.Sequence[int]]
|
|
337
|
+
|
|
338
|
+
add_output_as_an_audio_track : typing.Optional[bool]
|
|
339
|
+
|
|
340
|
+
chosen_dictionaries : typing.Optional[typing.Sequence[int]]
|
|
341
|
+
|
|
342
|
+
request_options : typing.Optional[RequestOptions]
|
|
343
|
+
Request-specific configuration.
|
|
344
|
+
|
|
345
|
+
Returns
|
|
346
|
+
-------
|
|
347
|
+
CreateProjectSetupOut
|
|
348
|
+
Successful Response
|
|
349
|
+
|
|
350
|
+
Examples
|
|
351
|
+
--------
|
|
352
|
+
import asyncio
|
|
353
|
+
|
|
354
|
+
from camb import AsyncCambApi
|
|
355
|
+
|
|
356
|
+
client = AsyncCambApi(
|
|
357
|
+
api_key="YOUR_API_KEY",
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
async def main() -> None:
|
|
362
|
+
await client.project_setup.create_project(
|
|
363
|
+
media_url="media_url",
|
|
364
|
+
source_language=1,
|
|
365
|
+
target_languages=[1],
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
asyncio.run(main())
|
|
370
|
+
"""
|
|
371
|
+
_response = await self._raw_client.create_project(
|
|
372
|
+
media_url=media_url,
|
|
373
|
+
source_language=source_language,
|
|
374
|
+
target_languages=target_languages,
|
|
375
|
+
run_id=run_id,
|
|
376
|
+
project_name=project_name,
|
|
377
|
+
project_description=project_description,
|
|
378
|
+
folder_id=folder_id,
|
|
379
|
+
selected_audio_tracks=selected_audio_tracks,
|
|
380
|
+
add_output_as_an_audio_track=add_output_as_an_audio_track,
|
|
381
|
+
chosen_dictionaries=chosen_dictionaries,
|
|
382
|
+
request_options=request_options,
|
|
383
|
+
)
|
|
384
|
+
return _response.data
|
|
385
|
+
|
|
386
|
+
async def create_project_setup_task_status(
|
|
387
|
+
self,
|
|
388
|
+
task_id: str,
|
|
389
|
+
*,
|
|
390
|
+
run_id: typing.Optional[int] = None,
|
|
391
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
392
|
+
) -> typing.List[GetCreateProjectSetupResponse]:
|
|
393
|
+
"""
|
|
394
|
+
Parameters
|
|
395
|
+
----------
|
|
396
|
+
task_id : str
|
|
397
|
+
|
|
398
|
+
run_id : typing.Optional[int]
|
|
399
|
+
|
|
400
|
+
request_options : typing.Optional[RequestOptions]
|
|
401
|
+
Request-specific configuration.
|
|
402
|
+
|
|
403
|
+
Returns
|
|
404
|
+
-------
|
|
405
|
+
typing.List[GetCreateProjectSetupResponse]
|
|
406
|
+
Successful Response
|
|
407
|
+
|
|
408
|
+
Examples
|
|
409
|
+
--------
|
|
410
|
+
import asyncio
|
|
411
|
+
|
|
412
|
+
from camb import AsyncCambApi
|
|
413
|
+
|
|
414
|
+
client = AsyncCambApi(
|
|
415
|
+
api_key="YOUR_API_KEY",
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
async def main() -> None:
|
|
420
|
+
await client.project_setup.create_project_setup_task_status(
|
|
421
|
+
task_id="task_id",
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
asyncio.run(main())
|
|
426
|
+
"""
|
|
427
|
+
_response = await self._raw_client.create_project_setup_task_status(
|
|
428
|
+
task_id, run_id=run_id, request_options=request_options
|
|
429
|
+
)
|
|
430
|
+
return _response.data
|
|
431
|
+
|
|
432
|
+
async def get_project_setup_result(
|
|
433
|
+
self, run_id: typing.Optional[int], *, request_options: typing.Optional[RequestOptions] = None
|
|
434
|
+
) -> typing.Optional[GetCreateProjectSetupResponse]:
|
|
435
|
+
"""
|
|
436
|
+
Retrieves the final result of a completed project setup.
|
|
437
|
+
|
|
438
|
+
This endpoint provides access to the final results of a completed project setup.
|
|
439
|
+
It verifies that the authenticated user has access to the requested run_id and
|
|
440
|
+
validates that the run is of the correct type (`DUB_PROJECT`) before returning results.
|
|
441
|
+
|
|
442
|
+
Note:
|
|
443
|
+
This endpoint should only be called by users to retrieve their run results via API.
|
|
444
|
+
Access validation is performed to ensure users can only access their own runs.
|
|
445
|
+
|
|
446
|
+
Args:
|
|
447
|
+
run_id: Positive integer ID of the project setup run.
|
|
448
|
+
api_key_obj: API key authentication data from dependency.
|
|
449
|
+
traceparent: OpenTelemetry trace header for distributed tracing.
|
|
450
|
+
|
|
451
|
+
Returns:
|
|
452
|
+
GetCreateProjectSetupResponse: Project setup results including run details.
|
|
453
|
+
|
|
454
|
+
Raises:
|
|
455
|
+
HTTPException:
|
|
456
|
+
- 404: If the run_id is not found
|
|
457
|
+
- 400: If the run type is not valid for this endpoint (must be DUB_PROJECT)
|
|
458
|
+
|
|
459
|
+
Parameters
|
|
460
|
+
----------
|
|
461
|
+
run_id : typing.Optional[int]
|
|
462
|
+
|
|
463
|
+
request_options : typing.Optional[RequestOptions]
|
|
464
|
+
Request-specific configuration.
|
|
465
|
+
|
|
466
|
+
Returns
|
|
467
|
+
-------
|
|
468
|
+
typing.Optional[GetCreateProjectSetupResponse]
|
|
469
|
+
Successful Response
|
|
470
|
+
|
|
471
|
+
Examples
|
|
472
|
+
--------
|
|
473
|
+
import asyncio
|
|
474
|
+
|
|
475
|
+
from camb import AsyncCambApi
|
|
476
|
+
|
|
477
|
+
client = AsyncCambApi(
|
|
478
|
+
api_key="YOUR_API_KEY",
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
async def main() -> None:
|
|
483
|
+
await client.project_setup.get_project_setup_result(
|
|
484
|
+
run_id=1,
|
|
485
|
+
)
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
asyncio.run(main())
|
|
489
|
+
"""
|
|
490
|
+
_response = await self._raw_client.get_project_setup_result(run_id, request_options=request_options)
|
|
491
|
+
return _response.data
|
|
492
|
+
|
|
493
|
+
async def get_project_setup_runs_results(
|
|
494
|
+
self,
|
|
495
|
+
*,
|
|
496
|
+
run_ids: typing.Sequence[int],
|
|
497
|
+
run_id: typing.Optional[int] = None,
|
|
498
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
499
|
+
) -> typing.List[GetCreateProjectSetupResponse]:
|
|
500
|
+
"""
|
|
501
|
+
Parameters
|
|
502
|
+
----------
|
|
503
|
+
run_ids : typing.Sequence[int]
|
|
504
|
+
|
|
505
|
+
run_id : typing.Optional[int]
|
|
506
|
+
|
|
507
|
+
request_options : typing.Optional[RequestOptions]
|
|
508
|
+
Request-specific configuration.
|
|
509
|
+
|
|
510
|
+
Returns
|
|
511
|
+
-------
|
|
512
|
+
typing.List[GetCreateProjectSetupResponse]
|
|
513
|
+
Successful Response
|
|
514
|
+
|
|
515
|
+
Examples
|
|
516
|
+
--------
|
|
517
|
+
import asyncio
|
|
518
|
+
|
|
519
|
+
from camb import AsyncCambApi
|
|
520
|
+
|
|
521
|
+
client = AsyncCambApi(
|
|
522
|
+
api_key="YOUR_API_KEY",
|
|
523
|
+
)
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
async def main() -> None:
|
|
527
|
+
await client.project_setup.get_project_setup_runs_results(
|
|
528
|
+
run_ids=[1],
|
|
529
|
+
)
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
asyncio.run(main())
|
|
533
|
+
"""
|
|
534
|
+
_response = await self._raw_client.get_project_setup_runs_results(
|
|
535
|
+
run_ids=run_ids, run_id=run_id, request_options=request_options
|
|
536
|
+
)
|
|
537
|
+
return _response.data
|