cartesia 1.0.9__tar.gz → 1.0.10__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cartesia
3
- Version: 1.0.9
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.
@@ -1,4 +1,4 @@
1
- from typing import List, TypedDict
1
+ from typing import List, TypedDict, Union
2
2
 
3
3
  from cartesia.utils.deprecated import deprecated
4
4
 
@@ -86,7 +86,7 @@ class VoiceControls(TypedDict):
86
86
  This is an experimental class and is subject to rapid change in future versions.
87
87
  """
88
88
 
89
- speed: str = ""
89
+ speed: Union[str, float] = ""
90
90
  emotion: List[str] = []
91
91
 
92
92
 
@@ -31,6 +31,9 @@ try:
31
31
  except ImportError:
32
32
  IS_WEBSOCKET_SYNC_AVAILABLE = False
33
33
 
34
+ from iterators import TimeoutIterator
35
+ from websockets.sync.client import connect
36
+
34
37
  from cartesia._types import (
35
38
  DeprecatedOutputFormatMapping,
36
39
  EventType,
@@ -40,8 +43,6 @@ from cartesia._types import (
40
43
  VoiceMetadata,
41
44
  )
42
45
  from cartesia.utils.retry import retry_on_connection_error, retry_on_connection_error_async
43
- from iterators import TimeoutIterator
44
- from websockets.sync.client import connect
45
46
 
46
47
  DEFAULT_MODEL_ID = "sonic-english" # latest default model
47
48
  MULTILINGUAL_MODEL_ID = "sonic-multilingual" # latest multilingual model
@@ -0,0 +1 @@
1
+ __version__ = "1.0.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cartesia
3
- Version: 1.0.9
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.
@@ -1,7 +1,7 @@
1
- import cartesia as Cartesia
1
+ from packaging.version import Version
2
+
2
3
  import cartesia.version as version
3
4
  from cartesia.utils.deprecated import _DEPRECATED_FUNCTION_STATS
4
- from packaging.version import Version
5
5
 
6
6
 
7
7
  def test_deprecated_to_remove_by_version():
@@ -14,6 +14,7 @@ from typing import AsyncGenerator, Generator, List
14
14
 
15
15
  import numpy as np
16
16
  import pytest
17
+
17
18
  from cartesia import AsyncCartesia, Cartesia
18
19
  from cartesia._types import VoiceControls, VoiceMetadata
19
20
  from cartesia.client import DEFAULT_MODEL_ID, MULTILINGUAL_MODEL_ID
@@ -25,6 +26,7 @@ RESOURCES_DIR = os.path.join(THISDIR, "resources")
25
26
  SAMPLE_VOICE = "Newsman"
26
27
  SAMPLE_VOICE_ID = "d46abd1d-2d02-43e8-819f-51fb652c1c61"
27
28
  EXPERIMENTAL_VOICE_CONTROLS = {"emotion": ["anger:high", "positivity:low"], "speed": "fastest"}
29
+ EXPERIMENTAL_VOICE_CONTROLS_2 = {"speed": 0.4}
28
30
 
29
31
  logger = logging.getLogger(__name__)
30
32
 
@@ -102,7 +104,7 @@ def test_create_voice(client: Cartesia):
102
104
  assert voice in voices
103
105
 
104
106
  @pytest.mark.parametrize("stream", [True, False])
105
- @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS])
107
+ @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS, EXPERIMENTAL_VOICE_CONTROLS_2])
106
108
  def test_sse_send(resources: _Resources, stream: bool, _experimental_voice_controls: VoiceControls):
107
109
  logger.info("Testing SSE send")
108
110
  client = resources.client
@@ -139,7 +141,7 @@ def test_sse_send_with_model_id(resources: _Resources, stream: bool):
139
141
  assert isinstance(out["audio"], bytes)
140
142
 
141
143
  @pytest.mark.parametrize("stream", [True, False])
142
- @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS])
144
+ @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS, EXPERIMENTAL_VOICE_CONTROLS_2])
143
145
  def test_websocket_send(resources: _Resources, stream: bool, _experimental_voice_controls: VoiceControls):
144
146
  logger.info("Testing WebSocket send")
145
147
  client = resources.client
@@ -189,7 +191,7 @@ def test_websocket_send_timestamps(resources: _Resources, stream: bool):
189
191
  ws.close()
190
192
 
191
193
 
192
- @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS])
194
+ @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS, EXPERIMENTAL_VOICE_CONTROLS_2])
193
195
  def test_sse_send_context_manager(resources: _Resources, _experimental_voice_controls: VoiceControls):
194
196
  logger.info("Testing SSE send context manager")
195
197
  transcript = "Hello, world! I'\''m generating audio on Cartesia."
@@ -255,7 +257,7 @@ def test_websocket_send_context_manage_err(resources: _Resources):
255
257
  pass
256
258
 
257
259
  @pytest.mark.asyncio
258
- @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS])
260
+ @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS, EXPERIMENTAL_VOICE_CONTROLS_2])
259
261
  async def test_async_sse_send( resources: _Resources, _experimental_voice_controls: VoiceControls):
260
262
  logger.info("Testing async SSE send")
261
263
  transcript = "Hello, world! I'\''m generating audio on Cartesia."
@@ -276,7 +278,7 @@ async def test_async_sse_send( resources: _Resources, _experimental_voice_contro
276
278
  await async_client.close()
277
279
 
278
280
  @pytest.mark.asyncio
279
- @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS])
281
+ @pytest.mark.parametrize("_experimental_voice_controls", [None, EXPERIMENTAL_VOICE_CONTROLS, EXPERIMENTAL_VOICE_CONTROLS_2])
280
282
  async def test_async_websocket_send(resources: _Resources, _experimental_voice_controls: VoiceControls):
281
283
  logger.info("Testing async WebSocket send")
282
284
  transcript = "Hello, world! I'\''m generating audio on Cartesia."
@@ -1 +0,0 @@
1
- __version__ = "1.0.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes