Gemini Mulitmodal Live to push TTSTextFrame only

This commit is contained in:
Mark Backman
2025-04-30 16:24:04 -04:00
parent facbebb15f
commit 82a9d7f992
2 changed files with 2 additions and 5 deletions

View File

@@ -36,7 +36,6 @@ from pipecat.frames.frames import (
StartInterruptionFrame, StartInterruptionFrame,
TextFrame, TextFrame,
TranscriptionFrame, TranscriptionFrame,
TTSTextFrame,
UserImageRawFrame, UserImageRawFrame,
UserStartedSpeakingFrame, UserStartedSpeakingFrame,
UserStoppedSpeakingFrame, UserStoppedSpeakingFrame,
@@ -494,7 +493,7 @@ class LLMAssistantContextAggregator(LLMContextResponseAggregator):
await self._handle_llm_start(frame) await self._handle_llm_start(frame)
elif isinstance(frame, LLMFullResponseEndFrame): elif isinstance(frame, LLMFullResponseEndFrame):
await self._handle_llm_end(frame) await self._handle_llm_end(frame)
elif isinstance(frame, TTSTextFrame): elif isinstance(frame, TextFrame):
await self._handle_text(frame) await self._handle_text(frame)
elif isinstance(frame, LLMMessagesAppendFrame): elif isinstance(frame, LLMMessagesAppendFrame):
self.add_messages(frame.messages) self.add_messages(frame.messages)
@@ -621,7 +620,7 @@ class LLMAssistantContextAggregator(LLMContextResponseAggregator):
self._started -= 1 self._started -= 1
await self.push_aggregation() await self.push_aggregation()
async def _handle_text(self, frame: TTSTextFrame): async def _handle_text(self, frame: TextFrame):
if not self._started: if not self._started:
return return

View File

@@ -30,7 +30,6 @@ from pipecat.frames.frames import (
LLMFullResponseStartFrame, LLMFullResponseStartFrame,
LLMMessagesAppendFrame, LLMMessagesAppendFrame,
LLMSetToolsFrame, LLMSetToolsFrame,
LLMTextFrame,
LLMUpdateSettingsFrame, LLMUpdateSettingsFrame,
StartFrame, StartFrame,
StartInterruptionFrame, StartInterruptionFrame,
@@ -892,7 +891,6 @@ class GeminiMultimodalLiveLLMService(LLMService):
if not text: if not text:
return return
await self.push_frame(LLMTextFrame(text=text))
await self.push_frame(TTSTextFrame(text=text)) await self.push_frame(TTSTextFrame(text=text))
def create_context_aggregator( def create_context_aggregator(