Skip to main content

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 via UserTurnStoppedMessage
  • on_assistant_turn_stopped - Provides the assistant’s complete transcript via AssistantTurnStoppedMessage
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 on UserTurnStoppedMessage and AssistantTurnStoppedMessage fields, see Turn Events - Message Types.