little-king-41579
05/21/2026, 10:41 AMtall-airline-16756
05/21/2026, 10:41 AMtall-airline-16756
05/21/2026, 10:41 AMlk.transcription text stream topic (received with registerTextStreamHandler), and standard flows expect transcriptions to originate from the STT/AgentSession pipeline. There isn’t a documented API to inject arbitrary custom transcription events into that transcription stream directly.
Options you can use instead:
• Use LiveKit data messages to send custom transcription-like events from your server/app to clients. Data messages are flexible and commonly used to transmit agent state, chat text, or synthetic transcription events. Use the client’s data message handlers to display them in your chat UI.
• If you must integrate with the built-in transcription stream for sync with audio playback, run your custom text through the AgentSession/STT pipeline or the transcription_node so it’s emitted as part of the transcription flow (the docs show transcription_node can modify agent-generated transcriptions, not create independent events).
Quick questions to narrow the best approach:
• Do you need those events synchronized with audio playback (so they must appear on lk.transcription) or is sending them as chat messages sufficient?
• Are the custom transcriptions coming from a bot/service on your server, or from client-side logic?
Tell me which option you prefer and where the text originates, and I’ll give exact code snippets for either data messages (server + JS client) or the recommended approach to surface text through the transcription pipeline.
Sources: Text and transcriptions | LiveKit Documentation | Live conversations with AI using ChatGPT and WebRTC | LiveKit, with interactive elementslittle-king-41579
05/21/2026, 10:42 AMtall-airline-16756
05/21/2026, 10:42 AMlk.transcription) using an AgentSession helper, and (B) publish a data message directly (flexible and commonly used). Use whichever fits your architecture.
A — Send on lk.transcription (AgentSession)
# Requires livekit agents SDK and an active AgentSession (session)
async def send_custom_transcription(session, text, final=True):
"""
Send custom transcription-like text to frontend on lk.transcription.
`session` is an AgentSession with .output.add_text available.
"""
await session.output.add_text(text, topic="lk.transcription", final=final)
B — Publish a data message (server/app -> clients)
from livekit.agents import proto as agents_proto
# Requires an AgentSession (session) or other publisher that exposes publish_data
async def publish_data_message(session, text):
await session.output.publish_data(
data=text.encode("utf-8"),
kind=agents_proto.DataPacket.Kind.RELIABLE,
topic="lk.transcription" # or any custom topic you consume on client
)
Which method do you want code for next — full example with session setup, or a JS client snippet to receive and display these messages?
Sources: Text and transcriptions | LiveKit Documentation, with interactive elements