From 47d232dab52f18664952ce289b3e773388a6c2dc Mon Sep 17 00:00:00 2001 From: James Hush Date: Mon, 11 Aug 2025 14:02:16 +0800 Subject: [PATCH] Call ends but not TTSSpeak? --- examples/foundational/balboa.py | 22 ++++------------------ pyproject.toml | 1 + 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/examples/foundational/balboa.py b/examples/foundational/balboa.py index 28ec60ab8..994437ac5 100644 --- a/examples/foundational/balboa.py +++ b/examples/foundational/balboa.py @@ -615,25 +615,11 @@ async def run_bot(room_url: str, token: str, body: dict) -> None: # Generate voicemail message message = "Hello, this is a message for Pipecat example user. This is Chatbot. Please call back on 123-456-7891. Thank you." logger.info(f"🎤 SENDING VOICEMAIL MESSAGE: {message}") - await voicemail_tts.queue_frame(TTSSpeakFrame(text=message)) + await params.llm.push_frame(TTSSpeakFrame(text=message)) - logger.warning( - f"đŸ“Šī¸ EndTaskFrame upstream routing seems blocked - using direct EndFrame approach" - ) - # Direct approach: Send EndFrame directly to the pipeline task - # This bypasses the complex ParallelPipeline routing that seems to be blocking EndTaskFrame - await pipeline_task.queue_frame(EndFrame()) - logger.warning(f"đŸ“Šī¸ EndFrame sent directly to pipeline task") - # await pipeline_task.cancel() - - # logger.debug(f"đŸ“Šī¸ Pushing EndTaskFrame") - # await voicemail_tts.queue_frame(EndTaskFrame(), FrameDirection.UPSTREAM) - # logger.debug(f"đŸ“Šī¸ Pushing CancelTaskFrame") - # await voicemail_tts.queue_frame(CancelTaskFrame(), FrameDirection.UPSTREAM) - # logger.debug(f"đŸ“Šī¸ Pushing both") - - # await pipeline_task.queue_frames([EndTaskFrame(), CancelTaskFrame()]) - await params.result_callback({"confidence": f"{confidence}", "reasoning": reasoning}) + # Following the official Pipecat docs: "From inside the pipeline, push upstream to reach the source" + logger.warning(f"đŸ“Šī¸ Using correct pattern: EndTaskFrame upstream from function call") + await params.llm.push_frame(EndTaskFrame(), FrameDirection.UPSTREAM) await params.result_callback({"confidence": f"{confidence}", "reasoning": reasoning}) diff --git a/pyproject.toml b/pyproject.toml index 6d20e5e4f..80db8d1c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ dependencies = [ "openai>=1.74.0,<=1.99.1", # Pinning numba to resolve package dependencies "numba==0.61.2", + "pipecat-ai-flows>=0.0.18", ] [project.urls]