Make end call tool can be cancelled

This commit is contained in:
Xin Wang
2026-08-12 09:18:40 +08:00
parent fc026e765e
commit d0bb5b3868
15 changed files with 350 additions and 48 deletions

View File

@@ -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.