diff --git a/CHANGELOG.md b/CHANGELOG.md index 41d1b6236..f6a009fd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ 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. + +### 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 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