Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api-reference/server/frames/control-frames.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ Signals the beginning of a TTS audio response.
Identifier linking this TTS output to its originating context.
</ParamField>

<ParamField path="append_to_context" type="bool" default="True">
Whether the spoken text for this response will be appended to the LLM
context. When `True`, the assistant aggregator will track this output as an
assistant turn, firing `on_assistant_turn_started` and
`on_assistant_turn_stopped` events.
</ParamField>

### TTSStoppedFrame

Signals the end of a TTS audio response.
Expand Down
15 changes: 11 additions & 4 deletions api-reference/server/utilities/turn-management/turn-events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ async def on_assistant_turn_started(aggregator):
| ------------ | ------------------------ | --------------------------------- |
| `aggregator` | `LLMAssistantAggregator` | The assistant aggregator instance |

<Note>
This event fires for both LLM responses and `TTSSpeakFrame` utterances (when
`append_to_context=True`). For `TTSSpeakFrame` utterances, the event fires as
soon as the TTS service begins speaking.
</Note>

### on_assistant_turn_stopped

Fired when the assistant finishes responding or is interrupted. This event includes the complete assistant transcript for the turn.
Expand All @@ -218,10 +224,11 @@ async def on_assistant_turn_stopped(aggregator, message: AssistantTurnStoppedMes
| `message` | `AssistantTurnStoppedMessage` | Contains the assistant's transcript and metadata |

<Note>
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 an assistant turn ends: when an LLM response or
`TTSSpeakFrame` utterance 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).
</Note>

### on_assistant_thought
Expand Down
Loading