-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pts to llm full response end frame #583
add pts to llm full response end frame #583
Conversation
while True: | ||
try: | ||
(word, timestamp) = await self._words_queue.get() | ||
if word == "LLMFullResponseEndFrame" and timestamp == 0: | ||
await self.push_frame(LLMFullResponseEndFrame()) | ||
frame = LLMFullResponseEndFrame() | ||
frame.pts = last_pts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this frame would be added after all the audio and since it didn't have a pts
it would just be processed after the audio is spoken which should coincide with the text timestamps. But to make it more accurate we make sure it has a pts and its processed just after the text.
@@ -210,7 +210,6 @@ def _get_websocket(self): | |||
async def _handle_interruption(self, frame: StartInterruptionFrame, direction: FrameDirection): | |||
await super()._handle_interruption(frame, direction) | |||
await self.stop_all_metrics() | |||
await self.push_frame(LLMFullResponseEndFrame()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already mentioned it in the commit messages but this is not needed. The context aggregator interruption already handle interruption properly. We don't want to pollute the code with push_frame()
otherwise it will become very hard to maintain.
# audio and video as well. | ||
if isinstance(frame, TextFrame): | ||
await self.push_frame(frame) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have _sink_frame_handler()
so this function is not really needed.
22c4752
to
e6b3ca3
Compare
Interruptions are already handled by context aggregators.
e6b3ca3
to
7bbaf4d
Compare
No description provided.