camb-sdk 1.0.0__py3-none-any.whl → 1.0.2__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.
Potentially problematic release.
This version of camb-sdk might be problematic. Click here for more details.
- {camb_sdk-1.0.0.dist-info → camb_sdk-1.0.2.dist-info}/METADATA +5 -5
- {camb_sdk-1.0.0.dist-info → camb_sdk-1.0.2.dist-info}/RECORD +8 -8
- cambai/__init__.py +1 -1
- cambai/api/apis_api.py +290 -287
- cambai/models/__init__.py +1 -1
- {camb_sdk-1.0.0.dist-info → camb_sdk-1.0.2.dist-info}/WHEEL +0 -0
- {camb_sdk-1.0.0.dist-info → camb_sdk-1.0.2.dist-info}/licenses/LICENSE +0 -0
- {camb_sdk-1.0.0.dist-info → camb_sdk-1.0.2.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: camb-sdk
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Camb AI Python SDK for Text-to-Speech, Voice Generation, and Audio APIs
|
|
5
5
|
Author-email: Camb AI <support@camb.ai>
|
|
6
6
|
License: MIT
|
|
@@ -18,9 +18,9 @@ Dynamic: license-file
|
|
|
18
18
|
|
|
19
19
|
# Camb AI Python SDK 🎙️
|
|
20
20
|
|
|
21
|
-
[](https://pypi.org/project/camb-sdk/)
|
|
22
|
+
[](https://github.com/Camb-ai/cambai-python-sdk/blob/master/LICENSE)
|
|
23
|
+
[](https://github.com/Camb-ai/cambai-python-sdk/actions/workflows/python.yml)
|
|
24
24
|
|
|
25
25
|
The official Python SDK for interacting with Camb AI's powerful voice and audio generation APIs. Create expressive speech, unique voices, and rich soundscapes with just a few lines of Python.
|
|
26
26
|
|
|
@@ -216,7 +216,7 @@ client = CambAI(api_key="YOUR_CAMB_API_KEY")
|
|
|
216
216
|
|
|
217
217
|
# Call all target languages
|
|
218
218
|
print("Listing target languages...")
|
|
219
|
-
target_languages =
|
|
219
|
+
target_languages = client.get_target_languages()
|
|
220
220
|
print(f"Found {len(target_languages)} target languages:")
|
|
221
221
|
for language in target_languages:
|
|
222
222
|
print(f" - {language}")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
camb_sdk-1.0.
|
|
2
|
-
cambai/__init__.py,sha256=
|
|
1
|
+
camb_sdk-1.0.2.dist-info/licenses/LICENSE,sha256=wVE3pAs9Te7Joa1AmJJ0JVd8CNgNmslblQaNgbozkiU,1063
|
|
2
|
+
cambai/__init__.py,sha256=W459oGpo1ZtKXehhsAR0eLSAuqwm0nnmagAHaaXK_I8,7247
|
|
3
3
|
cambai/api_client.py,sha256=YZhog2TzYjTilrhh3QV_mzZU3zdXA1fQcFXOiEYUNVs,27660
|
|
4
4
|
cambai/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
5
5
|
cambai/configuration.py,sha256=CZpW7p_C-4S6S5FtXaI3uQjh8dgpnHyyw2s40E83Tgs,18898
|
|
@@ -7,7 +7,7 @@ cambai/exceptions.py,sha256=upZXBQh1bx93N8JIPJh89j67pArS4oxcCmZ_cfdK2XU,6471
|
|
|
7
7
|
cambai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
cambai/rest.py,sha256=n3SSWXErpiSqlEvu6lEkTiJQLxjbrFkhZC1rF7biJJQ,9460
|
|
9
9
|
cambai/api/__init__.py,sha256=IndnP-ftH1sQhRfojuX4VOhQ33JSFfGYP6Ns6YZ0y6k,460
|
|
10
|
-
cambai/api/apis_api.py,sha256=
|
|
10
|
+
cambai/api/apis_api.py,sha256=HGvw6hLwNK26seunmW4Jqi9v4qk7OTB_bzsDCa2seN8,414750
|
|
11
11
|
cambai/api/audio_separation_api.py,sha256=sN9JsmRsQIk6cAvVY5v5J52oKUcRVxysXfFJ0gwXZTE,32210
|
|
12
12
|
cambai/api/dictionaries_api.py,sha256=2Sfhiy7hJg8_nyE2zj0jjaKhf4Ze2sWyYmmN1KDqYTU,10548
|
|
13
13
|
cambai/api/dub_api.py,sha256=iWh7VvFGpqXEvfbpLgdeIavVHXKz5q4prDRLUNSMJLQ,36856
|
|
@@ -15,7 +15,7 @@ cambai/api/stories_api.py,sha256=PrhkUR8l0zxx2DGEKNj-V0IeU2ODzzjdJvbPHNWRHHk,620
|
|
|
15
15
|
cambai/api/text_to_audio_api.py,sha256=1i6ylgfqcRBl6AthgAFvRqaWRCy1enHqB5De7_61laM,32880
|
|
16
16
|
cambai/api/text_to_speech_api.py,sha256=ACI2QV9RQ4OMwrq81KLu1GnPMF9DGAUNfar36wWRUdw,21484
|
|
17
17
|
cambai/api/text_to_voice_api.py,sha256=QXqTSp-9BnQE0JNHJlRj72ILhPXwCY2Zmtvn1zjYw4U,33281
|
|
18
|
-
cambai/models/__init__.py,sha256=
|
|
18
|
+
cambai/models/__init__.py,sha256=Bvd8KrM8cG-51UQ10lNdCEekfhq_mo2ZVAMllTkEwb0,3425
|
|
19
19
|
cambai/models/audio_output_file_url_response.py,sha256=QJHmwvf03zIkjUlMppTLMqi-1xU0cg_Y7VkL86ePUmg,2662
|
|
20
20
|
cambai/models/audio_output_type.py,sha256=WY9zdNlSFpq8GAQH4MnHKxOmNlgOHJ8Z9DSlXIjOUwY,780
|
|
21
21
|
cambai/models/audio_separation_run_info_response.py,sha256=iqL361fqETtZjOHCAKxhy88slY30rRkNU6A3ezFlWI4,3000
|
|
@@ -58,7 +58,7 @@ cambai/models/validation_error.py,sha256=Usdc8EC3OVyDc3KnPaQk_t6CUMVHUVrHltlbJv9
|
|
|
58
58
|
cambai/models/validation_error_loc_inner.py,sha256=wHiW_qKw46E2pUdOnesgpdnuqpTX9IQTaEOVDgph5_E,4885
|
|
59
59
|
cambai/models/video_output_type_without_avi.py,sha256=DvyuKHAv7K-Y_RbO-y2TDI4R7qbsEs_SE_g4f0CpSOs,792
|
|
60
60
|
cambai/models/voice_item.py,sha256=V-7EmmVLFzISlu2xZVUfQuD-kOg-08DuGyePY7YyWK0,4070
|
|
61
|
-
camb_sdk-1.0.
|
|
62
|
-
camb_sdk-1.0.
|
|
63
|
-
camb_sdk-1.0.
|
|
64
|
-
camb_sdk-1.0.
|
|
61
|
+
camb_sdk-1.0.2.dist-info/METADATA,sha256=vFt1FB7smT24aIzh4qgE2X-UfKDk0THKGjgAn9SP8ao,7751
|
|
62
|
+
camb_sdk-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
63
|
+
camb_sdk-1.0.2.dist-info/top_level.txt,sha256=iqT9vxFBtFsESik9PDn3hFfTRpAl_ULmIbRDX90XaY0,7
|
|
64
|
+
camb_sdk-1.0.2.dist-info/RECORD,,
|
cambai/__init__.py
CHANGED
|
@@ -108,7 +108,7 @@ from cambai.models.body_translate_translate_post import BodyTranslateTranslatePo
|
|
|
108
108
|
from cambai.models.create_api_key_request_payload import CreateAPIKeyRequestPayload as CreateAPIKeyRequestPayload
|
|
109
109
|
from cambai.models.create_custom_voice_out import CreateCustomVoiceOut as CreateCustomVoiceOut
|
|
110
110
|
from cambai.models.create_tts_request_payload import CreateTTSRequestPayload as CreateTTSRequestPayload
|
|
111
|
-
from cambai.models.create_tts_stream_request_payload import CreateTTSStreamRequestPayload as CreateTTSStreamRequestPayload
|
|
111
|
+
# from cambai.models.create_tts_stream_request_payload import CreateTTSStreamRequestPayload as CreateTTSStreamRequestPayload
|
|
112
112
|
from cambai.models.create_text_to_audio_request_payload import CreateTextToAudioRequestPayload as CreateTextToAudioRequestPayload
|
|
113
113
|
from cambai.models.create_text_to_voice_request_payload import CreateTextToVoiceRequestPayload as CreateTextToVoiceRequestPayload
|
|
114
114
|
from cambai.models.create_translated_story_request_payload import CreateTranslatedStoryRequestPayload as CreateTranslatedStoryRequestPayload
|
cambai/api/apis_api.py
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import os
|
|
14
14
|
import time
|
|
15
15
|
import warnings
|
|
16
|
+
import json
|
|
16
17
|
# Constants for API operations
|
|
17
18
|
TIMEOUT = 60
|
|
18
19
|
POLL_INTERVAL = 5
|
|
@@ -29,7 +30,7 @@ from cambai.models.audio_separation_run_info_response import AudioSeparationRunI
|
|
|
29
30
|
from cambai.models.body_translate_translate_post import BodyTranslateTranslatePost
|
|
30
31
|
from cambai.models.create_custom_voice_out import CreateCustomVoiceOut
|
|
31
32
|
from cambai.models.create_tts_request_payload import CreateTTSRequestPayload
|
|
32
|
-
from cambai.models.create_tts_stream_request_payload import CreateTTSStreamRequestPayload
|
|
33
|
+
# from cambai.models.create_tts_stream_request_payload import CreateTTSStreamRequestPayload
|
|
33
34
|
from cambai.models.create_text_to_audio_request_payload import CreateTextToAudioRequestPayload
|
|
34
35
|
from cambai.models.create_text_to_voice_request_payload import CreateTextToVoiceRequestPayload
|
|
35
36
|
from cambai.models.create_translated_story_request_payload import CreateTranslatedStoryRequestPayload
|
|
@@ -66,10 +67,9 @@ class CambAI:
|
|
|
66
67
|
def __init__(self, api_client=None, api_key: Optional[str] = None) -> None:
|
|
67
68
|
if api_client is None:
|
|
68
69
|
configuration = Configuration()
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
configuration.api_key['APIKeyHeader'] = os.environ.get("CAMB_API_KEY")
|
|
70
|
+
configuration.api_key['APIKeyHeader'] = api_key or os.environ.get("CAMB_API_KEY")
|
|
71
|
+
if configuration.api_key['APIKeyHeader'] is None:
|
|
72
|
+
raise ValueError("API key not provided. Please provide api_key or set CAMB_API_KEY environment variable.")
|
|
73
73
|
api_client = ApiClient(configuration=configuration)
|
|
74
74
|
self.api_client = api_client
|
|
75
75
|
|
|
@@ -437,7 +437,6 @@ class CambAI:
|
|
|
437
437
|
if verbose:
|
|
438
438
|
print(f"Processing complete! Run ID: {result.run_id}")
|
|
439
439
|
print("Retrieving dubbing result...")
|
|
440
|
-
|
|
441
440
|
response = self.get_dubbed_run_info_by_id(result.run_id)
|
|
442
441
|
return response
|
|
443
442
|
|
|
@@ -3699,283 +3698,283 @@ class CambAI:
|
|
|
3699
3698
|
|
|
3700
3699
|
|
|
3701
3700
|
|
|
3702
|
-
@validate_call
|
|
3703
|
-
def create_tts_stream(
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
) -> bytearray:
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
@validate_call
|
|
3771
|
-
def create_tts_stream_with_http_info(
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
) -> ApiResponse[bytearray]:
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
@validate_call
|
|
3839
|
-
def create_tts_stream_without_preload_content(
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
) -> RESTResponseType:
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
def _create_tts_stream_serialize(
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
) -> RequestSerialized:
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3701
|
+
# @validate_call
|
|
3702
|
+
# def create_tts_stream(
|
|
3703
|
+
# self,
|
|
3704
|
+
# create_tts_stream_request_payload: CreateTTSStreamRequestPayload,
|
|
3705
|
+
# _request_timeout: Union[
|
|
3706
|
+
# None,
|
|
3707
|
+
# Annotated[StrictFloat, Field(gt=0)],
|
|
3708
|
+
# Tuple[
|
|
3709
|
+
# Annotated[StrictFloat, Field(gt=0)],
|
|
3710
|
+
# Annotated[StrictFloat, Field(gt=0)]
|
|
3711
|
+
# ]
|
|
3712
|
+
# ] = None,
|
|
3713
|
+
# _request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3714
|
+
# _content_type: Optional[StrictStr] = None,
|
|
3715
|
+
# _headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3716
|
+
# _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3717
|
+
# ) -> bytearray:
|
|
3718
|
+
# """Create TTS Stream
|
|
3719
|
+
|
|
3720
|
+
# Stream text-to-speech audio in real-time
|
|
3721
|
+
|
|
3722
|
+
# :param create_tts_stream_request_payload: (required)
|
|
3723
|
+
# :type create_tts_stream_request_payload: CreateTTSStreamRequestPayload
|
|
3724
|
+
# :param _request_timeout: timeout setting for this request. If one
|
|
3725
|
+
# number provided, it will be total request
|
|
3726
|
+
# timeout. It can also be a pair (tuple) of
|
|
3727
|
+
# (connection, read) timeouts.
|
|
3728
|
+
# :type _request_timeout: int, tuple(int, int), optional
|
|
3729
|
+
# :param _request_auth: set to override the auth_settings for an a single
|
|
3730
|
+
# request; this effectively ignores the
|
|
3731
|
+
# authentication in the spec for a single request.
|
|
3732
|
+
# :type _request_auth: dict, optional
|
|
3733
|
+
# :param _content_type: force content-type for the request.
|
|
3734
|
+
# :type _content_type: str, Optional
|
|
3735
|
+
# :param _headers: set to override the headers for a single
|
|
3736
|
+
# request; this effectively ignores the headers
|
|
3737
|
+
# in the spec for a single request.
|
|
3738
|
+
# :type _headers: dict, optional
|
|
3739
|
+
# :param _host_index: set to override the host_index for a single
|
|
3740
|
+
# request; this effectively ignores the host_index
|
|
3741
|
+
# in the spec for a single request.
|
|
3742
|
+
# :type _host_index: int, optional
|
|
3743
|
+
# :return: Returns the result object.
|
|
3744
|
+
# """ # noqa: E501
|
|
3745
|
+
|
|
3746
|
+
# _param = self._create_tts_stream_serialize(
|
|
3747
|
+
# create_tts_stream_request_payload=create_tts_stream_request_payload,
|
|
3748
|
+
# _request_auth=_request_auth,
|
|
3749
|
+
# _content_type=_content_type,
|
|
3750
|
+
# _headers=_headers,
|
|
3751
|
+
# _host_index=_host_index
|
|
3752
|
+
# )
|
|
3753
|
+
|
|
3754
|
+
# _response_types_map: Dict[str, Optional[str]] = {
|
|
3755
|
+
# '200': "bytearray",
|
|
3756
|
+
# '422': "HTTPValidationError",
|
|
3757
|
+
# }
|
|
3758
|
+
# response_data = self.api_client.call_api(
|
|
3759
|
+
# *_param,
|
|
3760
|
+
# _request_timeout=_request_timeout
|
|
3761
|
+
# )
|
|
3762
|
+
# response_data.read()
|
|
3763
|
+
# return self.api_client.response_deserialize(
|
|
3764
|
+
# response_data=response_data,
|
|
3765
|
+
# response_types_map=_response_types_map,
|
|
3766
|
+
# ).data
|
|
3767
|
+
|
|
3768
|
+
|
|
3769
|
+
# @validate_call
|
|
3770
|
+
# def create_tts_stream_with_http_info(
|
|
3771
|
+
# self,
|
|
3772
|
+
# create_tts_stream_request_payload: CreateTTSStreamRequestPayload,
|
|
3773
|
+
# _request_timeout: Union[
|
|
3774
|
+
# None,
|
|
3775
|
+
# Annotated[StrictFloat, Field(gt=0)],
|
|
3776
|
+
# Tuple[
|
|
3777
|
+
# Annotated[StrictFloat, Field(gt=0)],
|
|
3778
|
+
# Annotated[StrictFloat, Field(gt=0)]
|
|
3779
|
+
# ]
|
|
3780
|
+
# ] = None,
|
|
3781
|
+
# _request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3782
|
+
# _content_type: Optional[StrictStr] = None,
|
|
3783
|
+
# _headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3784
|
+
# _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3785
|
+
# ) -> ApiResponse[bytearray]:
|
|
3786
|
+
# """Create TTS Stream
|
|
3787
|
+
|
|
3788
|
+
# Stream text-to-speech audio in real-time
|
|
3789
|
+
|
|
3790
|
+
# :param create_tts_stream_request_payload: (required)
|
|
3791
|
+
# :type create_tts_stream_request_payload: CreateTTSStreamRequestPayload
|
|
3792
|
+
# :param _request_timeout: timeout setting for this request. If one
|
|
3793
|
+
# number provided, it will be total request
|
|
3794
|
+
# timeout. It can also be a pair (tuple) of
|
|
3795
|
+
# (connection, read) timeouts.
|
|
3796
|
+
# :type _request_timeout: int, tuple(int, int), optional
|
|
3797
|
+
# :param _request_auth: set to override the auth_settings for an a single
|
|
3798
|
+
# request; this effectively ignores the
|
|
3799
|
+
# authentication in the spec for a single request.
|
|
3800
|
+
# :type _request_auth: dict, optional
|
|
3801
|
+
# :param _content_type: force content-type for the request.
|
|
3802
|
+
# :type _content_type: str, Optional
|
|
3803
|
+
# :param _headers: set to override the headers for a single
|
|
3804
|
+
# request; this effectively ignores the headers
|
|
3805
|
+
# in the spec for a single request.
|
|
3806
|
+
# :type _headers: dict, optional
|
|
3807
|
+
# :param _host_index: set to override the host_index for a single
|
|
3808
|
+
# request; this effectively ignores the host_index
|
|
3809
|
+
# in the spec for a single request.
|
|
3810
|
+
# :type _host_index: int, optional
|
|
3811
|
+
# :return: Returns the result object.
|
|
3812
|
+
# """ # noqa: E501
|
|
3813
|
+
|
|
3814
|
+
# _param = self._create_tts_stream_serialize(
|
|
3815
|
+
# create_tts_stream_request_payload=create_tts_stream_request_payload,
|
|
3816
|
+
# _request_auth=_request_auth,
|
|
3817
|
+
# _content_type=_content_type,
|
|
3818
|
+
# _headers=_headers,
|
|
3819
|
+
# _host_index=_host_index
|
|
3820
|
+
# )
|
|
3821
|
+
|
|
3822
|
+
# _response_types_map: Dict[str, Optional[str]] = {
|
|
3823
|
+
# '200': "bytearray",
|
|
3824
|
+
# '422': "HTTPValidationError",
|
|
3825
|
+
# }
|
|
3826
|
+
# response_data = self.api_client.call_api(
|
|
3827
|
+
# *_param,
|
|
3828
|
+
# _request_timeout=_request_timeout
|
|
3829
|
+
# )
|
|
3830
|
+
# response_data.read()
|
|
3831
|
+
# return self.api_client.response_deserialize(
|
|
3832
|
+
# response_data=response_data,
|
|
3833
|
+
# response_types_map=_response_types_map,
|
|
3834
|
+
# )
|
|
3835
|
+
|
|
3836
|
+
|
|
3837
|
+
# @validate_call
|
|
3838
|
+
# def create_tts_stream_without_preload_content(
|
|
3839
|
+
# self,
|
|
3840
|
+
# create_tts_stream_request_payload: CreateTTSStreamRequestPayload,
|
|
3841
|
+
# _request_timeout: Union[
|
|
3842
|
+
# None,
|
|
3843
|
+
# Annotated[StrictFloat, Field(gt=0)],
|
|
3844
|
+
# Tuple[
|
|
3845
|
+
# Annotated[StrictFloat, Field(gt=0)],
|
|
3846
|
+
# Annotated[StrictFloat, Field(gt=0)]
|
|
3847
|
+
# ]
|
|
3848
|
+
# ] = None,
|
|
3849
|
+
# _request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3850
|
+
# _content_type: Optional[StrictStr] = None,
|
|
3851
|
+
# _headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3852
|
+
# _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3853
|
+
# ) -> RESTResponseType:
|
|
3854
|
+
# """Create TTS Stream
|
|
3855
|
+
|
|
3856
|
+
# Stream text-to-speech audio in real-time
|
|
3857
|
+
|
|
3858
|
+
# :param create_tts_stream_request_payload: (required)
|
|
3859
|
+
# :type create_tts_stream_request_payload: CreateTTSStreamRequestPayload
|
|
3860
|
+
# :param _request_timeout: timeout setting for this request. If one
|
|
3861
|
+
# number provided, it will be total request
|
|
3862
|
+
# timeout. It can also be a pair (tuple) of
|
|
3863
|
+
# (connection, read) timeouts.
|
|
3864
|
+
# :type _request_timeout: int, tuple(int, int), optional
|
|
3865
|
+
# :param _request_auth: set to override the auth_settings for an a single
|
|
3866
|
+
# request; this effectively ignores the
|
|
3867
|
+
# authentication in the spec for a single request.
|
|
3868
|
+
# :type _request_auth: dict, optional
|
|
3869
|
+
# :param _content_type: force content-type for the request.
|
|
3870
|
+
# :type _content_type: str, Optional
|
|
3871
|
+
# :param _headers: set to override the headers for a single
|
|
3872
|
+
# request; this effectively ignores the headers
|
|
3873
|
+
# in the spec for a single request.
|
|
3874
|
+
# :type _headers: dict, optional
|
|
3875
|
+
# :param _host_index: set to override the host_index for a single
|
|
3876
|
+
# request; this effectively ignores the host_index
|
|
3877
|
+
# in the spec for a single request.
|
|
3878
|
+
# :type _host_index: int, optional
|
|
3879
|
+
# :return: Returns the result object.
|
|
3880
|
+
# """ # noqa: E501
|
|
3881
|
+
|
|
3882
|
+
# _param = self._create_tts_stream_serialize(
|
|
3883
|
+
# create_tts_stream_request_payload=create_tts_stream_request_payload,
|
|
3884
|
+
# _request_auth=_request_auth,
|
|
3885
|
+
# _content_type=_content_type,
|
|
3886
|
+
# _headers=_headers,
|
|
3887
|
+
# _host_index=_host_index
|
|
3888
|
+
# )
|
|
3889
|
+
|
|
3890
|
+
# _response_types_map: Dict[str, Optional[str]] = {
|
|
3891
|
+
# '200': "bytearray",
|
|
3892
|
+
# '422': "HTTPValidationError",
|
|
3893
|
+
# }
|
|
3894
|
+
# response_data = self.api_client.call_api(
|
|
3895
|
+
# *_param,
|
|
3896
|
+
# _request_timeout=_request_timeout
|
|
3897
|
+
# )
|
|
3898
|
+
# return response_data.response
|
|
3899
|
+
|
|
3900
|
+
# Deprecated
|
|
3901
|
+
# def _create_tts_stream_serialize(
|
|
3902
|
+
# self,
|
|
3903
|
+
# create_tts_stream_request_payload,
|
|
3904
|
+
# _request_auth,
|
|
3905
|
+
# _content_type,
|
|
3906
|
+
# _headers,
|
|
3907
|
+
# _host_index,
|
|
3908
|
+
# ) -> RequestSerialized:
|
|
3909
|
+
|
|
3910
|
+
# _host = None
|
|
3911
|
+
|
|
3912
|
+
# _collection_formats: Dict[str, str] = {
|
|
3913
|
+
# }
|
|
3914
|
+
|
|
3915
|
+
# _path_params: Dict[str, str] = {}
|
|
3916
|
+
# _query_params: List[Tuple[str, str]] = []
|
|
3917
|
+
# _header_params: Dict[str, Optional[str]] = _headers or {}
|
|
3918
|
+
# _form_params: List[Tuple[str, str]] = []
|
|
3919
|
+
# _files: Dict[
|
|
3920
|
+
# str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
3921
|
+
# ] = {}
|
|
3922
|
+
# _body_params: Optional[bytes] = None
|
|
3923
|
+
|
|
3924
|
+
# # process the path parameters
|
|
3925
|
+
# # process the query parameters
|
|
3926
|
+
# # process the header parameters
|
|
3927
|
+
# # process the form parameters
|
|
3928
|
+
# # process the body parameter
|
|
3929
|
+
# if create_tts_stream_request_payload is not None:
|
|
3930
|
+
# _body_params = create_tts_stream_request_payload
|
|
3931
|
+
|
|
3932
|
+
|
|
3933
|
+
# # set the HTTP header `Accept`
|
|
3934
|
+
# if 'Accept' not in _header_params:
|
|
3935
|
+
# _header_params['Accept'] = self.api_client.select_header_accept(
|
|
3936
|
+
# [
|
|
3937
|
+
# 'audio/flac',
|
|
3938
|
+
# 'audio/wav',
|
|
3939
|
+
# 'audio/aac',
|
|
3940
|
+
# 'audio/x-pcm',
|
|
3941
|
+
# 'application/json'
|
|
3942
|
+
# ]
|
|
3943
|
+
# )
|
|
3944
|
+
|
|
3945
|
+
# # set the HTTP header `Content-Type`
|
|
3946
|
+
# if _content_type:
|
|
3947
|
+
# _header_params['Content-Type'] = _content_type
|
|
3948
|
+
# else:
|
|
3949
|
+
# _default_content_type = (
|
|
3950
|
+
# self.api_client.select_header_content_type(
|
|
3951
|
+
# [
|
|
3952
|
+
# 'application/json'
|
|
3953
|
+
# ]
|
|
3954
|
+
# )
|
|
3955
|
+
# )
|
|
3956
|
+
# if _default_content_type is not None:
|
|
3957
|
+
# _header_params['Content-Type'] = _default_content_type
|
|
3958
|
+
|
|
3959
|
+
# # authentication setting
|
|
3960
|
+
# _auth_settings: List[str] = [
|
|
3961
|
+
# 'APIKeyHeader'
|
|
3962
|
+
# ]
|
|
3963
|
+
|
|
3964
|
+
# return self.api_client.param_serialize(
|
|
3965
|
+
# method='POST',
|
|
3966
|
+
# resource_path='/tts-stream',
|
|
3967
|
+
# path_params=_path_params,
|
|
3968
|
+
# query_params=_query_params,
|
|
3969
|
+
# header_params=_header_params,
|
|
3970
|
+
# body=_body_params,
|
|
3971
|
+
# post_params=_form_params,
|
|
3972
|
+
# files=_files,
|
|
3973
|
+
# auth_settings=_auth_settings,
|
|
3974
|
+
# collection_formats=_collection_formats,
|
|
3975
|
+
# _host=_host,
|
|
3976
|
+
# _request_auth=_request_auth
|
|
3977
|
+
# )
|
|
3979
3978
|
|
|
3980
3979
|
|
|
3981
3980
|
|
|
@@ -5087,10 +5086,14 @@ class CambAI:
|
|
|
5087
5086
|
_request_timeout=_request_timeout
|
|
5088
5087
|
)
|
|
5089
5088
|
response_data.read()
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5089
|
+
raw_data = json.loads(response_data.data.decode('utf-8'))
|
|
5090
|
+
|
|
5091
|
+
from cambai.models.run_info_response import RunInfoResponse
|
|
5092
|
+
return RunInfoResponse(
|
|
5093
|
+
output_video_url=raw_data.get('video_url'),
|
|
5094
|
+
output_audio_url=raw_data.get('audio_url'),
|
|
5095
|
+
transcript=raw_data.get('transcript')
|
|
5096
|
+
)
|
|
5094
5097
|
|
|
5095
5098
|
|
|
5096
5099
|
@validate_call
|
cambai/models/__init__.py
CHANGED
|
@@ -21,7 +21,7 @@ from cambai.models.body_translate_translate_post import BodyTranslateTranslatePo
|
|
|
21
21
|
from cambai.models.create_api_key_request_payload import CreateAPIKeyRequestPayload
|
|
22
22
|
from cambai.models.create_custom_voice_out import CreateCustomVoiceOut
|
|
23
23
|
from cambai.models.create_tts_request_payload import CreateTTSRequestPayload
|
|
24
|
-
from cambai.models.create_tts_stream_request_payload import CreateTTSStreamRequestPayload
|
|
24
|
+
# from cambai.models.create_tts_stream_request_payload import CreateTTSStreamRequestPayload
|
|
25
25
|
from cambai.models.create_text_to_audio_request_payload import CreateTextToAudioRequestPayload
|
|
26
26
|
from cambai.models.create_text_to_voice_request_payload import CreateTextToVoiceRequestPayload
|
|
27
27
|
from cambai.models.create_translated_story_request_payload import CreateTranslatedStoryRequestPayload
|
|
File without changes
|
|
File without changes
|
|
File without changes
|