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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: camb-sdk
3
- Version: 1.0.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
- [![PyPI version](https://img.shields.io/pypi/v/camb-ai-sdk.svg?style=flat-square)](https://pypi.org/project/camb-ai-sdk/)
22
- [![License](https://img.shields.io/pypi/l/camb-ai-sdk.svg?style=flat-square)](https://github.com/your-org/camb-ai-python-sdk/blob/main/LICENSE)
23
- [![Build Status](https://img.shields.io/github/actions/workflow/status/your-org/camb-ai-python-sdk/ci.yml?branch=main&style=flat-square)](https://github.com/your-org/camb-ai-python-sdk/actions)
21
+ [![PyPI version](https://img.shields.io/pypi/v/camb-sdk.svg?style=flat-square)](https://pypi.org/project/camb-sdk/)
22
+ [![License](https://img.shields.io/pypi/l/camb-sdk.svg?style=flat-square)](https://github.com/Camb-ai/cambai-python-sdk/blob/master/LICENSE)
23
+ [![Build status](https://github.com/Camb-ai/cambai-python-sdk/actions/workflows/python.yml/badge.svg)](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 = clinet.get_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.0.dist-info/licenses/LICENSE,sha256=wVE3pAs9Te7Joa1AmJJ0JVd8CNgNmslblQaNgbozkiU,1063
2
- cambai/__init__.py,sha256=IWEE0yN9dLLq-E1BCVkcOCypzw2XNXX5Ybvk6GAbqnE,7245
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=WV0HAyfcUE_nt4tXAaxiMiRvfOGoBePo3HLycrwCO_M,413969
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=GsdbPmtg_NZ4YJEboQbQ6t_IMHc3Nf0x9aUw_eMh68s,3423
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.0.dist-info/METADATA,sha256=-J82ImgPYUj70Gk1BDYVvBQlHGg5M9RFlUGFZD7-UBY,7776
62
- camb_sdk-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
63
- camb_sdk-1.0.0.dist-info/top_level.txt,sha256=iqT9vxFBtFsESik9PDn3hFfTRpAl_ULmIbRDX90XaY0,7
64
- camb_sdk-1.0.0.dist-info/RECORD,,
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
- if api_key:
70
- configuration.api_key['APIKeyHeader'] = api_key
71
- else:
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
- self,
3705
- create_tts_stream_request_payload: CreateTTSStreamRequestPayload,
3706
- _request_timeout: Union[
3707
- None,
3708
- Annotated[StrictFloat, Field(gt=0)],
3709
- Tuple[
3710
- Annotated[StrictFloat, Field(gt=0)],
3711
- Annotated[StrictFloat, Field(gt=0)]
3712
- ]
3713
- ] = None,
3714
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3715
- _content_type: Optional[StrictStr] = None,
3716
- _headers: Optional[Dict[StrictStr, Any]] = None,
3717
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3718
- ) -> bytearray:
3719
- """Create TTS Stream
3720
-
3721
- Stream text-to-speech audio in real-time
3722
-
3723
- :param create_tts_stream_request_payload: (required)
3724
- :type create_tts_stream_request_payload: CreateTTSStreamRequestPayload
3725
- :param _request_timeout: timeout setting for this request. If one
3726
- number provided, it will be total request
3727
- timeout. It can also be a pair (tuple) of
3728
- (connection, read) timeouts.
3729
- :type _request_timeout: int, tuple(int, int), optional
3730
- :param _request_auth: set to override the auth_settings for an a single
3731
- request; this effectively ignores the
3732
- authentication in the spec for a single request.
3733
- :type _request_auth: dict, optional
3734
- :param _content_type: force content-type for the request.
3735
- :type _content_type: str, Optional
3736
- :param _headers: set to override the headers for a single
3737
- request; this effectively ignores the headers
3738
- in the spec for a single request.
3739
- :type _headers: dict, optional
3740
- :param _host_index: set to override the host_index for a single
3741
- request; this effectively ignores the host_index
3742
- in the spec for a single request.
3743
- :type _host_index: int, optional
3744
- :return: Returns the result object.
3745
- """ # noqa: E501
3746
-
3747
- _param = self._create_tts_stream_serialize(
3748
- create_tts_stream_request_payload=create_tts_stream_request_payload,
3749
- _request_auth=_request_auth,
3750
- _content_type=_content_type,
3751
- _headers=_headers,
3752
- _host_index=_host_index
3753
- )
3754
-
3755
- _response_types_map: Dict[str, Optional[str]] = {
3756
- '200': "bytearray",
3757
- '422': "HTTPValidationError",
3758
- }
3759
- response_data = self.api_client.call_api(
3760
- *_param,
3761
- _request_timeout=_request_timeout
3762
- )
3763
- response_data.read()
3764
- return self.api_client.response_deserialize(
3765
- response_data=response_data,
3766
- response_types_map=_response_types_map,
3767
- ).data
3768
-
3769
-
3770
- @validate_call
3771
- def create_tts_stream_with_http_info(
3772
- self,
3773
- create_tts_stream_request_payload: CreateTTSStreamRequestPayload,
3774
- _request_timeout: Union[
3775
- None,
3776
- Annotated[StrictFloat, Field(gt=0)],
3777
- Tuple[
3778
- Annotated[StrictFloat, Field(gt=0)],
3779
- Annotated[StrictFloat, Field(gt=0)]
3780
- ]
3781
- ] = None,
3782
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3783
- _content_type: Optional[StrictStr] = None,
3784
- _headers: Optional[Dict[StrictStr, Any]] = None,
3785
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3786
- ) -> ApiResponse[bytearray]:
3787
- """Create TTS Stream
3788
-
3789
- Stream text-to-speech audio in real-time
3790
-
3791
- :param create_tts_stream_request_payload: (required)
3792
- :type create_tts_stream_request_payload: CreateTTSStreamRequestPayload
3793
- :param _request_timeout: timeout setting for this request. If one
3794
- number provided, it will be total request
3795
- timeout. It can also be a pair (tuple) of
3796
- (connection, read) timeouts.
3797
- :type _request_timeout: int, tuple(int, int), optional
3798
- :param _request_auth: set to override the auth_settings for an a single
3799
- request; this effectively ignores the
3800
- authentication in the spec for a single request.
3801
- :type _request_auth: dict, optional
3802
- :param _content_type: force content-type for the request.
3803
- :type _content_type: str, Optional
3804
- :param _headers: set to override the headers for a single
3805
- request; this effectively ignores the headers
3806
- in the spec for a single request.
3807
- :type _headers: dict, optional
3808
- :param _host_index: set to override the host_index for a single
3809
- request; this effectively ignores the host_index
3810
- in the spec for a single request.
3811
- :type _host_index: int, optional
3812
- :return: Returns the result object.
3813
- """ # noqa: E501
3814
-
3815
- _param = self._create_tts_stream_serialize(
3816
- create_tts_stream_request_payload=create_tts_stream_request_payload,
3817
- _request_auth=_request_auth,
3818
- _content_type=_content_type,
3819
- _headers=_headers,
3820
- _host_index=_host_index
3821
- )
3822
-
3823
- _response_types_map: Dict[str, Optional[str]] = {
3824
- '200': "bytearray",
3825
- '422': "HTTPValidationError",
3826
- }
3827
- response_data = self.api_client.call_api(
3828
- *_param,
3829
- _request_timeout=_request_timeout
3830
- )
3831
- response_data.read()
3832
- return self.api_client.response_deserialize(
3833
- response_data=response_data,
3834
- response_types_map=_response_types_map,
3835
- )
3836
-
3837
-
3838
- @validate_call
3839
- def create_tts_stream_without_preload_content(
3840
- self,
3841
- create_tts_stream_request_payload: CreateTTSStreamRequestPayload,
3842
- _request_timeout: Union[
3843
- None,
3844
- Annotated[StrictFloat, Field(gt=0)],
3845
- Tuple[
3846
- Annotated[StrictFloat, Field(gt=0)],
3847
- Annotated[StrictFloat, Field(gt=0)]
3848
- ]
3849
- ] = None,
3850
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3851
- _content_type: Optional[StrictStr] = None,
3852
- _headers: Optional[Dict[StrictStr, Any]] = None,
3853
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3854
- ) -> RESTResponseType:
3855
- """Create TTS Stream
3856
-
3857
- Stream text-to-speech audio in real-time
3858
-
3859
- :param create_tts_stream_request_payload: (required)
3860
- :type create_tts_stream_request_payload: CreateTTSStreamRequestPayload
3861
- :param _request_timeout: timeout setting for this request. If one
3862
- number provided, it will be total request
3863
- timeout. It can also be a pair (tuple) of
3864
- (connection, read) timeouts.
3865
- :type _request_timeout: int, tuple(int, int), optional
3866
- :param _request_auth: set to override the auth_settings for an a single
3867
- request; this effectively ignores the
3868
- authentication in the spec for a single request.
3869
- :type _request_auth: dict, optional
3870
- :param _content_type: force content-type for the request.
3871
- :type _content_type: str, Optional
3872
- :param _headers: set to override the headers for a single
3873
- request; this effectively ignores the headers
3874
- in the spec for a single request.
3875
- :type _headers: dict, optional
3876
- :param _host_index: set to override the host_index for a single
3877
- request; this effectively ignores the host_index
3878
- in the spec for a single request.
3879
- :type _host_index: int, optional
3880
- :return: Returns the result object.
3881
- """ # noqa: E501
3882
-
3883
- _param = self._create_tts_stream_serialize(
3884
- create_tts_stream_request_payload=create_tts_stream_request_payload,
3885
- _request_auth=_request_auth,
3886
- _content_type=_content_type,
3887
- _headers=_headers,
3888
- _host_index=_host_index
3889
- )
3890
-
3891
- _response_types_map: Dict[str, Optional[str]] = {
3892
- '200': "bytearray",
3893
- '422': "HTTPValidationError",
3894
- }
3895
- response_data = self.api_client.call_api(
3896
- *_param,
3897
- _request_timeout=_request_timeout
3898
- )
3899
- return response_data.response
3900
-
3901
-
3902
- def _create_tts_stream_serialize(
3903
- self,
3904
- create_tts_stream_request_payload,
3905
- _request_auth,
3906
- _content_type,
3907
- _headers,
3908
- _host_index,
3909
- ) -> RequestSerialized:
3910
-
3911
- _host = None
3912
-
3913
- _collection_formats: Dict[str, str] = {
3914
- }
3915
-
3916
- _path_params: Dict[str, str] = {}
3917
- _query_params: List[Tuple[str, str]] = []
3918
- _header_params: Dict[str, Optional[str]] = _headers or {}
3919
- _form_params: List[Tuple[str, str]] = []
3920
- _files: Dict[
3921
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3922
- ] = {}
3923
- _body_params: Optional[bytes] = None
3924
-
3925
- # process the path parameters
3926
- # process the query parameters
3927
- # process the header parameters
3928
- # process the form parameters
3929
- # process the body parameter
3930
- if create_tts_stream_request_payload is not None:
3931
- _body_params = create_tts_stream_request_payload
3932
-
3933
-
3934
- # set the HTTP header `Accept`
3935
- if 'Accept' not in _header_params:
3936
- _header_params['Accept'] = self.api_client.select_header_accept(
3937
- [
3938
- 'audio/flac',
3939
- 'audio/wav',
3940
- 'audio/aac',
3941
- 'audio/x-pcm',
3942
- 'application/json'
3943
- ]
3944
- )
3945
-
3946
- # set the HTTP header `Content-Type`
3947
- if _content_type:
3948
- _header_params['Content-Type'] = _content_type
3949
- else:
3950
- _default_content_type = (
3951
- self.api_client.select_header_content_type(
3952
- [
3953
- 'application/json'
3954
- ]
3955
- )
3956
- )
3957
- if _default_content_type is not None:
3958
- _header_params['Content-Type'] = _default_content_type
3959
-
3960
- # authentication setting
3961
- _auth_settings: List[str] = [
3962
- 'APIKeyHeader'
3963
- ]
3964
-
3965
- return self.api_client.param_serialize(
3966
- method='POST',
3967
- resource_path='/tts-stream',
3968
- path_params=_path_params,
3969
- query_params=_query_params,
3970
- header_params=_header_params,
3971
- body=_body_params,
3972
- post_params=_form_params,
3973
- files=_files,
3974
- auth_settings=_auth_settings,
3975
- collection_formats=_collection_formats,
3976
- _host=_host,
3977
- _request_auth=_request_auth
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
- return self.api_client.response_deserialize(
5091
- response_data=response_data,
5092
- response_types_map=_response_types_map,
5093
- ).data
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