From 5d775a35cf60fd8dd488333c465ae23b386114f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 4 May 2026 22:15:01 +0000 Subject: [PATCH] docs: update for pipecat PR #4414 Update turn event documentation to reflect that on_assistant_turn_stopped now fires for TTSSpeakFrame(append_to_context=True) greetings, not just LLM-generated responses. - Updated turn-events.mdx to clarify when on_assistant_turn_stopped fires - Added note in text-to-speech.mdx explaining turn event behavior for append_to_context=True frames --- .../server/utilities/turn-management/turn-events.mdx | 9 +++++---- pipecat/learn/text-to-speech.mdx | 7 +++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/api-reference/server/utilities/turn-management/turn-events.mdx b/api-reference/server/utilities/turn-management/turn-events.mdx index 1c5d8dde..9f269775 100644 --- a/api-reference/server/utilities/turn-management/turn-events.mdx +++ b/api-reference/server/utilities/turn-management/turn-events.mdx @@ -193,10 +193,11 @@ async def on_assistant_turn_stopped(aggregator, message: AssistantTurnStoppedMes | `message` | `AssistantTurnStoppedMessage` | Contains the assistant's transcript and metadata | - This event fires when the LLM response completes, when the user interrupts, or - when a user image is appended to context. The event always fires when a turn - ends, even if `content` is empty (e.g., the turn was interrupted before any - tokens were generated). + This event fires when the LLM response completes, when the user interrupts, + when a user image is appended to context, or when a + `TTSSpeakFrame(append_to_context=True)` greeting finishes. The event always + fires when a turn ends, even if `content` is empty (e.g., the turn was + interrupted before any tokens were generated). ### on_assistant_thought diff --git a/pipecat/learn/text-to-speech.mdx b/pipecat/learn/text-to-speech.mdx index 15775bbe..d5d6953c 100644 --- a/pipecat/learn/text-to-speech.mdx +++ b/pipecat/learn/text-to-speech.mdx @@ -330,6 +330,13 @@ await tts.queue_frame( The `append_to_context` parameter controls whether the spoken text is added to the conversation history. When `append_to_context=True`, the text is automatically committed to the context after being spoken, making it useful for bot greetings and injected speech that should be part of the conversation flow. + + When using `append_to_context=True`, the assistant aggregator's + `on_assistant_turn_started` and `on_assistant_turn_stopped` events will fire, + allowing you to capture the greeting text in your turn event handlers just like + LLM-generated responses. See [Turn Events](/api-reference/server/utilities/turn-management/turn-events) for details. + + ### Dynamic Settings Updates Update TTS settings during conversation using typed settings objects: