From 15bf5b15339b8af6fe2a955b471c5b673da9cf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 9 Oct 2025 17:28:16 -0700 Subject: [PATCH 1/3] aws: move aws_nova_sonic to aws.nova_sonic --- .../20e-persistent-context-aws-nova-sonic.py | 2 +- examples/foundational/40-aws-nova-sonic.py | 2 +- src/pipecat/services/aws/__init__.py | 1 + src/pipecat/services/aws/nova_sonic/__init__.py | 0 .../{aws_nova_sonic => aws/nova_sonic}/context.py | 2 +- .../{aws_nova_sonic => aws/nova_sonic}/frames.py | 0 .../aws.py => aws/nova_sonic/llm.py} | 6 +++--- .../{aws_nova_sonic => aws/nova_sonic}/ready.wav | Bin src/pipecat/services/aws_nova_sonic/__init__.py | 1 - 9 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 src/pipecat/services/aws/nova_sonic/__init__.py rename src/pipecat/services/{aws_nova_sonic => aws/nova_sonic}/context.py (99%) rename src/pipecat/services/{aws_nova_sonic => aws/nova_sonic}/frames.py (100%) rename src/pipecat/services/{aws_nova_sonic/aws.py => aws/nova_sonic/llm.py} (99%) rename src/pipecat/services/{aws_nova_sonic => aws/nova_sonic}/ready.wav (100%) delete mode 100644 src/pipecat/services/aws_nova_sonic/__init__.py diff --git a/examples/foundational/20e-persistent-context-aws-nova-sonic.py b/examples/foundational/20e-persistent-context-aws-nova-sonic.py index bd3d9d545..2161aff8f 100644 --- a/examples/foundational/20e-persistent-context-aws-nova-sonic.py +++ b/examples/foundational/20e-persistent-context-aws-nova-sonic.py @@ -23,7 +23,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.aws_nova_sonic.aws import AWSNovaSonicLLMService +from pipecat.services.aws.nova_sonic.llm import AWSNovaSonicLLMService from pipecat.services.llm_service import FunctionCallParams from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams diff --git a/examples/foundational/40-aws-nova-sonic.py b/examples/foundational/40-aws-nova-sonic.py index de7bbf638..d9bd2257d 100644 --- a/examples/foundational/40-aws-nova-sonic.py +++ b/examples/foundational/40-aws-nova-sonic.py @@ -21,7 +21,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.aws_nova_sonic import AWSNovaSonicLLMService +from pipecat.services.aws.nova_sonic.llm import AWSNovaSonicLLMService from pipecat.services.llm_service import FunctionCallParams from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams diff --git a/src/pipecat/services/aws/__init__.py b/src/pipecat/services/aws/__init__.py index b1f157bd3..3cdd4cc5a 100644 --- a/src/pipecat/services/aws/__init__.py +++ b/src/pipecat/services/aws/__init__.py @@ -9,6 +9,7 @@ import sys from pipecat.services import DeprecatedModuleProxy from .llm import * +from .nova_sonic import * from .stt import * from .tts import * diff --git a/src/pipecat/services/aws/nova_sonic/__init__.py b/src/pipecat/services/aws/nova_sonic/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/pipecat/services/aws_nova_sonic/context.py b/src/pipecat/services/aws/nova_sonic/context.py similarity index 99% rename from src/pipecat/services/aws_nova_sonic/context.py rename to src/pipecat/services/aws/nova_sonic/context.py index 0ce5ce033..86aa0f0b5 100644 --- a/src/pipecat/services/aws_nova_sonic/context.py +++ b/src/pipecat/services/aws/nova_sonic/context.py @@ -33,7 +33,7 @@ from pipecat.frames.frames import ( ) from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.frame_processor import FrameDirection -from pipecat.services.aws_nova_sonic.frames import AWSNovaSonicFunctionCallResultFrame +from pipecat.services.aws.nova_sonic.frames import AWSNovaSonicFunctionCallResultFrame from pipecat.services.openai.llm import ( OpenAIAssistantContextAggregator, OpenAIUserContextAggregator, diff --git a/src/pipecat/services/aws_nova_sonic/frames.py b/src/pipecat/services/aws/nova_sonic/frames.py similarity index 100% rename from src/pipecat/services/aws_nova_sonic/frames.py rename to src/pipecat/services/aws/nova_sonic/frames.py diff --git a/src/pipecat/services/aws_nova_sonic/aws.py b/src/pipecat/services/aws/nova_sonic/llm.py similarity index 99% rename from src/pipecat/services/aws_nova_sonic/aws.py rename to src/pipecat/services/aws/nova_sonic/llm.py index 66b020055..2801de688 100644 --- a/src/pipecat/services/aws_nova_sonic/aws.py +++ b/src/pipecat/services/aws/nova_sonic/llm.py @@ -54,14 +54,14 @@ from pipecat.processors.aggregators.openai_llm_context import ( OpenAILLMContextFrame, ) from pipecat.processors.frame_processor import FrameDirection -from pipecat.services.aws_nova_sonic.context import ( +from pipecat.services.aws.nova_sonic.context import ( AWSNovaSonicAssistantContextAggregator, AWSNovaSonicContextAggregatorPair, AWSNovaSonicLLMContext, AWSNovaSonicUserContextAggregator, Role, ) -from pipecat.services.aws_nova_sonic.frames import AWSNovaSonicFunctionCallResultFrame +from pipecat.services.aws.nova_sonic.frames import AWSNovaSonicFunctionCallResultFrame from pipecat.services.llm_service import LLMService from pipecat.utils.time import time_now_iso8601 @@ -251,7 +251,7 @@ class AWSNovaSonicLLMService(LLMService): self._connected_time: Optional[float] = None self._wants_connection = False - file_path = files("pipecat.services.aws_nova_sonic").joinpath("ready.wav") + file_path = files("pipecat.services.aws.nova_sonic").joinpath("ready.wav") with wave.open(file_path.open("rb"), "rb") as wav_file: self._assistant_response_trigger_audio = wav_file.readframes(wav_file.getnframes()) diff --git a/src/pipecat/services/aws_nova_sonic/ready.wav b/src/pipecat/services/aws/nova_sonic/ready.wav similarity index 100% rename from src/pipecat/services/aws_nova_sonic/ready.wav rename to src/pipecat/services/aws/nova_sonic/ready.wav diff --git a/src/pipecat/services/aws_nova_sonic/__init__.py b/src/pipecat/services/aws_nova_sonic/__init__.py deleted file mode 100644 index 4da394cf6..000000000 --- a/src/pipecat/services/aws_nova_sonic/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .aws import AWSNovaSonicLLMService, Params From 2a79b2c85392479e93922519ad2f92d67b728e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 9 Oct 2025 17:29:02 -0700 Subject: [PATCH 2/3] aws: deprecate aws_nova_sonic --- .../services/aws_nova_sonic/__init__.py | 19 ++++++++++++++ src/pipecat/services/aws_nova_sonic/aws.py | 25 +++++++++++++++++++ .../services/aws_nova_sonic/context.py | 25 +++++++++++++++++++ src/pipecat/services/aws_nova_sonic/frames.py | 21 ++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 src/pipecat/services/aws_nova_sonic/__init__.py create mode 100644 src/pipecat/services/aws_nova_sonic/aws.py create mode 100644 src/pipecat/services/aws_nova_sonic/context.py create mode 100644 src/pipecat/services/aws_nova_sonic/frames.py diff --git a/src/pipecat/services/aws_nova_sonic/__init__.py b/src/pipecat/services/aws_nova_sonic/__init__.py new file mode 100644 index 000000000..e1cb912b6 --- /dev/null +++ b/src/pipecat/services/aws_nova_sonic/__init__.py @@ -0,0 +1,19 @@ +# +# Copyright (c) 2025, Daily +# +# SPDX-License-Identifier: BSD 2-Clause License +# + +import warnings + +from pipecat.services.aws.nova_sonic.llm import AWSNovaSonicLLMService, Params + +with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "Types in pipecat.services.aws_nova_sonic are deprecated. " + "Please use the equivalent types from " + "pipecat.services.aws.nova_sonic.llm instead.", + DeprecationWarning, + stacklevel=2, + ) diff --git a/src/pipecat/services/aws_nova_sonic/aws.py b/src/pipecat/services/aws_nova_sonic/aws.py new file mode 100644 index 000000000..0524829df --- /dev/null +++ b/src/pipecat/services/aws_nova_sonic/aws.py @@ -0,0 +1,25 @@ +# +# Copyright (c) 2025, Daily +# +# SPDX-License-Identifier: BSD 2-Clause License +# + +"""AWS Nova Sonic LLM service implementation for Pipecat AI framework. + +This module provides a speech-to-speech LLM service using AWS Nova Sonic, which supports +bidirectional audio streaming, text generation, and function calling capabilities. +""" + +import warnings + +from pipecat.services.aws.nova_sonic.llm import * + +with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "Types in pipecat.services.aws_nova_sonic.aws are deprecated. " + "Please use the equivalent types from " + "pipecat.services.aws.nova_sonic.llm instead.", + DeprecationWarning, + stacklevel=2, + ) diff --git a/src/pipecat/services/aws_nova_sonic/context.py b/src/pipecat/services/aws_nova_sonic/context.py new file mode 100644 index 000000000..05a24f337 --- /dev/null +++ b/src/pipecat/services/aws_nova_sonic/context.py @@ -0,0 +1,25 @@ +# +# Copyright (c) 2025, Daily +# +# SPDX-License-Identifier: BSD 2-Clause License +# + +"""Context management for AWS Nova Sonic LLM service. + +This module provides specialized context aggregators and message handling for AWS Nova Sonic, +including conversation history management and role-specific message processing. +""" + +import warnings + +from pipecat.services.aws.nova_sonic.context import * + +with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "Types in pipecat.services.aws_nova_sonic.context are deprecated. " + "Please use the equivalent types from " + "pipecat.services.aws.nova_sonic.context instead.", + DeprecationWarning, + stacklevel=2, + ) diff --git a/src/pipecat/services/aws_nova_sonic/frames.py b/src/pipecat/services/aws_nova_sonic/frames.py new file mode 100644 index 000000000..def5f26c4 --- /dev/null +++ b/src/pipecat/services/aws_nova_sonic/frames.py @@ -0,0 +1,21 @@ +# +# Copyright (c) 2025, Daily +# +# SPDX-License-Identifier: BSD 2-Clause License +# + +"""Custom frames for AWS Nova Sonic LLM service.""" + +import warnings + +from pipecat.services.aws.nova_sonic.frames import * + +with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "Types in pipecat.services.aws_nova_sonic.frames are deprecated. " + "Please use the equivalent types from " + "pipecat.services.aws.nova_sonic.frames instead.", + DeprecationWarning, + stacklevel=2, + ) From aac4ce2d12e310d8cb652ef5d942c90e9dc68050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 9 Oct 2025 17:29:42 -0700 Subject: [PATCH 3/3] update CHANGELOG with aws_nova_sonic deprecation --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28da49e20..9493c9d06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated +- `pipecat.service.aws_nova_sonic` is now deprecated, use + `pipecat.services.aws.nova_sonic` instead. + - `GeminiMultimodalLiveLLMService` is now deprecated, use `GeminiLiveLLMService`.