llm_turn_completion_user_turn_stop_strategy

User turn stop strategy gated on the LLM’s turn-completion verdict.

class pipecat.turns.user_stop.llm_turn_completion_user_turn_stop_strategy.LLMTurnCompletionUserTurnStopStrategy(*, config: UserTurnCompletionConfig | None = None, **kwargs)[source]

Bases: ExternalUserTurnCompletionStopStrategy

LLM-gated stop strategy.

Extends ExternalUserTurnCompletionStopStrategy with the LLM-specific setup needed for the marker-based completion protocol: on StartFrame, pushes an LLMUpdateSettingsFrame upstream that enables filter_incomplete_user_turns on the LLM and seeds the UserTurnCompletionConfig.

Finalization itself is inherited: when the LLM service’s UserTurnCompletionLLMServiceMixin detects a marker, it broadcasts a UserTurnInferenceCompletedFrame and the base class fires on_user_turn_stopped. On incomplete_short / incomplete_long markers the mixin re-prompts internally and no completion frame is emitted, so the public stop event stays deferred.

Install alongside one or more deferred(...)-wrapped detector strategies that drive on_user_turn_inference_triggered but leave finalization to this strategy. The aggregator’s deprecation path for filter_incomplete_user_turns does this rewiring automatically.

__init__(*, config: UserTurnCompletionConfig | None = None, **kwargs)[source]

Initialize the LLM turn-completion stop strategy.

Parameters:
  • config – Configuration applied to the LLM via the filter_incomplete_user_turns setting on StartFrame. Defaults to UserTurnCompletionConfig().

  • **kwargs – Additional keyword arguments forwarded to the base class.

property config: UserTurnCompletionConfig

Return the configured UserTurnCompletionConfig.

async process_frame(frame: Frame) ProcessFrameResult[source]

Configure the LLM on start and delegate completion handling to the base.