high-thailand-80385
06/06/2025, 7:04 AMtall-airline-16756
06/06/2025, 7:04 AMtall-airline-16756
06/06/2025, 7:04 AMroom.registerTextStreamHandler('lk.transcription', async (reader, participantInfo) => {
const message = await reader.readAll();
if (reader.info.attributes['lk.transcribed_track_id']) {
console.log(`New transcription from ${participantInfo.identity}: ${message}`);
} else {
console.log(`New message from ${participantInfo.identity}: ${message}`);
}
});
On the backend, you can configure a text-only agent by setting audio_enabled=False in the RoomOutputOptions. The agent will then publish text responses to the lk.transcription text stream topic:
session = AgentSession(
..., # STT, LLM, etc.
room_output_options=RoomOutputOptions(
audio_enabled=False # disable audio output
)
)
Let me know if you need further assistance! Sources: Text and transcriptions | LiveKit Docs