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,38 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .create_story_story_post_response import CreateStoryStoryPostResponse
|
|
10
|
+
from .setup_story_story_setup_post_response import SetupStoryStorySetupPostResponse
|
|
11
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
12
|
+
"CreateStoryStoryPostResponse": ".create_story_story_post_response",
|
|
13
|
+
"SetupStoryStorySetupPostResponse": ".setup_story_story_setup_post_response",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
18
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
19
|
+
if module_name is None:
|
|
20
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
21
|
+
try:
|
|
22
|
+
module = import_module(module_name, __package__)
|
|
23
|
+
if module_name == f".{attr_name}":
|
|
24
|
+
return module
|
|
25
|
+
else:
|
|
26
|
+
return getattr(module, attr_name)
|
|
27
|
+
except ImportError as e:
|
|
28
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
29
|
+
except AttributeError as e:
|
|
30
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def __dir__():
|
|
34
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
35
|
+
return sorted(lazy_attrs)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
__all__ = ["CreateStoryStoryPostResponse", "SetupStoryStorySetupPostResponse"]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...types.get_setup_story_result_response import GetSetupStoryResultResponse
|
|
6
|
+
from ...types.orchestrator_pipeline_call_result import OrchestratorPipelineCallResult
|
|
7
|
+
|
|
8
|
+
CreateStoryStoryPostResponse = typing.Union[OrchestratorPipelineCallResult, GetSetupStoryResultResponse]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...types.get_setup_story_result_response import GetSetupStoryResultResponse
|
|
6
|
+
from ...types.orchestrator_pipeline_call_result import OrchestratorPipelineCallResult
|
|
7
|
+
|
|
8
|
+
SetupStoryStorySetupPostResponse = typing.Union[OrchestratorPipelineCallResult, GetSetupStoryResultResponse]
|
camb/streaming/client.py
ADDED
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
|
+
from ..core.request_options import RequestOptions
|
|
8
|
+
from ..types.config_stream import ConfigStream
|
|
9
|
+
from ..types.create_stream_out import CreateStreamOut
|
|
10
|
+
from ..types.get_probe_stream_out import GetProbeStreamOut
|
|
11
|
+
from ..types.languages import Languages
|
|
12
|
+
from ..types.source_stream import SourceStream
|
|
13
|
+
from ..types.target_stream import TargetStream
|
|
14
|
+
from .raw_client import AsyncRawStreamingClient, RawStreamingClient
|
|
15
|
+
|
|
16
|
+
# this is used as the default value for optional parameters
|
|
17
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class StreamingClient:
|
|
21
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
22
|
+
self._raw_client = RawStreamingClient(client_wrapper=client_wrapper)
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def with_raw_response(self) -> RawStreamingClient:
|
|
26
|
+
"""
|
|
27
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
28
|
+
|
|
29
|
+
Returns
|
|
30
|
+
-------
|
|
31
|
+
RawStreamingClient
|
|
32
|
+
"""
|
|
33
|
+
return self._raw_client
|
|
34
|
+
|
|
35
|
+
def create_stream(
|
|
36
|
+
self,
|
|
37
|
+
*,
|
|
38
|
+
voices: typing.Sequence[int],
|
|
39
|
+
dictionaries: typing.Sequence[int],
|
|
40
|
+
config: ConfigStream,
|
|
41
|
+
source_stream: SourceStream,
|
|
42
|
+
target_streams: typing.Sequence[TargetStream],
|
|
43
|
+
name: typing.Optional[str] = OMIT,
|
|
44
|
+
description: typing.Optional[str] = OMIT,
|
|
45
|
+
initial_delay: typing.Optional[int] = OMIT,
|
|
46
|
+
timeout_in_mins: typing.Optional[int] = OMIT,
|
|
47
|
+
start_time: typing.Optional[dt.datetime] = OMIT,
|
|
48
|
+
end_time: typing.Optional[dt.datetime] = OMIT,
|
|
49
|
+
timezone: typing.Optional[str] = OMIT,
|
|
50
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
51
|
+
) -> CreateStreamOut:
|
|
52
|
+
"""
|
|
53
|
+
Parameters
|
|
54
|
+
----------
|
|
55
|
+
voices : typing.Sequence[int]
|
|
56
|
+
List of voice identifiers to be used in the stream.
|
|
57
|
+
|
|
58
|
+
dictionaries : typing.Sequence[int]
|
|
59
|
+
List of dictionary identifiers to be used in the stream.
|
|
60
|
+
|
|
61
|
+
config : ConfigStream
|
|
62
|
+
The shared configuration for the streaming pipeline.
|
|
63
|
+
|
|
64
|
+
source_stream : SourceStream
|
|
65
|
+
The source stream configuration details.
|
|
66
|
+
|
|
67
|
+
target_streams : typing.Sequence[TargetStream]
|
|
68
|
+
List of target stream configurations.
|
|
69
|
+
|
|
70
|
+
name : typing.Optional[str]
|
|
71
|
+
The name of the stream.
|
|
72
|
+
|
|
73
|
+
description : typing.Optional[str]
|
|
74
|
+
The description of the stream.
|
|
75
|
+
|
|
76
|
+
initial_delay : typing.Optional[int]
|
|
77
|
+
The initial delay in seconds before starting the stream creation process.
|
|
78
|
+
|
|
79
|
+
timeout_in_mins : typing.Optional[int]
|
|
80
|
+
The maximum duration in minutes for the stream creation process before timing out.
|
|
81
|
+
|
|
82
|
+
start_time : typing.Optional[dt.datetime]
|
|
83
|
+
|
|
84
|
+
end_time : typing.Optional[dt.datetime]
|
|
85
|
+
|
|
86
|
+
timezone : typing.Optional[str]
|
|
87
|
+
|
|
88
|
+
request_options : typing.Optional[RequestOptions]
|
|
89
|
+
Request-specific configuration.
|
|
90
|
+
|
|
91
|
+
Returns
|
|
92
|
+
-------
|
|
93
|
+
CreateStreamOut
|
|
94
|
+
Successful Response
|
|
95
|
+
|
|
96
|
+
Examples
|
|
97
|
+
--------
|
|
98
|
+
from camb import CambApi, ConfigStream, SourceStream, TargetStream
|
|
99
|
+
|
|
100
|
+
client = CambApi(
|
|
101
|
+
api_key="YOUR_API_KEY",
|
|
102
|
+
)
|
|
103
|
+
client.streaming.create_stream(
|
|
104
|
+
voices=[1],
|
|
105
|
+
dictionaries=[1],
|
|
106
|
+
config=ConfigStream(),
|
|
107
|
+
source_stream=SourceStream(
|
|
108
|
+
language=1,
|
|
109
|
+
url="url",
|
|
110
|
+
),
|
|
111
|
+
target_streams=[
|
|
112
|
+
TargetStream(
|
|
113
|
+
languages=[1],
|
|
114
|
+
url="url",
|
|
115
|
+
type=1,
|
|
116
|
+
)
|
|
117
|
+
],
|
|
118
|
+
)
|
|
119
|
+
"""
|
|
120
|
+
_response = self._raw_client.create_stream(
|
|
121
|
+
voices=voices,
|
|
122
|
+
dictionaries=dictionaries,
|
|
123
|
+
config=config,
|
|
124
|
+
source_stream=source_stream,
|
|
125
|
+
target_streams=target_streams,
|
|
126
|
+
name=name,
|
|
127
|
+
description=description,
|
|
128
|
+
initial_delay=initial_delay,
|
|
129
|
+
timeout_in_mins=timeout_in_mins,
|
|
130
|
+
start_time=start_time,
|
|
131
|
+
end_time=end_time,
|
|
132
|
+
timezone=timezone,
|
|
133
|
+
request_options=request_options,
|
|
134
|
+
)
|
|
135
|
+
return _response.data
|
|
136
|
+
|
|
137
|
+
def get_stream_result(
|
|
138
|
+
self,
|
|
139
|
+
stream_id: int,
|
|
140
|
+
*,
|
|
141
|
+
run_id: typing.Optional[int] = None,
|
|
142
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
143
|
+
) -> typing.Dict[str, typing.Any]:
|
|
144
|
+
"""
|
|
145
|
+
Parameters
|
|
146
|
+
----------
|
|
147
|
+
stream_id : int
|
|
148
|
+
|
|
149
|
+
run_id : typing.Optional[int]
|
|
150
|
+
|
|
151
|
+
request_options : typing.Optional[RequestOptions]
|
|
152
|
+
Request-specific configuration.
|
|
153
|
+
|
|
154
|
+
Returns
|
|
155
|
+
-------
|
|
156
|
+
typing.Dict[str, typing.Any]
|
|
157
|
+
Successful Response
|
|
158
|
+
|
|
159
|
+
Examples
|
|
160
|
+
--------
|
|
161
|
+
from camb import CambApi
|
|
162
|
+
|
|
163
|
+
client = CambApi(
|
|
164
|
+
api_key="YOUR_API_KEY",
|
|
165
|
+
)
|
|
166
|
+
client.streaming.get_stream_result(
|
|
167
|
+
stream_id=1,
|
|
168
|
+
)
|
|
169
|
+
"""
|
|
170
|
+
_response = self._raw_client.get_stream_result(stream_id, run_id=run_id, request_options=request_options)
|
|
171
|
+
return _response.data
|
|
172
|
+
|
|
173
|
+
def destroy_stream(
|
|
174
|
+
self,
|
|
175
|
+
stream_id: int,
|
|
176
|
+
*,
|
|
177
|
+
run_id: typing.Optional[int] = None,
|
|
178
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
179
|
+
) -> typing.Dict[str, typing.Any]:
|
|
180
|
+
"""
|
|
181
|
+
Parameters
|
|
182
|
+
----------
|
|
183
|
+
stream_id : int
|
|
184
|
+
|
|
185
|
+
run_id : typing.Optional[int]
|
|
186
|
+
|
|
187
|
+
request_options : typing.Optional[RequestOptions]
|
|
188
|
+
Request-specific configuration.
|
|
189
|
+
|
|
190
|
+
Returns
|
|
191
|
+
-------
|
|
192
|
+
typing.Dict[str, typing.Any]
|
|
193
|
+
Successful Response
|
|
194
|
+
|
|
195
|
+
Examples
|
|
196
|
+
--------
|
|
197
|
+
from camb import CambApi
|
|
198
|
+
|
|
199
|
+
client = CambApi(
|
|
200
|
+
api_key="YOUR_API_KEY",
|
|
201
|
+
)
|
|
202
|
+
client.streaming.destroy_stream(
|
|
203
|
+
stream_id=1,
|
|
204
|
+
)
|
|
205
|
+
"""
|
|
206
|
+
_response = self._raw_client.destroy_stream(stream_id, run_id=run_id, request_options=request_options)
|
|
207
|
+
return _response.data
|
|
208
|
+
|
|
209
|
+
def patch_stream_data(
|
|
210
|
+
self,
|
|
211
|
+
stream_id: int,
|
|
212
|
+
*,
|
|
213
|
+
run_id: typing.Optional[int] = None,
|
|
214
|
+
start_time: typing.Optional[dt.datetime] = OMIT,
|
|
215
|
+
end_time: typing.Optional[dt.datetime] = OMIT,
|
|
216
|
+
payload: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
217
|
+
target_languages: typing.Optional[typing.Sequence[Languages]] = OMIT,
|
|
218
|
+
timezone: typing.Optional[str] = OMIT,
|
|
219
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
220
|
+
) -> typing.Dict[str, typing.Any]:
|
|
221
|
+
"""
|
|
222
|
+
Parameters
|
|
223
|
+
----------
|
|
224
|
+
stream_id : int
|
|
225
|
+
|
|
226
|
+
run_id : typing.Optional[int]
|
|
227
|
+
|
|
228
|
+
start_time : typing.Optional[dt.datetime]
|
|
229
|
+
|
|
230
|
+
end_time : typing.Optional[dt.datetime]
|
|
231
|
+
|
|
232
|
+
payload : typing.Optional[typing.Dict[str, typing.Any]]
|
|
233
|
+
|
|
234
|
+
target_languages : typing.Optional[typing.Sequence[Languages]]
|
|
235
|
+
|
|
236
|
+
timezone : typing.Optional[str]
|
|
237
|
+
|
|
238
|
+
request_options : typing.Optional[RequestOptions]
|
|
239
|
+
Request-specific configuration.
|
|
240
|
+
|
|
241
|
+
Returns
|
|
242
|
+
-------
|
|
243
|
+
typing.Dict[str, typing.Any]
|
|
244
|
+
Successful Response
|
|
245
|
+
|
|
246
|
+
Examples
|
|
247
|
+
--------
|
|
248
|
+
from camb import CambApi
|
|
249
|
+
|
|
250
|
+
client = CambApi(
|
|
251
|
+
api_key="YOUR_API_KEY",
|
|
252
|
+
)
|
|
253
|
+
client.streaming.patch_stream_data(
|
|
254
|
+
stream_id=1,
|
|
255
|
+
)
|
|
256
|
+
"""
|
|
257
|
+
_response = self._raw_client.patch_stream_data(
|
|
258
|
+
stream_id,
|
|
259
|
+
run_id=run_id,
|
|
260
|
+
start_time=start_time,
|
|
261
|
+
end_time=end_time,
|
|
262
|
+
payload=payload,
|
|
263
|
+
target_languages=target_languages,
|
|
264
|
+
timezone=timezone,
|
|
265
|
+
request_options=request_options,
|
|
266
|
+
)
|
|
267
|
+
return _response.data
|
|
268
|
+
|
|
269
|
+
def get_probe_stream(
|
|
270
|
+
self,
|
|
271
|
+
*,
|
|
272
|
+
url: str,
|
|
273
|
+
run_id: typing.Optional[int] = None,
|
|
274
|
+
passphrase: typing.Optional[str] = OMIT,
|
|
275
|
+
stream_id: typing.Optional[str] = OMIT,
|
|
276
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
277
|
+
) -> GetProbeStreamOut:
|
|
278
|
+
"""
|
|
279
|
+
Parameters
|
|
280
|
+
----------
|
|
281
|
+
url : str
|
|
282
|
+
|
|
283
|
+
run_id : typing.Optional[int]
|
|
284
|
+
|
|
285
|
+
passphrase : typing.Optional[str]
|
|
286
|
+
|
|
287
|
+
stream_id : typing.Optional[str]
|
|
288
|
+
|
|
289
|
+
request_options : typing.Optional[RequestOptions]
|
|
290
|
+
Request-specific configuration.
|
|
291
|
+
|
|
292
|
+
Returns
|
|
293
|
+
-------
|
|
294
|
+
GetProbeStreamOut
|
|
295
|
+
Successful Response
|
|
296
|
+
|
|
297
|
+
Examples
|
|
298
|
+
--------
|
|
299
|
+
from camb import CambApi
|
|
300
|
+
|
|
301
|
+
client = CambApi(
|
|
302
|
+
api_key="YOUR_API_KEY",
|
|
303
|
+
)
|
|
304
|
+
client.streaming.get_probe_stream(
|
|
305
|
+
url="url",
|
|
306
|
+
)
|
|
307
|
+
"""
|
|
308
|
+
_response = self._raw_client.get_probe_stream(
|
|
309
|
+
url=url, run_id=run_id, passphrase=passphrase, stream_id=stream_id, request_options=request_options
|
|
310
|
+
)
|
|
311
|
+
return _response.data
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
class AsyncStreamingClient:
|
|
315
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
316
|
+
self._raw_client = AsyncRawStreamingClient(client_wrapper=client_wrapper)
|
|
317
|
+
|
|
318
|
+
@property
|
|
319
|
+
def with_raw_response(self) -> AsyncRawStreamingClient:
|
|
320
|
+
"""
|
|
321
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
322
|
+
|
|
323
|
+
Returns
|
|
324
|
+
-------
|
|
325
|
+
AsyncRawStreamingClient
|
|
326
|
+
"""
|
|
327
|
+
return self._raw_client
|
|
328
|
+
|
|
329
|
+
async def create_stream(
|
|
330
|
+
self,
|
|
331
|
+
*,
|
|
332
|
+
voices: typing.Sequence[int],
|
|
333
|
+
dictionaries: typing.Sequence[int],
|
|
334
|
+
config: ConfigStream,
|
|
335
|
+
source_stream: SourceStream,
|
|
336
|
+
target_streams: typing.Sequence[TargetStream],
|
|
337
|
+
name: typing.Optional[str] = OMIT,
|
|
338
|
+
description: typing.Optional[str] = OMIT,
|
|
339
|
+
initial_delay: typing.Optional[int] = OMIT,
|
|
340
|
+
timeout_in_mins: typing.Optional[int] = OMIT,
|
|
341
|
+
start_time: typing.Optional[dt.datetime] = OMIT,
|
|
342
|
+
end_time: typing.Optional[dt.datetime] = OMIT,
|
|
343
|
+
timezone: typing.Optional[str] = OMIT,
|
|
344
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
345
|
+
) -> CreateStreamOut:
|
|
346
|
+
"""
|
|
347
|
+
Parameters
|
|
348
|
+
----------
|
|
349
|
+
voices : typing.Sequence[int]
|
|
350
|
+
List of voice identifiers to be used in the stream.
|
|
351
|
+
|
|
352
|
+
dictionaries : typing.Sequence[int]
|
|
353
|
+
List of dictionary identifiers to be used in the stream.
|
|
354
|
+
|
|
355
|
+
config : ConfigStream
|
|
356
|
+
The shared configuration for the streaming pipeline.
|
|
357
|
+
|
|
358
|
+
source_stream : SourceStream
|
|
359
|
+
The source stream configuration details.
|
|
360
|
+
|
|
361
|
+
target_streams : typing.Sequence[TargetStream]
|
|
362
|
+
List of target stream configurations.
|
|
363
|
+
|
|
364
|
+
name : typing.Optional[str]
|
|
365
|
+
The name of the stream.
|
|
366
|
+
|
|
367
|
+
description : typing.Optional[str]
|
|
368
|
+
The description of the stream.
|
|
369
|
+
|
|
370
|
+
initial_delay : typing.Optional[int]
|
|
371
|
+
The initial delay in seconds before starting the stream creation process.
|
|
372
|
+
|
|
373
|
+
timeout_in_mins : typing.Optional[int]
|
|
374
|
+
The maximum duration in minutes for the stream creation process before timing out.
|
|
375
|
+
|
|
376
|
+
start_time : typing.Optional[dt.datetime]
|
|
377
|
+
|
|
378
|
+
end_time : typing.Optional[dt.datetime]
|
|
379
|
+
|
|
380
|
+
timezone : typing.Optional[str]
|
|
381
|
+
|
|
382
|
+
request_options : typing.Optional[RequestOptions]
|
|
383
|
+
Request-specific configuration.
|
|
384
|
+
|
|
385
|
+
Returns
|
|
386
|
+
-------
|
|
387
|
+
CreateStreamOut
|
|
388
|
+
Successful Response
|
|
389
|
+
|
|
390
|
+
Examples
|
|
391
|
+
--------
|
|
392
|
+
import asyncio
|
|
393
|
+
|
|
394
|
+
from camb import AsyncCambApi, ConfigStream, SourceStream, TargetStream
|
|
395
|
+
|
|
396
|
+
client = AsyncCambApi(
|
|
397
|
+
api_key="YOUR_API_KEY",
|
|
398
|
+
)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
async def main() -> None:
|
|
402
|
+
await client.streaming.create_stream(
|
|
403
|
+
voices=[1],
|
|
404
|
+
dictionaries=[1],
|
|
405
|
+
config=ConfigStream(),
|
|
406
|
+
source_stream=SourceStream(
|
|
407
|
+
language=1,
|
|
408
|
+
url="url",
|
|
409
|
+
),
|
|
410
|
+
target_streams=[
|
|
411
|
+
TargetStream(
|
|
412
|
+
languages=[1],
|
|
413
|
+
url="url",
|
|
414
|
+
type=1,
|
|
415
|
+
)
|
|
416
|
+
],
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
asyncio.run(main())
|
|
421
|
+
"""
|
|
422
|
+
_response = await self._raw_client.create_stream(
|
|
423
|
+
voices=voices,
|
|
424
|
+
dictionaries=dictionaries,
|
|
425
|
+
config=config,
|
|
426
|
+
source_stream=source_stream,
|
|
427
|
+
target_streams=target_streams,
|
|
428
|
+
name=name,
|
|
429
|
+
description=description,
|
|
430
|
+
initial_delay=initial_delay,
|
|
431
|
+
timeout_in_mins=timeout_in_mins,
|
|
432
|
+
start_time=start_time,
|
|
433
|
+
end_time=end_time,
|
|
434
|
+
timezone=timezone,
|
|
435
|
+
request_options=request_options,
|
|
436
|
+
)
|
|
437
|
+
return _response.data
|
|
438
|
+
|
|
439
|
+
async def get_stream_result(
|
|
440
|
+
self,
|
|
441
|
+
stream_id: int,
|
|
442
|
+
*,
|
|
443
|
+
run_id: typing.Optional[int] = None,
|
|
444
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
445
|
+
) -> typing.Dict[str, typing.Any]:
|
|
446
|
+
"""
|
|
447
|
+
Parameters
|
|
448
|
+
----------
|
|
449
|
+
stream_id : int
|
|
450
|
+
|
|
451
|
+
run_id : typing.Optional[int]
|
|
452
|
+
|
|
453
|
+
request_options : typing.Optional[RequestOptions]
|
|
454
|
+
Request-specific configuration.
|
|
455
|
+
|
|
456
|
+
Returns
|
|
457
|
+
-------
|
|
458
|
+
typing.Dict[str, typing.Any]
|
|
459
|
+
Successful Response
|
|
460
|
+
|
|
461
|
+
Examples
|
|
462
|
+
--------
|
|
463
|
+
import asyncio
|
|
464
|
+
|
|
465
|
+
from camb import AsyncCambApi
|
|
466
|
+
|
|
467
|
+
client = AsyncCambApi(
|
|
468
|
+
api_key="YOUR_API_KEY",
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
async def main() -> None:
|
|
473
|
+
await client.streaming.get_stream_result(
|
|
474
|
+
stream_id=1,
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
asyncio.run(main())
|
|
479
|
+
"""
|
|
480
|
+
_response = await self._raw_client.get_stream_result(stream_id, run_id=run_id, request_options=request_options)
|
|
481
|
+
return _response.data
|
|
482
|
+
|
|
483
|
+
async def destroy_stream(
|
|
484
|
+
self,
|
|
485
|
+
stream_id: int,
|
|
486
|
+
*,
|
|
487
|
+
run_id: typing.Optional[int] = None,
|
|
488
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
489
|
+
) -> typing.Dict[str, typing.Any]:
|
|
490
|
+
"""
|
|
491
|
+
Parameters
|
|
492
|
+
----------
|
|
493
|
+
stream_id : int
|
|
494
|
+
|
|
495
|
+
run_id : typing.Optional[int]
|
|
496
|
+
|
|
497
|
+
request_options : typing.Optional[RequestOptions]
|
|
498
|
+
Request-specific configuration.
|
|
499
|
+
|
|
500
|
+
Returns
|
|
501
|
+
-------
|
|
502
|
+
typing.Dict[str, typing.Any]
|
|
503
|
+
Successful Response
|
|
504
|
+
|
|
505
|
+
Examples
|
|
506
|
+
--------
|
|
507
|
+
import asyncio
|
|
508
|
+
|
|
509
|
+
from camb import AsyncCambApi
|
|
510
|
+
|
|
511
|
+
client = AsyncCambApi(
|
|
512
|
+
api_key="YOUR_API_KEY",
|
|
513
|
+
)
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
async def main() -> None:
|
|
517
|
+
await client.streaming.destroy_stream(
|
|
518
|
+
stream_id=1,
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
asyncio.run(main())
|
|
523
|
+
"""
|
|
524
|
+
_response = await self._raw_client.destroy_stream(stream_id, run_id=run_id, request_options=request_options)
|
|
525
|
+
return _response.data
|
|
526
|
+
|
|
527
|
+
async def patch_stream_data(
|
|
528
|
+
self,
|
|
529
|
+
stream_id: int,
|
|
530
|
+
*,
|
|
531
|
+
run_id: typing.Optional[int] = None,
|
|
532
|
+
start_time: typing.Optional[dt.datetime] = OMIT,
|
|
533
|
+
end_time: typing.Optional[dt.datetime] = OMIT,
|
|
534
|
+
payload: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
535
|
+
target_languages: typing.Optional[typing.Sequence[Languages]] = OMIT,
|
|
536
|
+
timezone: typing.Optional[str] = OMIT,
|
|
537
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
538
|
+
) -> typing.Dict[str, typing.Any]:
|
|
539
|
+
"""
|
|
540
|
+
Parameters
|
|
541
|
+
----------
|
|
542
|
+
stream_id : int
|
|
543
|
+
|
|
544
|
+
run_id : typing.Optional[int]
|
|
545
|
+
|
|
546
|
+
start_time : typing.Optional[dt.datetime]
|
|
547
|
+
|
|
548
|
+
end_time : typing.Optional[dt.datetime]
|
|
549
|
+
|
|
550
|
+
payload : typing.Optional[typing.Dict[str, typing.Any]]
|
|
551
|
+
|
|
552
|
+
target_languages : typing.Optional[typing.Sequence[Languages]]
|
|
553
|
+
|
|
554
|
+
timezone : typing.Optional[str]
|
|
555
|
+
|
|
556
|
+
request_options : typing.Optional[RequestOptions]
|
|
557
|
+
Request-specific configuration.
|
|
558
|
+
|
|
559
|
+
Returns
|
|
560
|
+
-------
|
|
561
|
+
typing.Dict[str, typing.Any]
|
|
562
|
+
Successful Response
|
|
563
|
+
|
|
564
|
+
Examples
|
|
565
|
+
--------
|
|
566
|
+
import asyncio
|
|
567
|
+
|
|
568
|
+
from camb import AsyncCambApi
|
|
569
|
+
|
|
570
|
+
client = AsyncCambApi(
|
|
571
|
+
api_key="YOUR_API_KEY",
|
|
572
|
+
)
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
async def main() -> None:
|
|
576
|
+
await client.streaming.patch_stream_data(
|
|
577
|
+
stream_id=1,
|
|
578
|
+
)
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
asyncio.run(main())
|
|
582
|
+
"""
|
|
583
|
+
_response = await self._raw_client.patch_stream_data(
|
|
584
|
+
stream_id,
|
|
585
|
+
run_id=run_id,
|
|
586
|
+
start_time=start_time,
|
|
587
|
+
end_time=end_time,
|
|
588
|
+
payload=payload,
|
|
589
|
+
target_languages=target_languages,
|
|
590
|
+
timezone=timezone,
|
|
591
|
+
request_options=request_options,
|
|
592
|
+
)
|
|
593
|
+
return _response.data
|
|
594
|
+
|
|
595
|
+
async def get_probe_stream(
|
|
596
|
+
self,
|
|
597
|
+
*,
|
|
598
|
+
url: str,
|
|
599
|
+
run_id: typing.Optional[int] = None,
|
|
600
|
+
passphrase: typing.Optional[str] = OMIT,
|
|
601
|
+
stream_id: typing.Optional[str] = OMIT,
|
|
602
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
603
|
+
) -> GetProbeStreamOut:
|
|
604
|
+
"""
|
|
605
|
+
Parameters
|
|
606
|
+
----------
|
|
607
|
+
url : str
|
|
608
|
+
|
|
609
|
+
run_id : typing.Optional[int]
|
|
610
|
+
|
|
611
|
+
passphrase : typing.Optional[str]
|
|
612
|
+
|
|
613
|
+
stream_id : typing.Optional[str]
|
|
614
|
+
|
|
615
|
+
request_options : typing.Optional[RequestOptions]
|
|
616
|
+
Request-specific configuration.
|
|
617
|
+
|
|
618
|
+
Returns
|
|
619
|
+
-------
|
|
620
|
+
GetProbeStreamOut
|
|
621
|
+
Successful Response
|
|
622
|
+
|
|
623
|
+
Examples
|
|
624
|
+
--------
|
|
625
|
+
import asyncio
|
|
626
|
+
|
|
627
|
+
from camb import AsyncCambApi
|
|
628
|
+
|
|
629
|
+
client = AsyncCambApi(
|
|
630
|
+
api_key="YOUR_API_KEY",
|
|
631
|
+
)
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
async def main() -> None:
|
|
635
|
+
await client.streaming.get_probe_stream(
|
|
636
|
+
url="url",
|
|
637
|
+
)
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
asyncio.run(main())
|
|
641
|
+
"""
|
|
642
|
+
_response = await self._raw_client.get_probe_stream(
|
|
643
|
+
url=url, run_id=run_id, passphrase=passphrase, stream_id=stream_id, request_options=request_options
|
|
644
|
+
)
|
|
645
|
+
return _response.data
|