From aa85df4fd6fe34472fd3926ea2cfb9499c48886c Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Wed, 26 Mar 2025 16:21:31 -0400 Subject: [PATCH] Fix: GoogleTTSService was emitting two TTSStoppedFrames --- CHANGELOG.md | 2 ++ src/pipecat/services/google/google.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e81db88a2..0263bae47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (e.g. `OpenAISTTService`) to try to transcribe non-spoken audio, causing invalid transcriptions. +- Fixed an issue where `GoogleTTSService` was emitting two `TTSStoppedFrames`. + ## [0.0.61] - 2025-03-26 ### Added diff --git a/src/pipecat/services/google/google.py b/src/pipecat/services/google/google.py index 3d207a254..95c5a1edb 100644 --- a/src/pipecat/services/google/google.py +++ b/src/pipecat/services/google/google.py @@ -1343,6 +1343,7 @@ class GoogleVertexLLMService(OpenAILLMService): **kwargs, ): """Initializes the VertexLLMService. + Args: credentials (Optional[str]): JSON string of service account credentials. credentials_path (Optional[str]): Path to the service account JSON file. @@ -1366,9 +1367,11 @@ class GoogleVertexLLMService(OpenAILLMService): @staticmethod def _get_api_token(credentials: Optional[str], credentials_path: Optional[str]) -> str: """Retrieves an authentication token using Google service account credentials. + Args: credentials (Optional[str]): JSON string of service account credentials. credentials_path (Optional[str]): Path to the service account JSON file. + Returns: str: OAuth token for API authentication. """ @@ -1557,8 +1560,6 @@ class GoogleTTSService(TTSService): logger.exception(f"{self} error generating TTS: {e}") error_message = f"TTS generation error: {str(e)}" yield ErrorFrame(error=error_message) - finally: - yield TTSStoppedFrame() class GoogleImageGenService(ImageGenService):