cartesia 1.0.8__py2.py3-none-any.whl → 1.0.10__py2.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.
- cartesia/__init__.py +1 -1
- cartesia/_types.py +3 -2
- cartesia/client.py +13 -10
- cartesia/utils/retry.py +3 -3
- cartesia/version.py +1 -1
- {cartesia-1.0.8.dist-info → cartesia-1.0.10.dist-info}/METADATA +13 -13
- cartesia-1.0.10.dist-info/RECORD +12 -0
- {cartesia-1.0.8.dist-info → cartesia-1.0.10.dist-info}/WHEEL +1 -1
- cartesia-1.0.8.dist-info/RECORD +0 -12
- {cartesia-1.0.8.dist-info → cartesia-1.0.10.dist-info}/LICENSE.md +0 -0
- {cartesia-1.0.8.dist-info → cartesia-1.0.10.dist-info}/top_level.txt +0 -0
cartesia/__init__.py
CHANGED
cartesia/_types.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
from typing import List, TypedDict
|
1
|
+
from typing import List, TypedDict, Union
|
2
|
+
|
2
3
|
from cartesia.utils.deprecated import deprecated
|
3
4
|
|
4
5
|
|
@@ -85,7 +86,7 @@ class VoiceControls(TypedDict):
|
|
85
86
|
This is an experimental class and is subject to rapid change in future versions.
|
86
87
|
"""
|
87
88
|
|
88
|
-
speed: str = ""
|
89
|
+
speed: Union[str, float] = ""
|
89
90
|
emotion: List[str] = []
|
90
91
|
|
91
92
|
|
cartesia/client.py
CHANGED
@@ -1,46 +1,48 @@
|
|
1
1
|
import asyncio
|
2
2
|
import base64
|
3
|
-
from collections import defaultdict
|
4
3
|
import json
|
4
|
+
import logging
|
5
5
|
import os
|
6
6
|
import uuid
|
7
|
+
from collections import defaultdict
|
7
8
|
from types import TracebackType
|
8
9
|
from typing import (
|
9
10
|
Any,
|
10
11
|
AsyncGenerator,
|
11
|
-
|
12
|
+
Callable,
|
12
13
|
Dict,
|
13
14
|
Generator,
|
15
|
+
Iterator,
|
14
16
|
List,
|
15
17
|
Optional,
|
18
|
+
Set,
|
16
19
|
Tuple,
|
17
20
|
Union,
|
18
|
-
Callable,
|
19
|
-
Set,
|
20
21
|
)
|
21
22
|
|
22
23
|
import aiohttp
|
23
24
|
import httpx
|
24
|
-
import logging
|
25
25
|
import requests
|
26
|
+
|
26
27
|
try:
|
27
28
|
from websockets.sync.client import connect
|
29
|
+
|
28
30
|
IS_WEBSOCKET_SYNC_AVAILABLE = True
|
29
31
|
except ImportError:
|
30
32
|
IS_WEBSOCKET_SYNC_AVAILABLE = False
|
31
33
|
|
32
34
|
from iterators import TimeoutIterator
|
35
|
+
from websockets.sync.client import connect
|
33
36
|
|
34
|
-
from cartesia.utils.retry import retry_on_connection_error, retry_on_connection_error_async
|
35
37
|
from cartesia._types import (
|
38
|
+
DeprecatedOutputFormatMapping,
|
36
39
|
EventType,
|
37
40
|
OutputFormat,
|
38
41
|
OutputFormatMapping,
|
39
|
-
DeprecatedOutputFormatMapping,
|
40
42
|
VoiceControls,
|
41
43
|
VoiceMetadata,
|
42
44
|
)
|
43
|
-
|
45
|
+
from cartesia.utils.retry import retry_on_connection_error, retry_on_connection_error_async
|
44
46
|
|
45
47
|
DEFAULT_MODEL_ID = "sonic-english" # latest default model
|
46
48
|
MULTILINGUAL_MODEL_ID = "sonic-multilingual" # latest multilingual model
|
@@ -212,21 +214,22 @@ class Voices(Resource):
|
|
212
214
|
|
213
215
|
return response.json()
|
214
216
|
|
215
|
-
def clone(self, filepath: Optional[str] = None,
|
217
|
+
def clone(self, filepath: Optional[str] = None, enhance: str = True) -> List[float]:
|
216
218
|
"""Clone a voice from a clip.
|
217
219
|
|
218
220
|
Args:
|
219
221
|
filepath: The path to the clip file.
|
222
|
+
enhance: Whether to enhance the clip before cloning the voice (highly recommended). Defaults to True.
|
220
223
|
|
221
224
|
Returns:
|
222
225
|
The embedding of the cloned voice as a list of floats.
|
223
226
|
"""
|
224
|
-
# TODO: Python has a bytes object, use that instead of a filepath
|
225
227
|
if not filepath:
|
226
228
|
raise ValueError("Filepath must be specified.")
|
227
229
|
url = f"{self._http_url()}/voices/clone/clip"
|
228
230
|
with open(filepath, "rb") as file:
|
229
231
|
files = {"clip": file}
|
232
|
+
files["enhance"] = str(enhance).lower()
|
230
233
|
headers = self.headers.copy()
|
231
234
|
headers.pop("Content-Type", None)
|
232
235
|
response = httpx.post(url, headers=headers, files=files, timeout=self.timeout)
|
cartesia/utils/retry.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import time
|
2
|
-
|
3
|
-
from aiohttp.client_exceptions import ServerDisconnectedError
|
4
1
|
import asyncio
|
2
|
+
import time
|
5
3
|
from functools import wraps
|
6
4
|
from http.client import RemoteDisconnected
|
5
|
+
|
6
|
+
from aiohttp.client_exceptions import ServerDisconnectedError
|
7
7
|
from httpx import TimeoutException
|
8
8
|
from requests.exceptions import ConnectionError
|
9
9
|
|
cartesia/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "1.0.
|
1
|
+
__version__ = "1.0.10"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: cartesia
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.10
|
4
4
|
Summary: The official Python library for the Cartesia API.
|
5
5
|
Home-page:
|
6
6
|
Author: Cartesia, Inc.
|
@@ -18,19 +18,19 @@ Requires-Dist: requests
|
|
18
18
|
Requires-Dist: websockets
|
19
19
|
Requires-Dist: iterators
|
20
20
|
Provides-Extra: all
|
21
|
-
Requires-Dist: pytest
|
22
|
-
Requires-Dist: pytest-cov
|
23
|
-
Requires-Dist: twine
|
24
|
-
Requires-Dist: setuptools
|
25
|
-
Requires-Dist: wheel
|
26
|
-
Requires-Dist: numpy
|
21
|
+
Requires-Dist: pytest>=8.0.2; extra == "all"
|
22
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "all"
|
23
|
+
Requires-Dist: twine; extra == "all"
|
24
|
+
Requires-Dist: setuptools; extra == "all"
|
25
|
+
Requires-Dist: wheel; extra == "all"
|
26
|
+
Requires-Dist: numpy; extra == "all"
|
27
27
|
Provides-Extra: dev
|
28
|
-
Requires-Dist: pytest
|
29
|
-
Requires-Dist: pytest-cov
|
30
|
-
Requires-Dist: twine
|
31
|
-
Requires-Dist: setuptools
|
32
|
-
Requires-Dist: wheel
|
33
|
-
Requires-Dist: numpy
|
28
|
+
Requires-Dist: pytest>=8.0.2; extra == "dev"
|
29
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
30
|
+
Requires-Dist: twine; extra == "dev"
|
31
|
+
Requires-Dist: setuptools; extra == "dev"
|
32
|
+
Requires-Dist: wheel; extra == "dev"
|
33
|
+
Requires-Dist: numpy; extra == "dev"
|
34
34
|
|
35
35
|
|
36
36
|
# Cartesia Python API Library
|
@@ -0,0 +1,12 @@
|
|
1
|
+
cartesia/__init__.py,sha256=E4w7psbAwx8X6Iri3W8jGeo11gIlhr3mSU33zChipmI,93
|
2
|
+
cartesia/_types.py,sha256=pkFJmsO-OWAJNtqxV80-YcR8KWWLhIwLFejzDjBewbw,4428
|
3
|
+
cartesia/client.py,sha256=AfSLYDJw_3eTCxiEyWhLdGVxOhPooW5omA99DeLTw5A,51614
|
4
|
+
cartesia/version.py,sha256=5vGk-8GWz6jojEu9w36UP5aNA0LuiwgbNSJ8Umn2rLA,23
|
5
|
+
cartesia/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
cartesia/utils/deprecated.py,sha256=2cXvGtrxhPeUZA5LWy2n_U5OFLDv7SHeFtzqhjSJGyk,1674
|
7
|
+
cartesia/utils/retry.py,sha256=O6fyVWpH9Su8c0Fwupl57xMt6JrwJ52txBwP3faUL7k,3339
|
8
|
+
cartesia-1.0.10.dist-info/LICENSE.md,sha256=PT2YG5wEtEX1TNDn5sXkUXqbn-neyr7cZenTxd40ql4,1074
|
9
|
+
cartesia-1.0.10.dist-info/METADATA,sha256=0eG3fbxXsqofNbwIdGvziDqTpFar2ZetcGLc7Bsut3s,21122
|
10
|
+
cartesia-1.0.10.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
|
11
|
+
cartesia-1.0.10.dist-info/top_level.txt,sha256=rTX4HnnCegMxl1FK9czpVC7GAvf3SwDzPG65qP-BS4w,9
|
12
|
+
cartesia-1.0.10.dist-info/RECORD,,
|
cartesia-1.0.8.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
cartesia/__init__.py,sha256=jMIf2O7dTGxvTA5AfXtmh1H_EGfMtQseR5wXrjNRbLs,93
|
2
|
-
cartesia/_types.py,sha256=Lcp4GOot5UfI0EveDi2QdNALMo1rK4PwUrtMvW5P6vY,4406
|
3
|
-
cartesia/client.py,sha256=gOH3ddVI-epHbPGijM3jExSmMOZm8TiyOfZlLKWt89w,51485
|
4
|
-
cartesia/version.py,sha256=NND_6JDYnYnGzN3-RTpS5F7wzv62vDf7hAxiyTSBJfE,22
|
5
|
-
cartesia/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
cartesia/utils/deprecated.py,sha256=2cXvGtrxhPeUZA5LWy2n_U5OFLDv7SHeFtzqhjSJGyk,1674
|
7
|
-
cartesia/utils/retry.py,sha256=nuwWRfu3MOVTxIQMLjYf6WLaxSlnu_GdE3QjTV0zisQ,3339
|
8
|
-
cartesia-1.0.8.dist-info/LICENSE.md,sha256=PT2YG5wEtEX1TNDn5sXkUXqbn-neyr7cZenTxd40ql4,1074
|
9
|
-
cartesia-1.0.8.dist-info/METADATA,sha256=83WFXYyycaZfvqX_bdyctzx270x1PMYlC-5lUUcMVDs,21137
|
10
|
-
cartesia-1.0.8.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
11
|
-
cartesia-1.0.8.dist-info/top_level.txt,sha256=rTX4HnnCegMxl1FK9czpVC7GAvf3SwDzPG65qP-BS4w,9
|
12
|
-
cartesia-1.0.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|