turns: move mute to user_mute
This commit is contained in:
1
changelog/3479.deprecated.md
Normal file
1
changelog/3479.deprecated.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- For consistency with other package names, we just deprecated `pipecat.turns.mute` (introduced in Pipecat 0.0.99) in favor of `pipecat.turns.user_mute`.
|
||||||
@@ -34,7 +34,7 @@ from pipecat.services.openai.llm import OpenAILLMService
|
|||||||
from pipecat.transports.base_transport import BaseTransport, TransportParams
|
from pipecat.transports.base_transport import BaseTransport, TransportParams
|
||||||
from pipecat.transports.daily.transport import DailyParams
|
from pipecat.transports.daily.transport import DailyParams
|
||||||
from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams
|
from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams
|
||||||
from pipecat.turns.mute import (
|
from pipecat.turns.user_mute import (
|
||||||
FunctionCallUserMuteStrategy,
|
FunctionCallUserMuteStrategy,
|
||||||
MuteUntilFirstBotCompleteUserMuteStrategy,
|
MuteUntilFirstBotCompleteUserMuteStrategy,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ from pipecat.processors.aggregators.llm_context import (
|
|||||||
NotGiven,
|
NotGiven,
|
||||||
)
|
)
|
||||||
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
|
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
|
||||||
from pipecat.turns.mute import BaseUserMuteStrategy
|
from pipecat.turns.user_mute import BaseUserMuteStrategy
|
||||||
from pipecat.turns.user_start import BaseUserTurnStartStrategy, UserTurnStartedParams
|
from pipecat.turns.user_start import BaseUserTurnStartStrategy, UserTurnStartedParams
|
||||||
from pipecat.turns.user_stop import BaseUserTurnStopStrategy, UserTurnStoppedParams
|
from pipecat.turns.user_stop import BaseUserTurnStopStrategy, UserTurnStoppedParams
|
||||||
from pipecat.turns.user_turn_controller import UserTurnController
|
from pipecat.turns.user_turn_controller import UserTurnController
|
||||||
|
|||||||
@@ -4,10 +4,21 @@
|
|||||||
# SPDX-License-Identifier: BSD 2-Clause License
|
# SPDX-License-Identifier: BSD 2-Clause License
|
||||||
#
|
#
|
||||||
|
|
||||||
from pipecat.turns.mute.always_user_mute_strategy import AlwaysUserMuteStrategy
|
import warnings
|
||||||
from pipecat.turns.mute.base_user_mute_strategy import BaseUserMuteStrategy
|
|
||||||
from pipecat.turns.mute.first_speech_user_mute_strategy import FirstSpeechUserMuteStrategy
|
from pipecat.turns.user_mute.always_user_mute_strategy import AlwaysUserMuteStrategy
|
||||||
from pipecat.turns.mute.function_call_user_mute_strategy import FunctionCallUserMuteStrategy
|
from pipecat.turns.user_mute.base_user_mute_strategy import BaseUserMuteStrategy
|
||||||
from pipecat.turns.mute.mute_until_first_bot_complete_user_mute_strategy import (
|
from pipecat.turns.user_mute.first_speech_user_mute_strategy import FirstSpeechUserMuteStrategy
|
||||||
|
from pipecat.turns.user_mute.function_call_user_mute_strategy import FunctionCallUserMuteStrategy
|
||||||
|
from pipecat.turns.user_mute.mute_until_first_bot_complete_user_mute_strategy import (
|
||||||
MuteUntilFirstBotCompleteUserMuteStrategy,
|
MuteUntilFirstBotCompleteUserMuteStrategy,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("always")
|
||||||
|
warnings.warn(
|
||||||
|
"Types in pipecat.turns.mute are deprecated. "
|
||||||
|
"Please use the equivalent types from pipecat.turns.user_mute instead.",
|
||||||
|
DeprecationWarning,
|
||||||
|
stacklevel=2,
|
||||||
|
)
|
||||||
|
|||||||
21
src/pipecat/turns/user_mute/__init__.py
Normal file
21
src/pipecat/turns/user_mute/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2024-2026, Daily
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: BSD 2-Clause License
|
||||||
|
#
|
||||||
|
|
||||||
|
from .always_user_mute_strategy import AlwaysUserMuteStrategy
|
||||||
|
from .base_user_mute_strategy import BaseUserMuteStrategy
|
||||||
|
from .first_speech_user_mute_strategy import FirstSpeechUserMuteStrategy
|
||||||
|
from .function_call_user_mute_strategy import FunctionCallUserMuteStrategy
|
||||||
|
from .mute_until_first_bot_complete_user_mute_strategy import (
|
||||||
|
MuteUntilFirstBotCompleteUserMuteStrategy,
|
||||||
|
)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"AlwaysUserMuteStrategy",
|
||||||
|
"BaseUserMuteStrategy",
|
||||||
|
"FirstSpeechUserMuteStrategy",
|
||||||
|
"FunctionCallUserMuteStrategy",
|
||||||
|
"MuteUntilFirstBotCompleteUserMuteStrategy",
|
||||||
|
]
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
"""User mute strategy that always mutes the user while the bot is speaking."""
|
"""User mute strategy that always mutes the user while the bot is speaking."""
|
||||||
|
|
||||||
from pipecat.frames.frames import BotStartedSpeakingFrame, BotStoppedSpeakingFrame, Frame
|
from pipecat.frames.frames import BotStartedSpeakingFrame, BotStoppedSpeakingFrame, Frame
|
||||||
from pipecat.turns.mute.base_user_mute_strategy import BaseUserMuteStrategy
|
from pipecat.turns.user_mute.base_user_mute_strategy import BaseUserMuteStrategy
|
||||||
|
|
||||||
|
|
||||||
class AlwaysUserMuteStrategy(BaseUserMuteStrategy):
|
class AlwaysUserMuteStrategy(BaseUserMuteStrategy):
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
"""User mute strategy that mutes the user only during the bot’s first speech."""
|
"""User mute strategy that mutes the user only during the bot’s first speech."""
|
||||||
|
|
||||||
from pipecat.frames.frames import BotStartedSpeakingFrame, BotStoppedSpeakingFrame, Frame
|
from pipecat.frames.frames import BotStartedSpeakingFrame, BotStoppedSpeakingFrame, Frame
|
||||||
from pipecat.turns.mute.base_user_mute_strategy import BaseUserMuteStrategy
|
from pipecat.turns.user_mute.base_user_mute_strategy import BaseUserMuteStrategy
|
||||||
|
|
||||||
|
|
||||||
class FirstSpeechUserMuteStrategy(BaseUserMuteStrategy):
|
class FirstSpeechUserMuteStrategy(BaseUserMuteStrategy):
|
||||||
@@ -14,7 +14,7 @@ from pipecat.frames.frames import (
|
|||||||
FunctionCallResultFrame,
|
FunctionCallResultFrame,
|
||||||
FunctionCallsStartedFrame,
|
FunctionCallsStartedFrame,
|
||||||
)
|
)
|
||||||
from pipecat.turns.mute.base_user_mute_strategy import BaseUserMuteStrategy
|
from pipecat.turns.user_mute.base_user_mute_strategy import BaseUserMuteStrategy
|
||||||
|
|
||||||
|
|
||||||
class FunctionCallUserMuteStrategy(BaseUserMuteStrategy):
|
class FunctionCallUserMuteStrategy(BaseUserMuteStrategy):
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
"""User mute strategy that mutes the user until the bot completes its first speech."""
|
"""User mute strategy that mutes the user until the bot completes its first speech."""
|
||||||
|
|
||||||
from pipecat.frames.frames import BotStoppedSpeakingFrame, Frame
|
from pipecat.frames.frames import BotStoppedSpeakingFrame, Frame
|
||||||
from pipecat.turns.mute.base_user_mute_strategy import BaseUserMuteStrategy
|
from pipecat.turns.user_mute.base_user_mute_strategy import BaseUserMuteStrategy
|
||||||
|
|
||||||
|
|
||||||
class MuteUntilFirstBotCompleteUserMuteStrategy(BaseUserMuteStrategy):
|
class MuteUntilFirstBotCompleteUserMuteStrategy(BaseUserMuteStrategy):
|
||||||
@@ -4,15 +4,17 @@
|
|||||||
# SPDX-License-Identifier: BSD 2-Clause License
|
# SPDX-License-Identifier: BSD 2-Clause License
|
||||||
#
|
#
|
||||||
|
|
||||||
from pipecat.turns.user_start.base_user_turn_start_strategy import (
|
from .base_user_turn_start_strategy import BaseUserTurnStartStrategy, UserTurnStartedParams
|
||||||
BaseUserTurnStartStrategy,
|
from .external_user_turn_start_strategy import ExternalUserTurnStartStrategy
|
||||||
UserTurnStartedParams,
|
from .min_words_user_turn_start_strategy import MinWordsUserTurnStartStrategy
|
||||||
)
|
from .transcription_user_turn_start_strategy import TranscriptionUserTurnStartStrategy
|
||||||
from pipecat.turns.user_start.external_user_turn_start_strategy import ExternalUserTurnStartStrategy
|
from .vad_user_turn_start_strategy import VADUserTurnStartStrategy
|
||||||
from pipecat.turns.user_start.min_words_user_turn_start_strategy import (
|
|
||||||
MinWordsUserTurnStartStrategy,
|
__all__ = [
|
||||||
)
|
"BaseUserTurnStartStrategy",
|
||||||
from pipecat.turns.user_start.transcription_user_turn_start_strategy import (
|
"ExternalUserTurnStartStrategy",
|
||||||
TranscriptionUserTurnStartStrategy,
|
"MinWordsUserTurnStartStrategy",
|
||||||
)
|
"TranscriptionUserTurnStartStrategy",
|
||||||
from pipecat.turns.user_start.vad_user_turn_start_strategy import VADUserTurnStartStrategy
|
"UserTurnStartedParams",
|
||||||
|
"VADUserTurnStartStrategy",
|
||||||
|
]
|
||||||
|
|||||||
@@ -4,14 +4,15 @@
|
|||||||
# SPDX-License-Identifier: BSD 2-Clause License
|
# SPDX-License-Identifier: BSD 2-Clause License
|
||||||
#
|
#
|
||||||
|
|
||||||
from pipecat.turns.user_stop.base_user_turn_stop_strategy import (
|
from .base_user_turn_stop_strategy import BaseUserTurnStopStrategy, UserTurnStoppedParams
|
||||||
BaseUserTurnStopStrategy,
|
from .external_user_turn_stop_strategy import ExternalUserTurnStopStrategy
|
||||||
UserTurnStoppedParams,
|
from .transcription_user_turn_stop_strategy import TranscriptionUserTurnStopStrategy
|
||||||
)
|
from .turn_analyzer_user_turn_stop_strategy import TurnAnalyzerUserTurnStopStrategy
|
||||||
from pipecat.turns.user_stop.external_user_turn_stop_strategy import ExternalUserTurnStopStrategy
|
|
||||||
from pipecat.turns.user_stop.transcription_user_turn_stop_strategy import (
|
__all__ = [
|
||||||
TranscriptionUserTurnStopStrategy,
|
"BaseUserTurnStopStrategy",
|
||||||
)
|
"ExternalUserTurnStopStrategy",
|
||||||
from pipecat.turns.user_stop.turn_analyzer_user_turn_stop_strategy import (
|
"UserTurnStoppedParams",
|
||||||
TurnAnalyzerUserTurnStopStrategy,
|
"TranscriptionUserTurnStopStrategy",
|
||||||
)
|
"TurnAnalyzerUserTurnStopStrategy",
|
||||||
|
]
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ from pipecat.processors.aggregators.llm_response_universal import (
|
|||||||
LLMUserAggregatorParams,
|
LLMUserAggregatorParams,
|
||||||
)
|
)
|
||||||
from pipecat.tests.utils import SleepFrame, run_test
|
from pipecat.tests.utils import SleepFrame, run_test
|
||||||
from pipecat.turns.mute import FirstSpeechUserMuteStrategy, FunctionCallUserMuteStrategy
|
from pipecat.turns.user_mute import FirstSpeechUserMuteStrategy, FunctionCallUserMuteStrategy
|
||||||
from pipecat.turns.user_stop import TranscriptionUserTurnStopStrategy
|
from pipecat.turns.user_stop import TranscriptionUserTurnStopStrategy
|
||||||
from pipecat.turns.user_turn_strategies import UserTurnStrategies
|
from pipecat.turns.user_turn_strategies import UserTurnStrategies
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from pipecat.frames.frames import (
|
|||||||
FunctionCallsStartedFrame,
|
FunctionCallsStartedFrame,
|
||||||
InterruptionFrame,
|
InterruptionFrame,
|
||||||
)
|
)
|
||||||
from pipecat.turns.mute import (
|
from pipecat.turns.user_mute import (
|
||||||
AlwaysUserMuteStrategy,
|
AlwaysUserMuteStrategy,
|
||||||
FirstSpeechUserMuteStrategy,
|
FirstSpeechUserMuteStrategy,
|
||||||
FunctionCallUserMuteStrategy,
|
FunctionCallUserMuteStrategy,
|
||||||
|
|||||||
Reference in New Issue
Block a user