Use TurnAnalyzerUserTurnStopStrategy as default stop strategy
Change the default user turn stop strategy from TranscriptionUserTurnStopStrategy to TurnAnalyzerUserTurnStopStrategy with LocalSmartTurnAnalyzerV3. Also reduce AUDIO_INPUT_TIMEOUT_SECS from 1.0 to 0.5 and remove its debug log.
This commit is contained in:
@@ -48,7 +48,7 @@ from pipecat.metrics.metrics import MetricsData
|
|||||||
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
|
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
|
||||||
from pipecat.transports.base_transport import TransportParams
|
from pipecat.transports.base_transport import TransportParams
|
||||||
|
|
||||||
AUDIO_INPUT_TIMEOUT_SECS = 1.0
|
AUDIO_INPUT_TIMEOUT_SECS = 0.5
|
||||||
|
|
||||||
|
|
||||||
class BaseInputTransport(FrameProcessor):
|
class BaseInputTransport(FrameProcessor):
|
||||||
@@ -449,8 +449,6 @@ class BaseInputTransport(FrameProcessor):
|
|||||||
if not audio_received:
|
if not audio_received:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logger.debug(f"{self}: audio not received for more than {AUDIO_INPUT_TIMEOUT_SECS}")
|
|
||||||
|
|
||||||
###################################################################
|
###################################################################
|
||||||
# DEPRECATED.
|
# DEPRECATED.
|
||||||
if self._user_speaking:
|
if self._user_speaking:
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
|
from pipecat.audio.turn.smart_turn.local_smart_turn_v3 import LocalSmartTurnAnalyzerV3
|
||||||
from pipecat.turns.user_start import (
|
from pipecat.turns.user_start import (
|
||||||
BaseUserTurnStartStrategy,
|
BaseUserTurnStartStrategy,
|
||||||
ExternalUserTurnStartStrategy,
|
ExternalUserTurnStartStrategy,
|
||||||
@@ -18,7 +19,7 @@ from pipecat.turns.user_start import (
|
|||||||
from pipecat.turns.user_stop import (
|
from pipecat.turns.user_stop import (
|
||||||
BaseUserTurnStopStrategy,
|
BaseUserTurnStopStrategy,
|
||||||
ExternalUserTurnStopStrategy,
|
ExternalUserTurnStopStrategy,
|
||||||
TranscriptionUserTurnStopStrategy,
|
TurnAnalyzerUserTurnStopStrategy,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ class UserTurnStrategies:
|
|||||||
If no strategies are specified, the following defaults are used:
|
If no strategies are specified, the following defaults are used:
|
||||||
|
|
||||||
start: [VADUserTurnStartStrategy, TranscriptionUserTurnStartStrategy]
|
start: [VADUserTurnStartStrategy, TranscriptionUserTurnStartStrategy]
|
||||||
stop: [TranscriptionUserTurnStopStrategy]
|
stop: [TurnAnalyzerUserTurnStopStrategy(LocalSmartTurnAnalyzerV3)]
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
start: A list of user turn start strategies used to detect when
|
start: A list of user turn start strategies used to detect when
|
||||||
@@ -46,7 +47,7 @@ class UserTurnStrategies:
|
|||||||
if not self.start:
|
if not self.start:
|
||||||
self.start = [VADUserTurnStartStrategy(), TranscriptionUserTurnStartStrategy()]
|
self.start = [VADUserTurnStartStrategy(), TranscriptionUserTurnStartStrategy()]
|
||||||
if not self.stop:
|
if not self.stop:
|
||||||
self.stop = [TranscriptionUserTurnStopStrategy()]
|
self.stop = [TurnAnalyzerUserTurnStopStrategy(turn_analyzer=LocalSmartTurnAnalyzerV3())]
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
Reference in New Issue
Block a user