diff --git a/CHANGELOG.md b/CHANGELOG.md index 1183c1483..5542674ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -134,6 +134,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an issue[#1192] in 11labs where we are trying to reconnect/disconnect the websocket connection even when the connection is already closed. +- Fixed an issue where `has_regular_messages` condition was always been true in + `GoogleLLMContext` due to `Part` having `function_call` & `function_response` with + `None` values. + ## [0.0.56] - 2025-02-06 ### Changed diff --git a/src/pipecat/services/google/google.py b/src/pipecat/services/google/google.py index 605c74069..0a8a86580 100644 --- a/src/pipecat/services/google/google.py +++ b/src/pipecat/services/google/google.py @@ -916,9 +916,9 @@ class GoogleLLMContext(OpenAILLMContext): # Check if we only have function-related messages (no regular text) has_regular_messages = any( len(msg.parts) == 1 - and hasattr(msg.parts[0], "text") - and not hasattr(msg.parts[0], "function_call") - and not hasattr(msg.parts[0], "function_response") + and not getattr(msg.parts[0], "text", None) + and getattr(msg.parts[0], "function_call", None) + and getattr(msg.parts[0], "function_response", None) for msg in self._messages )