services(TTSService): fix sentence cleanup

This commit is contained in:
Aleix Conchillo Flaqué
2024-07-19 11:48:59 -07:00
parent 4c629e538e
commit 846ae765e5
2 changed files with 5 additions and 1 deletions

View File

@@ -201,8 +201,9 @@ class TTSService(AIService):
elif isinstance(frame, StartInterruptionFrame):
await self._handle_interruption(frame, direction)
elif isinstance(frame, LLMFullResponseEndFrame) or isinstance(frame, EndFrame):
sentence = self._current_sentence
self._current_sentence = ""
await self._push_tts_frames(self._current_sentence)
await self._push_tts_frames(sentence)
if isinstance(frame, LLMFullResponseEndFrame):
if self._push_text_frames:
await self.push_frame(frame, direction)