Merge pull request #1212 from Vaibhav159/vl_fix_incorrect_has_regular_messages_check

fixing google llm service error
This commit is contained in:
Aleix Conchillo Flaqué
2025-02-14 13:16:37 -08:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -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
)