external_user_turn_completion_stop_strategy
User turn stop strategy that finalizes on UserTurnInferenceCompletedFrame.
- class pipecat.turns.user_stop.external_user_turn_completion_stop_strategy.ExternalUserTurnCompletionStopStrategy(*, enable_user_speaking_frames: bool = True, **kwargs)[source]
Bases:
BaseUserTurnStopStrategyFinalize the user turn whenever a
UserTurnInferenceCompletedFramearrives.Generic stop strategy for pipelines where some external component (LLM with completion markers, STT with built-in turn detection, a dedicated end-of-turn classifier, custom user code, etc.) judges when a turn is semantically complete and emits
UserTurnInferenceCompletedFrame.Pair this with one or more
deferred(...)-wrapped detector strategies that driveon_user_turn_inference_triggeredbut leave finalization to this strategy:stop=[ deferred(TurnAnalyzerUserTurnStopStrategy(turn_analyzer=...)), ExternalUserTurnCompletionStopStrategy(), ]
For LLM-completion-marker gating specifically, use the subclass
LLMTurnCompletionUserTurnStopStrategyinstead, which additionally pushes theLLMUpdateSettingsFramethat enables the marker protocol on the LLM.If the producer never emits
UserTurnInferenceCompletedFrame, the controller’suser_turn_stop_timeoutwatchdog finalizes the turn after no activity. Tune that timeout if your producer can take longer than the default to respond.- async process_frame(frame: Frame) ProcessFrameResult[source]
Fire
on_user_turn_stoppedwheneverUserTurnInferenceCompletedFrameis seen.