fixing google llm service error

This commit is contained in:
Vaibhav159
2025-02-12 22:22:04 +05:30
parent 80e1325621
commit 687b3d9d4c
2 changed files with 7 additions and 3 deletions

View File

@@ -604,9 +604,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
)