external_user_turn_stop_strategy

User turn stop strategy triggered by externally emitted frames.

class pipecat.turns.user_stop.external_user_turn_stop_strategy.ExternalUserTurnStopStrategy(*, timeout: float = 0.5, **kwargs)[source]

Bases: BaseUserTurnStopStrategy

User turn stop strategy controlled by an external processor.

This strategy does not determine when a user turn ends on its own, it relies on a different processor in the pipeline which is responsible for emitting UserStoppedSpeakingFrame frames.

__init__(*, timeout: float = 0.5, **kwargs)[source]

Initialize the external user turn stop strategy.

Parameters:
  • timeout – A short delay used internally to handle consecutive or slightly delayed transcriptions.

  • **kwargs – Additional keyword arguments.

async reset()[source]

Reset the strategy to its initial state.

async setup(task_manager: BaseTaskManager)[source]

Initialize the strategy with the given task manager.

Parameters:

task_manager – The task manager to be associated with this instance.

async cleanup()[source]

Cleanup the strategy.

async process_frame(frame: Frame) ProcessFrameResult[source]

Process an incoming frame to update strategy state.

Updates internal transcription text and VAD state. The user end turn will be triggered when appropriate based on the collected frames.

Parameters:

frame – The frame to be analyzed.

Returns:

Always returns CONTINUE so subsequent stop strategies are evaluated.