diff --git a/CHANGELOG.md b/CHANGELOG.md index 6925f6223..ac15dffec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Tamil) and PlayHT (Afrikans, Albanian, Amharic, Arabic, Bengali, Croatian, Galician, Hebrew, Mandarin, Serbian, Tagalog, Urdu, Xhosa). +### Deprecated + +- `AWSTTSService` is now deprecated, use `PollyTTSService` instead. + ## [0.0.50] - 2024-12-11 ### Added diff --git a/examples/foundational/07m-interruptible-aws.py b/examples/foundational/07m-interruptible-polly.py similarity index 94% rename from examples/foundational/07m-interruptible-aws.py rename to examples/foundational/07m-interruptible-polly.py index e64a9c6f8..df376b2f4 100644 --- a/examples/foundational/07m-interruptible-aws.py +++ b/examples/foundational/07m-interruptible-polly.py @@ -19,7 +19,7 @@ from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext -from pipecat.services.aws import AWSTTSService +from pipecat.services.aws import PollyTTSService from pipecat.services.deepgram import DeepgramSTTService from pipecat.services.openai import OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTransport @@ -48,12 +48,12 @@ async def main(): stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) - tts = AWSTTSService( + tts = PollyTTSService( api_key=os.getenv("AWS_SECRET_ACCESS_KEY"), aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID"), region=os.getenv("AWS_REGION"), voice_id="Amy", - params=AWSTTSService.InputParams(engine="neural", language="en-GB", rate="1.05"), + params=PollyTTSService.InputParams(engine="neural", language="en-GB", rate="1.05"), ) llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") diff --git a/src/pipecat/services/aws.py b/src/pipecat/services/aws.py index 6a74731b5..cd09e2ff8 100644 --- a/src/pipecat/services/aws.py +++ b/src/pipecat/services/aws.py @@ -108,7 +108,7 @@ def language_to_aws_language(language: Language) -> str | None: return language_map.get(language) -class AWSTTSService(TTSService): +class PollyTTSService(TTSService): class InputParams(BaseModel): engine: Optional[str] = None language: Optional[Language] = Language.EN @@ -244,3 +244,16 @@ def read_audio_data(**args): finally: yield TTSStoppedFrame() + + +class AWSTTSService(PollyTTSService): + def __init__(self, **kwargs): + super().__init__(**kwargs) + + import warnings + + with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "'AWSTTSService' is deprecated, use 'PollyTTSService' instead.", DeprecationWarning + )