livekit-plugins-aws 1.1.6__tar.gz → 1.2.0__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.
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/PKG-INFO +2 -2
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/experimental/realtime/realtime_model.py +15 -9
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/llm.py +7 -1
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/version.py +1 -1
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/pyproject.toml +1 -1
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/.gitignore +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/README.md +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/__init__.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/experimental/realtime/__init__.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/experimental/realtime/events.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/experimental/realtime/pretty_printer.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/experimental/realtime/turn_tracker.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/log.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/models.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/py.typed +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/stt.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/livekit/plugins/aws/tts.py +0 -0
- {livekit_plugins_aws-1.1.6 → livekit_plugins_aws-1.2.0}/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.
|
|
3
|
+
Version: 1.2.0
|
|
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.
|
|
23
|
+
Requires-Dist: livekit-agents>=1.2.0
|
|
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'
|
|
@@ -239,6 +239,7 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
239
239
|
turn_detection=True,
|
|
240
240
|
user_transcription=True,
|
|
241
241
|
auto_tool_reply_generation=True,
|
|
242
|
+
audio_output=True,
|
|
242
243
|
)
|
|
243
244
|
)
|
|
244
245
|
self.model_id = "amazon.nova-sonic-v1:0"
|
|
@@ -355,6 +356,7 @@ class RealtimeSession( # noqa: F811
|
|
|
355
356
|
aws_credentials_identity_resolver=Boto3CredentialsResolver(),
|
|
356
357
|
http_auth_scheme_resolver=HTTPAuthSchemeResolver(),
|
|
357
358
|
http_auth_schemes={"aws.auth#sigv4": SigV4AuthScheme()},
|
|
359
|
+
user_agent_extra="x-client-framework:livekit-plugins-aws[realtime]",
|
|
358
360
|
)
|
|
359
361
|
self._bedrock_client = BedrockRuntimeClient(config=config)
|
|
360
362
|
|
|
@@ -516,7 +518,7 @@ class RealtimeSession( # noqa: F811
|
|
|
516
518
|
self._chat_ctx.truncate(max_items=MAX_MESSAGES)
|
|
517
519
|
init_events = self._event_builder.create_prompt_start_block(
|
|
518
520
|
voice_id=self._realtime_model._opts.voice,
|
|
519
|
-
sample_rate=DEFAULT_OUTPUT_SAMPLE_RATE,
|
|
521
|
+
sample_rate=DEFAULT_OUTPUT_SAMPLE_RATE, # type: ignore
|
|
520
522
|
system_content=self._instructions,
|
|
521
523
|
chat_ctx=self.chat_ctx,
|
|
522
524
|
tool_configuration=self._serialize_tool_config(),
|
|
@@ -823,12 +825,14 @@ class RealtimeSession( # noqa: F811
|
|
|
823
825
|
curr_gen.audio_ch.close()
|
|
824
826
|
if not curr_gen.text_ch.closed:
|
|
825
827
|
curr_gen.text_ch.close()
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
828
|
+
|
|
829
|
+
# TODO: seems not needed, tool_messages[id] is a str, function_ch is closed below?
|
|
830
|
+
# if self._current_generation.response_id in self._current_generation.tool_messages:
|
|
831
|
+
# curr_gen = self._current_generation.tool_messages[
|
|
832
|
+
# self._current_generation.response_id
|
|
833
|
+
# ]
|
|
834
|
+
# if not curr_gen.function_ch.closed:
|
|
835
|
+
# curr_gen.function_ch.close()
|
|
832
836
|
|
|
833
837
|
if not self._current_generation.message_ch.closed:
|
|
834
838
|
self._current_generation.message_ch.close()
|
|
@@ -1055,7 +1059,7 @@ class RealtimeSession( # noqa: F811
|
|
|
1055
1059
|
"tool_use_id": item.call_id,
|
|
1056
1060
|
"tool_result": item.output
|
|
1057
1061
|
if not item.is_error
|
|
1058
|
-
else f"{{'error': '{item.
|
|
1062
|
+
else f"{{'error': '{item.output}'}}",
|
|
1059
1063
|
}
|
|
1060
1064
|
)
|
|
1061
1065
|
|
|
@@ -1230,7 +1234,9 @@ class RealtimeSession( # noqa: F811
|
|
|
1230
1234
|
def interrupt(self) -> None:
|
|
1231
1235
|
logger.warning("interrupt is not supported by Nova Sonic's Realtime API")
|
|
1232
1236
|
|
|
1233
|
-
def truncate(
|
|
1237
|
+
def truncate(
|
|
1238
|
+
self, *, message_id: str, audio_end_ms: int, audio_transcript: NotGivenOr[str] = NOT_GIVEN
|
|
1239
|
+
) -> None:
|
|
1234
1240
|
logger.warning("truncate is not supported by Nova Sonic's Realtime API")
|
|
1235
1241
|
|
|
1236
1242
|
@utils.log_exceptions(logger=logger)
|
|
@@ -19,6 +19,7 @@ from dataclasses import dataclass
|
|
|
19
19
|
from typing import Any, cast
|
|
20
20
|
|
|
21
21
|
import aioboto3 # type: ignore
|
|
22
|
+
from botocore.config import Config # type: ignore
|
|
22
23
|
|
|
23
24
|
from livekit.agents import APIConnectionError, APIStatusError, llm
|
|
24
25
|
from livekit.agents.llm import (
|
|
@@ -112,6 +113,10 @@ class LLM(llm.LLM):
|
|
|
112
113
|
additional_request_fields=additional_request_fields,
|
|
113
114
|
)
|
|
114
115
|
|
|
116
|
+
@property
|
|
117
|
+
def model(self) -> str:
|
|
118
|
+
return self._opts.model
|
|
119
|
+
|
|
115
120
|
def chat(
|
|
116
121
|
self,
|
|
117
122
|
*,
|
|
@@ -205,7 +210,8 @@ class LLMStream(llm.LLMStream):
|
|
|
205
210
|
async def _run(self) -> None:
|
|
206
211
|
retryable = True
|
|
207
212
|
try:
|
|
208
|
-
|
|
213
|
+
config = Config(user_agent_extra="x-client-framework:livekit-plugins-aws")
|
|
214
|
+
async with self._session.client("bedrock-runtime", config=config) as client:
|
|
209
215
|
response = await client.converse_stream(**self._opts)
|
|
210
216
|
request_id = response["ResponseMetadata"]["RequestId"]
|
|
211
217
|
if response["ResponseMetadata"]["HTTPStatusCode"] != 200:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|