livekit-plugins-aws 1.2.2__tar.gz → 1.2.3__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.

Potentially problematic release.


This version of livekit-plugins-aws might be problematic. Click here for more details.

Files changed (18) hide show
  1. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/PKG-INFO +2 -2
  2. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/experimental/realtime/events.py +13 -1
  3. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/experimental/realtime/realtime_model.py +16 -1
  4. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/stt.py +9 -14
  5. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/version.py +1 -1
  6. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/pyproject.toml +1 -1
  7. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/.gitignore +0 -0
  8. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/README.md +0 -0
  9. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/__init__.py +0 -0
  10. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/experimental/realtime/__init__.py +0 -0
  11. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/experimental/realtime/pretty_printer.py +0 -0
  12. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/experimental/realtime/turn_tracker.py +0 -0
  13. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/llm.py +0 -0
  14. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/log.py +0 -0
  15. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/models.py +0 -0
  16. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/py.typed +0 -0
  17. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/tts.py +0 -0
  18. {livekit_plugins_aws-1.2.2 → livekit_plugins_aws-1.2.3}/livekit/plugins/aws/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-plugins-aws
3
- Version: 1.2.2
3
+ Version: 1.2.3
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/
@@ -20,7 +20,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
20
  Requires-Python: >=3.9.0
21
21
  Requires-Dist: aioboto3>=14.1.0
22
22
  Requires-Dist: amazon-transcribe>=0.6.2
23
- Requires-Dist: livekit-agents>=1.2.2
23
+ Requires-Dist: livekit-agents>=1.2.3
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'
@@ -10,7 +10,19 @@ from ...log import logger
10
10
 
11
11
  MEDIA_TYPE = Literal["text/plain", "audio/lpcm", "application/json"]
12
12
  TYPE = Literal["TEXT", "AUDIO", "TOOL"]
13
- VOICE_ID = Literal["matthew", "tiffany", "amy"]
13
+ VOICE_ID = Literal[
14
+ "matthew",
15
+ "tiffany",
16
+ "amy",
17
+ "ambre",
18
+ "florian",
19
+ "beatrice",
20
+ "lorenzo",
21
+ "greta",
22
+ "lennart",
23
+ "lupe",
24
+ "carlos",
25
+ ]
14
26
  ROLE = Literal["USER", "ASSISTANT", "TOOL", "SYSTEM"]
15
27
  GENERATION_STAGE = Literal["SPECULATIVE", "FINAL"]
16
28
  STOP_REASON = Literal["PARTIAL_TURN", "END_TURN", "INTERRUPTED"]
@@ -592,11 +592,16 @@ class RealtimeSession( # noqa: F811
592
592
  text_ch=utils.aio.Chan(),
593
593
  audio_ch=utils.aio.Chan(),
594
594
  )
595
+ msg_modalities = asyncio.Future[list[Literal["text", "audio"]]]()
596
+ msg_modalities.set_result(
597
+ ["audio", "text"] if self._realtime_model.capabilities.audio_output else ["text"]
598
+ )
595
599
  self._current_generation.message_ch.send_nowait(
596
600
  llm.MessageGeneration(
597
601
  message_id=msg_gen.message_id,
598
602
  text_stream=msg_gen.text_ch,
599
603
  audio_stream=msg_gen.audio_ch,
604
+ modalities=msg_modalities,
600
605
  )
601
606
  )
602
607
  self._current_generation.messages[self._current_generation.response_id] = msg_gen
@@ -761,11 +766,16 @@ class RealtimeSession( # noqa: F811
761
766
  audio_ch=utils.aio.Chan(),
762
767
  )
763
768
  self._current_generation.messages[self._current_generation.response_id] = msg_gen
769
+ msg_modalities = asyncio.Future[list[Literal["text", "audio"]]]()
770
+ msg_modalities.set_result(
771
+ ["audio", "text"] if self._realtime_model.capabilities.audio_output else ["text"]
772
+ )
764
773
  self._current_generation.message_ch.send_nowait(
765
774
  llm.MessageGeneration(
766
775
  message_id=msg_gen.message_id,
767
776
  text_stream=msg_gen.text_ch,
768
777
  audio_stream=msg_gen.audio_ch,
778
+ modalities=msg_modalities,
769
779
  )
770
780
  )
771
781
  self.emit_generation_event()
