Make end call tool can be cancelled
This commit is contained in:
@@ -7,6 +7,7 @@ from typing import Any
|
||||
from pipecat.audio.turn.smart_turn.local_smart_turn_v3 import LocalSmartTurnAnalyzerV3
|
||||
from pipecat.audio.vad.silero import SileroVADAnalyzer
|
||||
from pipecat.audio.vad.vad_analyzer import VADParams
|
||||
from pipecat.frames.frames import TranscriptionFrame, VADUserStartedSpeakingFrame
|
||||
from pipecat.processors.aggregators.llm_context import LLMContext
|
||||
from pipecat.processors.aggregators.llm_response_universal import (
|
||||
LLMUserAggregator,
|
||||
@@ -100,6 +101,14 @@ def create_user_turn_strategies(
|
||||
return UserTurnStrategies(start=start, stop=stop)
|
||||
|
||||
|
||||
def is_configured_user_turn_start(frame, turn_config: dict[str, Any]) -> bool:
|
||||
"""Match the frame used by the configured barge-in start strategy."""
|
||||
barge_in = _section(turn_config, "barge_in", "bargeIn")
|
||||
if barge_in.get("strategy", "vad") == "transcription":
|
||||
return isinstance(frame, TranscriptionFrame) and bool(frame.text.strip())
|
||||
return isinstance(frame, VADUserStartedSpeakingFrame)
|
||||
|
||||
|
||||
class ConfigurableLLMUserAggregator(LLMUserAggregator):
|
||||
"""LLM user aggregator with one stable project-level runtime update API.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user