livekit-plugins-elevenlabs 0.7.2__py3-none-any.whl → 0.7.3__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.
@@ -168,7 +168,7 @@ class ChunkedStream(tts.ChunkedStream):
168
168
  segment_id = utils.shortuuid()
169
169
 
170
170
  voice_settings = (
171
- dataclasses.asdict(self._opts.voice.settings)
171
+ _strip_nones(dataclasses.asdict(self._opts.voice.settings))
172
172
  if self._opts.voice.settings
173
173
  else None
174
174
  )
@@ -300,7 +300,7 @@ class SynthesizeStream(tts.SynthesizeStream):
300
300
  init_pkt = dict(
301
301
  text=" ",
302
302
  try_trigger_generation=True,
303
- voice_settings=dataclasses.asdict(self._opts.voice.settings)
303
+ voice_settings=_strip_nones(dataclasses.asdict(self._opts.voice.settings))
304
304
  if self._opts.voice.settings
305
305
  else None,
306
306
  generation_config=dict(
@@ -353,7 +353,15 @@ class SynthesizeStream(tts.SynthesizeStream):
353
353
  segment_id=segment_id,
354
354
  )
355
355
 
356
- await asyncio.gather(send_task(), recv_task())
356
+ tasks = [
357
+ asyncio.create_task(send_task()),
358
+ asyncio.create_task(recv_task()),
359
+ ]
360
+
361
+ try:
362
+ await asyncio.gather(*tasks)
363
+ finally:
364
+ await utils.aio.gracefully_cancel(*tasks)
357
365
 
358
366
  def _process_stream_event(
359
367
  self, *, data: dict, request_id: str, segment_id: str
@@ -404,6 +412,10 @@ def _dict_to_voices_list(data: dict[str, Any]):
404
412
  return voices
405
413
 
406
414
 
415
+ def _strip_nones(data: dict[str, Any]):
416
+ return {k: v for k, v in data.items() if v is not None}
417
+
418
+
407
419
  def _synthesize_url(opts: _TTSOptions) -> str:
408
420
  base_url = opts.base_url
409
421
  voice_id = opts.voice.id
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "0.7.2"
15
+ __version__ = "0.7.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-plugins-elevenlabs
3
- Version: 0.7.2
3
+ Version: 0.7.3
4
4
  Summary: Agent Framework plugin for voice synthesis with ElevenLabs' API.
5
5
  Home-page: https://github.com/livekit/agents
6
6
  License: Apache-2.0
@@ -0,0 +1,10 @@
1
+ livekit/plugins/elevenlabs/__init__.py,sha256=cYRVIPXkRvB3-jK9bKZ9rYiMBACytWlCSq6yoZXaSgA,1080
2
+ livekit/plugins/elevenlabs/log.py,sha256=hIuXqDsEB5GBa7rQY3z4Uqi1oCqc_lRmCHZEmXz0LHw,73
3
+ livekit/plugins/elevenlabs/models.py,sha256=ddBUlDT4707f64WDJASR0B60X0yQ-LRHK1ZpTuBJXK8,387
4
+ livekit/plugins/elevenlabs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ livekit/plugins/elevenlabs/tts.py,sha256=ZSR6WxSBhntZmdK4i9U8SKcxHwNk3_4qiZNRZc5jP28,14641
6
+ livekit/plugins/elevenlabs/version.py,sha256=yJeG0VwiekDJAk7GHcIAe43ebagJgloe-ZsqEGZnqzE,600
7
+ livekit_plugins_elevenlabs-0.7.3.dist-info/METADATA,sha256=hdSuPch445_jz_Z-Uzt6CgU0Eb1H0ZVZ9ZA50hHYsBM,1311
8
+ livekit_plugins_elevenlabs-0.7.3.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
9
+ livekit_plugins_elevenlabs-0.7.3.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
10
+ livekit_plugins_elevenlabs-0.7.3.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- livekit/plugins/elevenlabs/__init__.py,sha256=cYRVIPXkRvB3-jK9bKZ9rYiMBACytWlCSq6yoZXaSgA,1080
2
- livekit/plugins/elevenlabs/log.py,sha256=hIuXqDsEB5GBa7rQY3z4Uqi1oCqc_lRmCHZEmXz0LHw,73
3
- livekit/plugins/elevenlabs/models.py,sha256=ddBUlDT4707f64WDJASR0B60X0yQ-LRHK1ZpTuBJXK8,387
4
- livekit/plugins/elevenlabs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- livekit/plugins/elevenlabs/tts.py,sha256=g5w__bq5OdtZDjjclw3zYq4mAPMpkVgWPqlhkb_qpBg,14320
6
- livekit/plugins/elevenlabs/version.py,sha256=wNTnO8L3jrMdUjS-xAEFoMTKPaPYiFY9Kxnvzm4hTBc,600
7
- livekit_plugins_elevenlabs-0.7.2.dist-info/METADATA,sha256=WdOaTQBGsLgrjKQIM2_pgXLyPUqzBfTml14OFRv2qLQ,1311
8
- livekit_plugins_elevenlabs-0.7.2.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
9
- livekit_plugins_elevenlabs-0.7.2.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
10
- livekit_plugins_elevenlabs-0.7.2.dist-info/RECORD,,