diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa77e3b2..b712407cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an issue where, in some edge cases, the `EmulateUserStartedSpeakingFrame` could be created even if we didn't have a transcription. +- Fixed an issue in `GoogleLLMContext` where it would inject the + `system_message` as a "user" message into cases where it was not meant to; + it was only meant to do that when there were no "regular" (non-function-call) + messages in the context, to ensure that inference would run properly. + ## [0.0.76] - 2025-07-11 ### Added diff --git a/src/pipecat/services/google/llm.py b/src/pipecat/services/google/llm.py index f0e74d2ce..54a7abb0d 100644 --- a/src/pipecat/services/google/llm.py +++ b/src/pipecat/services/google/llm.py @@ -627,9 +627,9 @@ class GoogleLLMContext(OpenAILLMContext): # Check if we only have function-related messages (no regular text) has_regular_messages = any( len(msg.parts) == 1 - and not getattr(msg.parts[0], "text", None) - and getattr(msg.parts[0], "function_call", None) - and getattr(msg.parts[0], "function_response", None) + and getattr(msg.parts[0], "text", None) + and not getattr(msg.parts[0], "function_call", None) + and not getattr(msg.parts[0], "function_response", None) for msg in self._messages )