livekit-plugins-elevenlabs 0.7.7__py3-none-any.whl → 0.7.9__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.
@@ -25,7 +25,9 @@ from typing import Any, List, Literal
25
25
  import aiohttp
26
26
  from livekit import rtc
27
27
  from livekit.agents import (
28
+ DEFAULT_API_CONNECT_OPTIONS,
28
29
  APIConnectionError,
30
+ APIConnectOptions,
29
31
  APIStatusError,
30
32
  APITimeoutError,
31
33
  tokenize,
@@ -196,25 +198,49 @@ class TTS(tts.TTS):
196
198
  self._opts.model = model or self._opts.model
197
199
  self._opts.voice = voice or self._opts.voice
198
200
 
199
- def synthesize(self, text: str) -> "ChunkedStream":
200
- return ChunkedStream(self, text, self._opts, self._ensure_session())
201
+ def synthesize(
202
+ self,
203
+ text: str,
204
+ *,
205
+ conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
206
+ ) -> "ChunkedStream":
207
+ return ChunkedStream(
208
+ tts=self,
209
+ input_text=text,
210
+ conn_options=conn_options,
211
+ opts=self._opts,
212
+ session=self._ensure_session(),
213
+ )
201
214
 
202
- def stream(self) -> "SynthesizeStream":
203
- return SynthesizeStream(self, self._ensure_session(), self._opts)
215
+ def stream(
216
+ self, *, conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS
217
+ ) -> "SynthesizeStream":
218
+ return SynthesizeStream(
219
+ tts=self,
220
+ conn_options=conn_options,
221
+ opts=self._opts,
222
+ session=self._ensure_session(),
223
+ )
204
224
 
205
225
 
206
226
  class ChunkedStream(tts.ChunkedStream):
207
227
  """Synthesize using the chunked api endpoint"""
208
228
 
209
229
  def __init__(
210
- self, tts: TTS, text: str, opts: _TTSOptions, session: aiohttp.ClientSession
230
+ self,
231
+ *,
232
+ tts: TTS,
233
+ input_text: str,
234
+ opts: _TTSOptions,
235
+ conn_options: APIConnectOptions,
236
+ session: aiohttp.ClientSession,
211
237
  ) -> None:
212
- super().__init__(tts, text)
238
+ super().__init__(tts=tts, input_text=input_text, conn_options=conn_options)
213
239
  self._opts, self._session = opts, session
214
240
  if _encoding_from_format(self._opts.encoding) == "mp3":
215
241
  self._mp3_decoder = utils.codecs.Mp3StreamDecoder()
216
242
 
217
- async def _main_task(self) -> None:
243
+ async def _run(self) -> None:
218
244
  request_id = utils.shortuuid()
219
245
  bstream = utils.audio.AudioByteStream(
220
246
  sample_rate=self._opts.sample_rate, num_channels=1
@@ -286,16 +312,17 @@ class SynthesizeStream(tts.SynthesizeStream):
286
312
 
287
313
  def __init__(
288
314
  self,
315
+ *,
289
316
  tts: TTS,
290
317
  session: aiohttp.ClientSession,
318
+ conn_options: APIConnectOptions,
291
319
  opts: _TTSOptions,
292
320
  ):
293
- super().__init__(tts)
321
+ super().__init__(tts=tts, conn_options=conn_options)
294
322
  self._opts, self._session = opts, session
295
323
  self._mp3_decoder = utils.codecs.Mp3StreamDecoder()
296
324
 
297
- @utils.log_exceptions(logger=logger)
298
- async def _main_task(self) -> None:
325
+ async def _run(self) -> None:
299
326
  self._segments_ch = utils.aio.Chan[tokenize.WordStream]()
300
327
 
301
328
  @utils.log_exceptions(logger=logger)
@@ -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.7"
15
+ __version__ = "0.7.9"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-plugins-elevenlabs
3
- Version: 0.7.7
3
+ Version: 0.7.9
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
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3 :: Only
20
20
  Requires-Python: >=3.9.0
21
21
  Description-Content-Type: text/markdown
22
- Requires-Dist: livekit-agents[codecs] >=0.11
22
+ Requires-Dist: livekit-agents[codecs]>=0.11
23
23
 
24
24
  # LiveKit Plugins Elevenlabs
25
25
 
@@ -0,0 +1,10 @@
1
+ livekit/plugins/elevenlabs/__init__.py,sha256=YZVadomFq3JWiZN6GWXJbuE4vaNNWq1CmdH25du8qwg,1249
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=ZiBgBjHpTXQmvZ2QWV-P2lqfG8kqRzaTZI7DHqrx-sk,19399
6
+ livekit/plugins/elevenlabs/version.py,sha256=Y-buDizIIkRMlhoxXYRvGcLWsb-FeH9R4TA8h7gN-vQ,600
7
+ livekit_plugins_elevenlabs-0.7.9.dist-info/METADATA,sha256=YnE6bivP8gz9ONqCzmD64hprpV26iuLJRBNVG005lB8,1304
8
+ livekit_plugins_elevenlabs-0.7.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
9
+ livekit_plugins_elevenlabs-0.7.9.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
10
+ livekit_plugins_elevenlabs-0.7.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,10 +0,0 @@
1
- livekit/plugins/elevenlabs/__init__.py,sha256=YZVadomFq3JWiZN6GWXJbuE4vaNNWq1CmdH25du8qwg,1249
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=GgpXXBumLW2r1vKGZ_k-k8rYCQJVahioPMr2aJeSWwk,18760
6
- livekit/plugins/elevenlabs/version.py,sha256=78n--2R9Gwuh35Oy92hkYHXCMK_Er2s6VCfDuPQa2Ic,600
7
- livekit_plugins_elevenlabs-0.7.7.dist-info/METADATA,sha256=nTXxc7ODYH7VljmXYPAeNUjMRTE20XB7fBl0micpQQ4,1305
8
- livekit_plugins_elevenlabs-0.7.7.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
9
- livekit_plugins_elevenlabs-0.7.7.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
10
- livekit_plugins_elevenlabs-0.7.7.dist-info/RECORD,,