Merge pull request #2214 from pipecat-ai/pk/fix-google-llm-context

Fixed an issue in `GoogleLLMContext` where it would inject the `syste…
This commit is contained in:
kompfner
2025-07-18 09:28:28 -04:00
committed by GitHub
2 changed files with 8 additions and 3 deletions

View File

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