@@ -1235,7 +1245,12 @@ class RealtimeSession( # noqa: F811
1235
1245
  logger.warning("interrupt is not supported by Nova Sonic's Realtime API")
1236
1246
 
1237
1247
  def truncate(
1238
- self, *, message_id: str, audio_end_ms: int, audio_transcript: NotGivenOr[str] = NOT_GIVEN
1248
+ self,
1249
+ *,
1250
+ message_id: str,
1251
+ modalities: list[Literal["text", "audio"]],
1252
+ audio_end_ms: int,
1253
+ audio_transcript: NotGivenOr[str] = NOT_GIVEN,
1239
1254
  ) -> None:
1240
1255
  logger.warning("truncate is not supported by Nova Sonic's Realtime API")
1241
1256
 
@@ -50,6 +50,7 @@ class STTOptions:
50
50
  enable_partial_results_stabilization: NotGivenOr[bool]
51
51
  partial_results_stability: NotGivenOr[str]
52
52
  language_model_name: NotGivenOr[str]
53
+ region: str
53
54
 
54
55
 
55
56
  class STT(stt.STT):
@@ -75,11 +76,6 @@ class STT(stt.STT):
75
76
 
76
77
  if not is_given(region):
77
78
  region = os.getenv("AWS_REGION") or DEFAULT_REGION
78
- self._region = region
79
- self._client = TranscribeStreamingClient(
80
- region=self._region,
81
- credential_resolver=AwsCrtCredentialResolver(None), # type: ignore
82
- )
83
79
 
84
80
  self._config = STTOptions(
85
81
  language=language,
@@ -95,6 +91,7 @@ class STT(stt.STT):
95
91
  enable_partial_results_stabilization=enable_partial_results_stabilization,
96
92
  partial_results_stability=partial_results_stability,
97
93
  language_model_name=language_model_name,
94
+ region=region,
98
95
  )
99
96
 
100
97
  async def aclose(self) -> None:
@@ -115,12 +112,7 @@ class STT(stt.STT):
115
112
  language: NotGivenOr[str] = NOT_GIVEN,
116
113
  conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
117
114
  ) -> SpeechStream:
118
- return SpeechStream(
119
- stt=self,
120
- client=self._client,
121
- conn_options=conn_options,
122
- opts=self._config,
123
- )
115
+ return SpeechStream(stt=self, conn_options=conn_options, opts=self._config)
124
116
 
125
117
 
126
118
  class SpeechStream(stt.SpeechStream):
@@ -128,15 +120,18 @@ class SpeechStream(stt.SpeechStream):
128
120
  self,
129
121
  stt: STT,
130
122
  opts: STTOptions,
131
- client: TranscribeStreamingClient,
132
123
  conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
133
124
  ) -> None:
134
125
  super().__init__(stt=stt, conn_options=conn_options, sample_rate=opts.sample_rate)
135
126
  self._opts = opts
136
- self._client = client
137
127
 
138
128
  async def _run(self) -> None:
139
129
  while True:
130
+ client = TranscribeStreamingClient(
131
+ region=self._opts.region,
132
+ credential_resolver=AwsCrtCredentialResolver(None), # type: ignore
133
+ )
134
+
140
135
  live_config = {
141
136
  "language_code": self._opts.language,
142
137
  "media_sample_rate_hz": self._opts.sample_rate,
@@ -153,7 +148,7 @@ class SpeechStream(stt.SpeechStream):
153
148
  "language_model_name": self._opts.language_model_name,
154
149
  }
155
150
  filtered_config = {k: v for k, v in live_config.items() if v and is_given(v)}
156
- stream = await self._client.start_stream_transcription(**filtered_config) # type: ignore
151
+ stream = await client.start_stream_transcription(**filtered_config) # type: ignore
157
152
 
158
153
  async def input_generator(stream: StartStreamTranscriptionEventStream) -> None:
159
154
  async for frame in self._input_ch:
@@ -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__ = "1.2.2"
15
+ __version__ = "1.2.3"
@@ -23,7 +23,7 @@ classifiers = [
23
23
  "Programming Language :: Python :: 3 :: Only",
24
24
  ]
25
25
  dependencies = [
26
- "livekit-agents>=1.2.2",
26
+ "livekit-agents>=1.2.3",
27
27
  "aioboto3>=14.1.0",
28
28
  "amazon-transcribe>=0.6.2",
29
29
  ]