From c1db13ceebd7f5e5d180325505cf3f6ae818f1f7 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Thu, 12 Jun 2025 12:07:33 -0300 Subject: [PATCH 1/3] Fixed an issue with `GoogleSTTService` where it was constantly reconnecting before starting to receive audio from the user. --- CHANGELOG.md | 7 +++++++ src/pipecat/services/google/stt.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41d1b6236..3ee2453e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to **Pipecat** will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Fixed an issue with `GoogleSTTService` where it was constantly reconnecting + before starting to receive audio from the user. + ## [0.0.71] - 2025-06-10 ### Added diff --git a/src/pipecat/services/google/stt.py b/src/pipecat/services/google/stt.py index 4fd129af3..bf60541f5 100644 --- a/src/pipecat/services/google/stt.py +++ b/src/pipecat/services/google/stt.py @@ -747,6 +747,11 @@ class GoogleSTTService(STTService): try: while True: try: + if self._request_queue.empty(): + # wait for 10ms in case we don't have audio + await asyncio.sleep(0.01) + continue + # Start bi-directional streaming streaming_recognize = await self._client.streaming_recognize( requests=self._request_generator() From 69c63293fb7f83ddb1b477adb7463112ad16d8a2 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 12 Jun 2025 11:43:27 -0400 Subject: [PATCH 2/3] fix: GoogleLLMService TTFB value --- CHANGELOG.md | 6 ++++++ src/pipecat/services/google/llm.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41d1b6236..9c38dcd55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to **Pipecat** will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Fixed an issue where `GoogleLLMService`'s TTFB value was incorrect. + ## [0.0.71] - 2025-06-10 ### Added diff --git a/src/pipecat/services/google/llm.py b/src/pipecat/services/google/llm.py index 8960bda31..f983b7342 100644 --- a/src/pipecat/services/google/llm.py +++ b/src/pipecat/services/google/llm.py @@ -555,10 +555,11 @@ class GoogleLLMService(LLMService): contents=messages, config=generation_config, ) - await self.stop_ttfb_metrics() function_calls = [] async for chunk in response: + # Stop TTFB metrics after the first chunk + await self.stop_ttfb_metrics() if chunk.usage_metadata: prompt_tokens += chunk.usage_metadata.prompt_token_count or 0 completion_tokens += chunk.usage_metadata.candidates_token_count or 0 From 22f4f0b79e9006c8f6971ae0c2b05dbd91c87524 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 12 Jun 2025 11:45:59 -0400 Subject: [PATCH 3/3] Update 14e example name --- CHANGELOG.md | 4 ++++ ...ction-calling-gemini.py => 14e-function-calling-google.py} | 0 2 files changed, 4 insertions(+) rename examples/foundational/{14e-function-calling-gemini.py => 14e-function-calling-google.py} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c38dcd55..f6a009fd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an issue where `GoogleLLMService`'s TTFB value was incorrect. +### Other + +- Rename `14e-function-calling-gemini.py` to `14e-function-calling-google.py`. + ## [0.0.71] - 2025-06-10 ### Added diff --git a/examples/foundational/14e-function-calling-gemini.py b/examples/foundational/14e-function-calling-google.py similarity index 100% rename from examples/foundational/14e-function-calling-gemini.py rename to examples/foundational/14e-function-calling-google.py