fix duplicate assistant text events
This commit is contained in:
@@ -18,7 +18,6 @@ from pipecat.frames.frames import (
|
||||
OutputAudioRawFrame,
|
||||
OutputTransportMessageFrame,
|
||||
OutputTransportMessageUrgentFrame,
|
||||
TextFrame,
|
||||
TranscriptionFrame,
|
||||
UserImageRawFrame,
|
||||
)
|
||||
@@ -64,9 +63,9 @@ class ProductWebsocketSerializer(FrameSerializer):
|
||||
timestamp=frame.timestamp,
|
||||
)
|
||||
|
||||
if isinstance(frame, TextFrame):
|
||||
return self._event("response.text.delta", text=frame.text)
|
||||
|
||||
# ProductTextStreamProcessor owns response.text.* events. TTS also
|
||||
# emits TextFrame subclasses internally, and serializing those here
|
||||
# would make the UI render duplicate assistant bubbles.
|
||||
if isinstance(frame, (OutputTransportMessageFrame, OutputTransportMessageUrgentFrame)):
|
||||
if self.should_ignore_frame(frame):
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user