Rename UserTurnCompletedFrame to UserTurnInferenceCompletedFrame
The old name overlapped semantically with `UserStoppedSpeakingFrame`: both could be read as "the user's turn is done." They're at different layers — `UserStoppedSpeakingFrame` is the acoustic stop signal, while this frame is the post-judgment "inference about the turn is now complete (turn is semantically final)" signal emitted by the LLM mixin (on ✓), an end-of-turn classifier, or a custom producer. The new name pairs naturally with the existing `on_user_turn_inference_triggered` event vocabulary and removes the ambiguity with `UserStoppedSpeakingFrame`.
This commit is contained in:
@@ -12,7 +12,7 @@ from pipecat.frames.frames import (
|
||||
LLMFullResponseEndFrame,
|
||||
LLMMarkerFrame,
|
||||
LLMTextFrame,
|
||||
UserTurnCompletedFrame,
|
||||
UserTurnInferenceCompletedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameProcessor
|
||||
from pipecat.services.llm_service import LLMService
|
||||
@@ -61,8 +61,8 @@ class TestUserUserTurnCompletionLLMServiceMixin(unittest.IsolatedAsyncioTestCase
|
||||
self.assertEqual(marker_frames[0].marker, USER_TURN_COMPLETE_MARKER)
|
||||
self.assertFalse(marker_frames[0].append_to_context_immediately)
|
||||
|
||||
# UserTurnCompletedFrame broadcast in both directions.
|
||||
completed = [f for f in pushed_frames if isinstance(f, UserTurnCompletedFrame)]
|
||||
# UserTurnInferenceCompletedFrame broadcast in both directions.
|
||||
completed = [f for f in pushed_frames if isinstance(f, UserTurnInferenceCompletedFrame)]
|
||||
self.assertEqual(len(completed), 2)
|
||||
|
||||
async def test_incomplete_short_marker_suppresses_text(self):
|
||||
@@ -87,8 +87,8 @@ class TestUserUserTurnCompletionLLMServiceMixin(unittest.IsolatedAsyncioTestCase
|
||||
self.assertEqual(marker_frames[0].marker, USER_TURN_INCOMPLETE_SHORT_MARKER)
|
||||
self.assertTrue(marker_frames[0].append_to_context_immediately)
|
||||
|
||||
# Incomplete markers do not emit UserTurnCompletedFrame.
|
||||
completed = [f for f in pushed_frames if isinstance(f, UserTurnCompletedFrame)]
|
||||
# Incomplete markers do not emit UserTurnInferenceCompletedFrame.
|
||||
completed = [f for f in pushed_frames if isinstance(f, UserTurnInferenceCompletedFrame)]
|
||||
self.assertEqual(len(completed), 0)
|
||||
|
||||
async def test_incomplete_long_marker_suppresses_text(self):
|
||||
@@ -112,7 +112,7 @@ class TestUserUserTurnCompletionLLMServiceMixin(unittest.IsolatedAsyncioTestCase
|
||||
self.assertEqual(marker_frames[0].marker, USER_TURN_INCOMPLETE_LONG_MARKER)
|
||||
self.assertTrue(marker_frames[0].append_to_context_immediately)
|
||||
|
||||
completed = [f for f in pushed_frames if isinstance(f, UserTurnCompletedFrame)]
|
||||
completed = [f for f in pushed_frames if isinstance(f, UserTurnInferenceCompletedFrame)]
|
||||
self.assertEqual(len(completed), 0)
|
||||
|
||||
async def test_text_buffered_until_marker_found(self):
|
||||
@@ -135,7 +135,7 @@ class TestUserUserTurnCompletionLLMServiceMixin(unittest.IsolatedAsyncioTestCase
|
||||
await processor._push_turn_text(f" {USER_TURN_COMPLETE_MARKER} How are you?")
|
||||
|
||||
# One LLMTextFrame for the spoken portion; one LLMMarkerFrame for
|
||||
# the marker; UserTurnCompletedFrame broadcast in both directions.
|
||||
# the marker; UserTurnInferenceCompletedFrame broadcast in both directions.
|
||||
text_frames = [f for f in pushed_frames if isinstance(f, LLMTextFrame)]
|
||||
self.assertEqual(len(text_frames), 1)
|
||||
marker_frames = [f for f in pushed_frames if isinstance(f, LLMMarkerFrame)]
|
||||
|
||||
Reference in New Issue
Block a user