Overview
Pipecat provides a straightforward way to collect conversation transcriptions using turn events. When a user or assistant turn ends, the corresponding event includes the complete transcript for that turn. The key events for transcription collection are:on_user_turn_stopped- Provides the user’s complete transcript viaUserTurnStoppedMessageon_assistant_turn_stopped- Provides the assistant’s complete transcript viaAssistantTurnStoppedMessage
The examples below assume a cascade (STT → LLM → TTS) pipeline. With a realtime
(speech-to-speech) service and
LLMContextAggregatorPair(context, realtime_service_mode=True), collect the
user transcript from
on_user_turn_message_added
instead — in that mode UserTurnStoppedMessage.content is None.Basic Example
Saving Transcripts to a File
Sending Transcripts to an External Service
Message Types
For details onUserTurnStoppedMessage and AssistantTurnStoppedMessage fields, see Turn Events - Message Types.
Related
- Turn Events - Complete reference for turn lifecycle events
- Saving Transcripts Guide - Guide for saving conversation transcripts