From 2920aa5af477720227666d93e057d7b25424b36b Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Wed, 7 May 2025 14:32:32 -0400 Subject: [PATCH] [WIP] AWS Nova Sonic service - pull AWS Nova Sonic support out of the `aws` optional dependency in pyproject.toml and into its own `aws-nova-sonic` optional dependency. That's because it requires Python >= 3.12, a higher version than the base project's 3.10. This change allows anyone using any of the other AWS services (including our own unit tests) to continue using the lower Python version. --- CHANGELOG.md | 3 ++- pyproject.toml | 3 ++- src/pipecat/services/aws_nova_sonic/aws.py | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6fec1b2..319dce632 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added support for the AWS Nova Sonic speech-to-speech model with the new `AWSNovaSonicLLMService`. - (see https://docs.aws.amazon.com/nova/latest/userguide/speech.html) + See https://docs.aws.amazon.com/nova/latest/userguide/speech.html. + Note that it requires Python >= 3.12 and `pip install pipecat-ai[aws-nova-sonic]`. - Added new AWS services `AWSBedrockLLMService` and `AWSTranscribeSTTService`. diff --git a/pyproject.toml b/pyproject.toml index 7ce167d77..06d7fb0a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,8 @@ Website = "https://pipecat.ai" [project.optional-dependencies] anthropic = [ "anthropic~=0.49.0" ] assemblyai = [ "assemblyai~=0.37.0" ] -aws = [ "boto3~=1.37.16", "websockets~=13.1", "aws_sdk_bedrock_runtime~=0.0.2" ] +aws = [ "boto3~=1.37.16", "websockets~=13.1" ] +aws-nova-sonic = [ "aws_sdk_bedrock_runtime~=0.0.2" ] azure = [ "azure-cognitiveservices-speech~=1.42.0"] cartesia = [ "cartesia~=1.4.0", "websockets~=13.1" ] cerebras = [] diff --git a/src/pipecat/services/aws_nova_sonic/aws.py b/src/pipecat/services/aws_nova_sonic/aws.py index eab12272c..b53578f5a 100644 --- a/src/pipecat/services/aws_nova_sonic/aws.py +++ b/src/pipecat/services/aws_nova_sonic/aws.py @@ -74,7 +74,9 @@ try: from smithy_core.aio.eventstream import DuplexEventStream except ModuleNotFoundError as e: logger.error(f"Exception: {e}") - logger.error("In order to use AWS services, you need to `pip install pipecat-ai[aws]`.") + logger.error( + "In order to use AWS services, you need to `pip install pipecat-ai[aws-nova-sonic]`." + ) raise Exception(f"Missing module: {e}")