From 8250c381d14d9ab2be933b2ee9c0eb91b579cbae Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 25 Aug 2025 10:53:12 -0400 Subject: [PATCH 1/3] AWSPollyTTSService: allow setting auth credentials through provider chain --- CHANGELOG.md | 4 ++++ src/pipecat/services/aws/tts.py | 10 ---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f5014110..7bd95163f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -160,6 +160,10 @@ asyncio.wait_for(task, timeout)` instead. ### Fixed +- Fixed `AWSPollyTTSService` to support AWS credential provider chain (IAM + roles, IRSA, instance profiles) instead of requiring explicit environment + variables. + - Fixed an issue that would cause `PipelineRunner` and `PipelineTask` to not handle external asyncio task cancellation properly. diff --git a/src/pipecat/services/aws/tts.py b/src/pipecat/services/aws/tts.py index 88f0a8fdd..805d733e8 100644 --- a/src/pipecat/services/aws/tts.py +++ b/src/pipecat/services/aws/tts.py @@ -185,16 +185,6 @@ class AWSPollyTTSService(TTSService): "region_name": region or os.getenv("AWS_REGION", "us-east-1"), } - # Validate that we have the required credentials - if ( - not self._aws_params["aws_access_key_id"] - or not self._aws_params["aws_secret_access_key"] - ): - raise ValueError( - "AWS credentials not found. Please provide them either through constructor parameters " - "or set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables." - ) - self._aws_session = aioboto3.Session() self._settings = { "engine": params.engine, From facfaa2dd45ffa7fcb0db223d0db080f8fdcee0b Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 25 Aug 2025 10:53:40 -0400 Subject: [PATCH 2/3] AWSBedrockLLMService: Allow setting auth credentials via env vars --- CHANGELOG.md | 19 +++++++++++-------- src/pipecat/services/aws/llm.py | 9 +++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bd95163f..207596c71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,12 +87,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Updated `SarvamTTSService` to use WebSocket streaming for real-time audio - generation with multiple Indian languages, with HTTP support still available +- Added support to `AWSBedrockLLMService` for setting authentication + credentials through environment variables. + +- Updated `SarvamTTSService` to use WebSocket streaming for real-time audio + generation with multiple Indian languages, with HTTP support still available via `SarvamHttpTTSService`. ### Fixed +- Fixed `AWSPollyTTSService` to support AWS credential provider chain (IAM + roles, IRSA, instance profiles) instead of requiring explicit environment + variables. + - Fixed a `CartesiaTTSService` issue that was causing the application to hang after Cartesia's 5 minutes timed out. @@ -145,8 +152,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated -- `FrameProcessor.wait_for_task()` is deprecated. Use `await task` or `await -asyncio.wait_for(task, timeout)` instead. +- `FrameProcessor.wait_for_task()` is deprecated. Use `await task` or + `await asyncio.wait_for(task, timeout)` instead. ### Removed @@ -160,10 +167,6 @@ asyncio.wait_for(task, timeout)` instead. ### Fixed -- Fixed `AWSPollyTTSService` to support AWS credential provider chain (IAM - roles, IRSA, instance profiles) instead of requiring explicit environment - variables. - - Fixed an issue that would cause `PipelineRunner` and `PipelineTask` to not handle external asyncio task cancellation properly. diff --git a/src/pipecat/services/aws/llm.py b/src/pipecat/services/aws/llm.py index 6e109c4c1..7b9691b04 100644 --- a/src/pipecat/services/aws/llm.py +++ b/src/pipecat/services/aws/llm.py @@ -16,6 +16,7 @@ import base64 import copy import io import json +import os import re from dataclasses import dataclass from typing import Any, Dict, List, Optional @@ -761,10 +762,10 @@ class AWSBedrockLLMService(LLMService): # Store AWS session parameters for creating client in async context self._aws_params = { - "aws_access_key_id": aws_access_key, - "aws_secret_access_key": aws_secret_key, - "aws_session_token": aws_session_token, - "region_name": aws_region, + "aws_access_key_id": aws_access_key or os.getenv("AWS_ACCESS_KEY_ID"), + "aws_secret_access_key": aws_secret_key or os.getenv("AWS_SECRET_ACCESS_KEY"), + "aws_session_token": aws_session_token or os.getenv("AWS_SESSION_TOKEN"), + "region_name": aws_region or os.getenv("AWS_REGION", "us-east-1"), "config": client_config, } From 86a37d8ceab310bea59a99f4e2735330971d24b7 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Tue, 26 Aug 2025 21:00:16 -0400 Subject: [PATCH 3/3] Add changelog entry for SentryMetrics missing import fix --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 207596c71..7aade22d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed a missing import in `SentryMetrics`. + - Fixed `AWSPollyTTSService` to support AWS credential provider chain (IAM roles, IRSA, instance profiles) instead of requiring explicit environment variables.