From 89750086c5acd50fab5a6f85a1ed4dbaae6ed68f Mon Sep 17 00:00:00 2001 From: Alrahma Date: Fri, 20 Jun 2025 09:47:46 +0100 Subject: [PATCH] Support AWS Polly Lexicon Names parameter Documentation reference [AWS Managing Lexicons](https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html) --- src/pipecat/services/aws/tts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pipecat/services/aws/tts.py b/src/pipecat/services/aws/tts.py index 0159096d1..762e8b9e4 100644 --- a/src/pipecat/services/aws/tts.py +++ b/src/pipecat/services/aws/tts.py @@ -6,7 +6,7 @@ import asyncio import os -from typing import AsyncGenerator, Optional +from typing import AsyncGenerator, List, Optional from loguru import logger from pydantic import BaseModel @@ -115,6 +115,7 @@ class AWSPollyTTSService(TTSService): pitch: Optional[str] = None rate: Optional[str] = None volume: Optional[str] = None + lexicon_names: Optional[List[str]] = None def __init__( self, @@ -147,6 +148,7 @@ class AWSPollyTTSService(TTSService): "pitch": params.pitch, "rate": params.rate, "volume": params.volume, + "lexicon_names": params.lexicon_names, } self._resampler = create_default_resampler() @@ -235,6 +237,7 @@ class AWSPollyTTSService(TTSService): "Engine": self._settings["engine"], # AWS only supports 8000 and 16000 for PCM. We select 16000. "SampleRate": "16000", + "LexiconNames": self._settings["lexicon_names"], } # Filter out None values