base_user_mute_strategy

Base strategy for deciding whether user frames should be muted.

class pipecat.turns.user_mute.base_user_mute_strategy.BaseUserMuteStrategy(**kwargs)[source]

Bases: BaseObject

Base class for strategies that decide whether user frames should be muted.

A user mute strategy determines whether incoming user frames should be suppressed based on the current system state.

Typical heuristics include: - The bot is currently speaking, so user should be muted - A function call or tool execution is in progress - The system is otherwise not ready to accept user input

The strategy is evaluated per frame and returns a boolean indicating whether the user should be muted.

__init__(**kwargs)[source]

Initialize the base user mute strategy.

property task_manager: BaseTaskManager

Returns the configured task manager.

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) bool[source]

Process an incoming frame.

Parameters:

frame – The frame to be processed.

Returns:

Whether the strategy is muted.