livekit-plugins-aws 1.2.5__py3-none-any.whl → 1.2.6__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 livekit-plugins-aws might be problematic. Click here for more details.
- livekit/plugins/aws/models.py +1 -0
- livekit/plugins/aws/stt.py +14 -12
- livekit/plugins/aws/tts.py +6 -2
- livekit/plugins/aws/version.py +1 -1
- {livekit_plugins_aws-1.2.5.dist-info → livekit_plugins_aws-1.2.6.dist-info}/METADATA +3 -3
- {livekit_plugins_aws-1.2.5.dist-info → livekit_plugins_aws-1.2.6.dist-info}/RECORD +7 -7
- {livekit_plugins_aws-1.2.5.dist-info → livekit_plugins_aws-1.2.6.dist-info}/WHEEL +0 -0
livekit/plugins/aws/models.py
CHANGED
livekit/plugins/aws/stt.py
CHANGED
|
@@ -192,7 +192,7 @@ class SpeechStream(stt.SpeechStream):
|
|
|
192
192
|
self._event_ch.send_nowait(
|
|
193
193
|
stt.SpeechEvent(
|
|
194
194
|
type=stt.SpeechEventType.INTERIM_TRANSCRIPT,
|
|
195
|
-
alternatives=[_streaming_recognize_response_to_speech_data(resp)],
|
|
195
|
+
alternatives=[self._streaming_recognize_response_to_speech_data(resp)],
|
|
196
196
|
)
|
|
197
197
|
)
|
|
198
198
|
|
|
@@ -200,20 +200,22 @@ class SpeechStream(stt.SpeechStream):
|
|
|
200
200
|
self._event_ch.send_nowait(
|
|
201
201
|
stt.SpeechEvent(
|
|
202
202
|
type=stt.SpeechEventType.FINAL_TRANSCRIPT,
|
|
203
|
-
alternatives=[_streaming_recognize_response_to_speech_data(resp)],
|
|
203
|
+
alternatives=[self._streaming_recognize_response_to_speech_data(resp)],
|
|
204
204
|
)
|
|
205
205
|
)
|
|
206
206
|
|
|
207
207
|
if not resp.is_partial:
|
|
208
208
|
self._event_ch.send_nowait(stt.SpeechEvent(type=stt.SpeechEventType.END_OF_SPEECH))
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
210
|
+
def _streaming_recognize_response_to_speech_data(self, resp: Result) -> stt.SpeechData:
|
|
211
|
+
confidence = 0.0
|
|
212
|
+
if resp.alternatives and (items := resp.alternatives[0].items):
|
|
213
|
+
confidence = items[0].confidence or 0.0
|
|
214
|
+
|
|
215
|
+
return stt.SpeechData(
|
|
216
|
+
language=resp.language_code or self._opts.language,
|
|
217
|
+
start_time=resp.start_time if resp.start_time is not None else 0.0,
|
|
218
|
+
end_time=resp.end_time if resp.end_time is not None else 0.0,
|
|
219
|
+
text=resp.alternatives[0].transcript if resp.alternatives else "",
|
|
220
|
+
confidence=confidence,
|
|
221
|
+
)
|
livekit/plugins/aws/tts.py
CHANGED
|
@@ -32,11 +32,12 @@ from livekit.agents.types import (
|
|
|
32
32
|
)
|
|
33
33
|
from livekit.agents.utils import is_given
|
|
34
34
|
|
|
35
|
-
from .models import TTSLanguages, TTSSpeechEngine
|
|
35
|
+
from .models import TTSLanguages, TTSSpeechEngine, TTSTextType
|
|
36
36
|
from .utils import _strip_nones
|
|
37
37
|
|
|
38
38
|
DEFAULT_SPEECH_ENGINE: TTSSpeechEngine = "generative"
|
|
39
39
|
DEFAULT_VOICE = "Ruth"
|
|
40
|
+
DEFAULT_TEXT_TYPE: TTSTextType = "text"
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
@dataclass
|
|
@@ -47,6 +48,7 @@ class _TTSOptions:
|
|
|
47
48
|
region: str | None
|
|
48
49
|
sample_rate: int
|
|
49
50
|
language: TTSLanguages | str | None
|
|
51
|
+
text_type: TTSTextType
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
class TTS(tts.TTS):
|
|
@@ -56,6 +58,7 @@ class TTS(tts.TTS):
|
|
|
56
58
|
voice: str = "Ruth",
|
|
57
59
|
language: NotGivenOr[TTSLanguages | str] = NOT_GIVEN,
|
|
58
60
|
speech_engine: TTSSpeechEngine = "generative",
|
|
61
|
+
text_type: TTSTextType = "text",
|
|
59
62
|
sample_rate: int = 16000,
|
|
60
63
|
region: str | None = None,
|
|
61
64
|
api_key: str | None = None,
|
|
@@ -96,6 +99,7 @@ class TTS(tts.TTS):
|
|
|
96
99
|
self._opts = _TTSOptions(
|
|
97
100
|
voice=voice,
|
|
98
101
|
speech_engine=speech_engine,
|
|
102
|
+
text_type=text_type,
|
|
99
103
|
region=region or None,
|
|
100
104
|
language=language or None,
|
|
101
105
|
sample_rate=sample_rate,
|
|
@@ -130,7 +134,7 @@ class ChunkedStream(tts.ChunkedStream):
|
|
|
130
134
|
"OutputFormat": "mp3",
|
|
131
135
|
"Engine": self._opts.speech_engine,
|
|
132
136
|
"VoiceId": self._opts.voice,
|
|
133
|
-
"TextType":
|
|
137
|
+
"TextType": self._opts.text_type,
|
|
134
138
|
"SampleRate": str(self._opts.sample_rate),
|
|
135
139
|
"LanguageCode": self._opts.language,
|
|
136
140
|
}
|
livekit/plugins/aws/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: livekit-plugins-aws
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.6
|
|
4
4
|
Summary: LiveKit Agents Plugin for services from AWS
|
|
5
5
|
Project-URL: Documentation, https://docs.livekit.io
|
|
6
6
|
Project-URL: Website, https://livekit.io/
|
|
@@ -19,8 +19,8 @@ Classifier: Topic :: Multimedia :: Video
|
|
|
19
19
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
20
|
Requires-Python: >=3.9.0
|
|
21
21
|
Requires-Dist: aioboto3>=14.1.0
|
|
22
|
-
Requires-Dist: amazon-transcribe>=0.6.
|
|
23
|
-
Requires-Dist: livekit-agents>=1.2.
|
|
22
|
+
Requires-Dist: amazon-transcribe>=0.6.4
|
|
23
|
+
Requires-Dist: livekit-agents>=1.2.6
|
|
24
24
|
Provides-Extra: realtime
|
|
25
25
|
Requires-Dist: aws-sdk-bedrock-runtime==0.0.2; (python_version >= '3.12') and extra == 'realtime'
|
|
26
26
|
Requires-Dist: boto3>1.35.10; extra == 'realtime'
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
livekit/plugins/aws/__init__.py,sha256=dCZISj1yZG0WZTojk3sU-Ub4PK1ThCVhamrl9k_NbBw,2047
|
|
2
2
|
livekit/plugins/aws/llm.py,sha256=SUPWhJTbQ6HZJEK7WYUADDo2BJZJl2EaRvfG05IobzU,12150
|
|
3
3
|
livekit/plugins/aws/log.py,sha256=S5ICcsnwshZhMG0HPmc_lI3mtHmcY4oQMJBsnnho-bM,289
|
|
4
|
-
livekit/plugins/aws/models.py,sha256=
|
|
4
|
+
livekit/plugins/aws/models.py,sha256=J4yzik9sR68RPZpR1ubRQ9hdn14D9IwA3KaRvAf5tAE,734
|
|
5
5
|
livekit/plugins/aws/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
livekit/plugins/aws/stt.py,sha256=
|
|
7
|
-
livekit/plugins/aws/tts.py,sha256=
|
|
6
|
+
livekit/plugins/aws/stt.py,sha256=sNy7zcAatd7OqhnjfA0C6A3oK1CTaDeuBvEMashjySU,9157
|
|
7
|
+
livekit/plugins/aws/tts.py,sha256=kPWRwqsfwXSMVuFmHc8U4ibJ6mHkQZKLh_S5dhQVFTE,6251
|
|
8
8
|
livekit/plugins/aws/utils.py,sha256=nA5Ua1f4T-25Loar6EvlrKTXI9N-zpTIH7cdQkwGyGI,1518
|
|
9
|
-
livekit/plugins/aws/version.py,sha256=
|
|
9
|
+
livekit/plugins/aws/version.py,sha256=OCvv6KMSdgnrGPol-1roA6aGLQW4B_dSwFfBeuUbZTs,600
|
|
10
10
|
livekit/plugins/aws/experimental/realtime/__init__.py,sha256=mm_TGZc9QAWSO-VOO3PdE8Y5R6xlWckXRZuiFUIHa-Q,287
|
|
11
11
|
livekit/plugins/aws/experimental/realtime/events.py,sha256=ltdGEipE3ZOkjn7K6rKN6WSCUPJkVg-S88mUmQ_V00s,15981
|
|
12
12
|
livekit/plugins/aws/experimental/realtime/pretty_printer.py,sha256=KN7KPrfQu8cU7ff34vFAtfrd1umUSTVNKXQU7D8AMiM,1442
|
|
13
13
|
livekit/plugins/aws/experimental/realtime/realtime_model.py,sha256=JkFv4LnlME17v-yXVvZiFdFyKHZBkKlOffmbUAd7qYw,60403
|
|
14
14
|
livekit/plugins/aws/experimental/realtime/turn_tracker.py,sha256=bcufaap-coeIYuK3ct1Is9W_UoefGYRmnJu7Mn5DCYU,6002
|
|
15
|
-
livekit_plugins_aws-1.2.
|
|
16
|
-
livekit_plugins_aws-1.2.
|
|
17
|
-
livekit_plugins_aws-1.2.
|
|
15
|
+
livekit_plugins_aws-1.2.6.dist-info/METADATA,sha256=Ev-SpTLbzBP1wuJLm0q-5MOljF2HfmF_S0Ygx5GiquQ,1989
|
|
16
|
+
livekit_plugins_aws-1.2.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
17
|
+
livekit_plugins_aws-1.2.6.dist-info/RECORD,,
|
|
File without changes
|