to enable transcrptions so that the messages are d...
# ask-ai
l
to enable transcrptions so that the messages are displayed in my custom frontend, is this session = AgentSession(publish_transcription=True) the correct format? or how to subscribe to transcrptions?
t
Thanks for reaching out, Computer. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd be happy to help you enable transcriptions and display them in your custom frontend! Here’s a simple step-by-step guide to get you started: 1. First, make sure transcriptions are enabled in the backend. Usually, they are enabled by default in
AgentSession
, but it’s good to double-check that
transcription_enabled
isn’t set to
False
in
RoomOutputOptions
. 2. Next, in your frontend, you’ll want to subscribe to the
TranscriptionReceived
event using the LiveKit client SDK. This event will give you transcription segments with details like
id
,
text
, and
language
. 3. To tell the difference between interim (real-time) and final transcription segments, keep an eye on the
lk.transcription_final
metadata. 4. Finally, to actually show the transcriptions, set up a listener for the
RoomEvent.TranscriptionReceived
event. For example, if you’re using React, you can create a custom hook to handle transcription updates and display them nicely in your UI. If you’d like, I can also share some code examples or dive deeper into any of these steps—just let me know! I’m here to help you every step of the way. Sources: hooks/use-transcriber.ts | complex-agents/note-taking-assistant/README.md | client/web/src/components/captions.tsx | Cartesia TTS plugin guide | LiveKit Docs | ElevenLabs TTS plugin guide | LiveKit Docs