Skip to main content

Overview

User mute strategies control whether incoming user input should be suppressed based on the current system state. They determine when user audio and transcriptions should be muted to prevent interruptions during critical bot operations like initial responses or function calls. By default, user input is never muted. You can configure mute strategies to automatically suppress user input in specific scenarios, such as while the bot is speaking or during function execution. Custom strategies can also be implemented for specific use cases.

Configuration

User mute strategies are configured via LLMUserAggregatorParams when creating an LLMContextAggregatorPair:

Available Strategies

AlwaysUserMuteStrategy

Mutes user input whenever the bot is speaking. This prevents any interruptions during bot speech.
Behavior:
  • Mutes when BotStartedSpeakingFrame is received
  • Unmutes when BotStoppedSpeakingFrame is received

FirstSpeechUserMuteStrategy

Mutes user input only during the bot’s first speech. After the initial response completes, user input is allowed even while the bot is speaking.
Behavior:
  • Allows user input before bot speaks
  • Mutes during the first bot speech only
  • Unmutes permanently after first speech completes
Use this strategy when you want to ensure the bot’s greeting or initial response isn’t interrupted, but allow normal interruptions afterward.

MuteUntilFirstBotCompleteUserMuteStrategy

Mutes user input from the start of the interaction until the bot completes its first speech. This ensures the bot maintains full control at the beginning of a conversation.
Behavior:
  • Mutes immediately when the pipeline starts (before bot speaks)
  • Remains muted until first BotStoppedSpeakingFrame is received
  • Unmutes permanently after first speech completes
Unlike FirstSpeechUserMuteStrategy, this strategy mutes user input even before the bot starts speaking. Use this when you don’t want to process any user input until the bot has delivered its initial message.

FunctionCallUserMuteStrategy

Mutes user input while function calls are executing. This prevents user interruptions during potentially long-running tool operations.
Behavior:
  • Mutes when FunctionCallsStartedFrame is received
  • Tracks multiple concurrent function calls
  • Unmutes when all function calls complete (via FunctionCallResultFrame or FunctionCallCancelFrame)
This strategy is particularly useful when function calls trigger external API requests or database operations that may take several seconds to complete and you don’t want to the user to interrupt the output.

Combining Multiple Strategies

Multiple strategies can be combined in a list. The strategies are combined with OR logic—if any strategy indicates the user should be muted, user input is suppressed.
In this example, user input is muted:
  • From pipeline start until the bot completes its first speech
  • Whenever function calls are executing (even after first speech)

Usage Examples

Prevent Interruptions During Greeting

Ensure the bot’s greeting plays completely before accepting user input:

Mute During Function Calls Only

Allow normal interruptions but prevent them during tool execution:

Never Allow Interruptions

Always mute user input while the bot is speaking:

Building Custom Strategies

For custom mute strategies, see the User Input Muting guide, which covers the BaseUserMuteStrategy contract, frame visibility, and worked examples.

Event Handlers

You can register event handlers to be notified when user muting starts or stops. This is useful for observability or providing feedback to users.

Available Events

on_user_mute_started

Called when user input becomes muted due to any active mute strategy.

on_user_mute_stopped

Called when user input is unmuted (no active mute strategies).
These events fire whenever the mute state changes, regardless of which strategy triggered the change. Use them to provide consistent feedback across all mute scenarios.