better-painter-56211
09/16/2025, 9:35 AMtall-airline-16756
09/16/2025, 9:35 AMtall-airline-16756
09/16/2025, 9:35 AMlk.transcription_final attribute helps us know if a transcription update is final or just interim. If you’re seeing it always as false, a few things might be going on:
• The agent might not be sending a final transcription update after the speech ends. It’s important to make sure the agent calls writer.aclose() with lk.transcription_final = "true" when the speech finishes.
• The frontend might not be interpreting the attribute correctly. Double-check that it’s looking for the string value "true" rather than treating it as a boolean directly.
• The STT engine or plugin might not be emitting final events like END_OF_SPEECH or FINAL_TRANSCRIPT.
To help fix this, please review your agent’s logic for handling final transcriptions, ensure the frontend parses the attribute properly, and confirm your STT engine is set up to emit those final events. If you’d like, I’m here to help you go over your agent code or assist with debugging—just let me know!
Sources: Events and error handling | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_activity.py | Events and error handling | LiveKit Docs | Sources/LiveKit/Types/TranscriptionSegment.swift | lib/src/types/attribute_typings.dartbetter-painter-56211
09/16/2025, 4:17 PMtall-airline-16756
09/16/2025, 4:18 PMlk.segment_id attribute from the text stream's attributes. Here's a simple example in Python using the LiveKit Agents SDK to guide you through it:
from livekit.agents.types import ATTRIBUTE_TRANSCRIPTION_SEGMENT_ID
async def on_text_received(reader: rtc.TextStreamReader, participant_identity: str):
segment_id = reader.info.attributes.get(ATTRIBUTE_TRANSCRIPTION_SEGMENT_ID, None)
if segment_id:
# Handle the segment ID
pass
This segment ID is unique for each transcription segment and is great for correlating updates. If you have any questions or need a hand with anything else, please feel free to ask—I’m here to support you!
Sources: examples/other/chat-stream-receiver.py | VoiceAgent/Chat/Receive/TranscriptionStreamReceiver.swift | Transcriptions | LiveKit Docs | livekit/livekit_models.pb.gobetter-painter-56211
09/16/2025, 4:29 PMtall-airline-16756
09/16/2025, 4:30 PMlk.transcription events the way the frontend does. Instead, the agent sends transcription data through text streams, and the frontend or client needs to actively subscribe to the lk.transcription text stream topic to get those updates.
If you’re not seeing these events on the agent’s side, here are a few things to check:
• Make sure you’re not using outdated events like RoomEvent.TranscriptionReceived. Switching to text streams is the way to go.
• Confirm that the frontend or client is subscribed to the lk.transcription topic.
• If audio output is turned off, you’ll want to set up a custom receiver to listen to the lk.transcription text stream topic.
• On the agent side, keep an eye on the conversation_item_added event to know when text input or output gets added to the chat history.
Please feel free to reach out if you’d like a hand setting up the right subscription or if you want to troubleshoot this further—I’m here to help!
Sources: How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents | Agents 0.x migration guide | LiveKit Docs | Agents v0.x migration guide - Node.js | LiveKit Docs | Text and transcriptions | LiveKit Docs | Text and transcriptions | LiveKit Docsbetter-painter-56211
09/16/2025, 4:41 PMtall-airline-16756
09/16/2025, 4:41 PMchat-stream-receiver.py example might be having some trouble, and that can happen for a few reasons. Let’s walk through some things to check together:
• First, please make sure the LIVEKIT_URL environment variable is set up correctly.
• When you run the script, don’t forget to provide a room name as a command-line argument.
• Also, double-check that the sender is publishing text to the right topic, which should be lk.transcription for agent output.
• It’s important that the sender includes necessary attributes like segment_id in the text stream.
• And if you’re testing with the playground UI, just a heads-up: it doesn’t support text-only agent responses sent to lk.transcription.
If you’d like, I’m here to help you verify your setup or troubleshoot any other issues you might be facing. Just let me know!
Sources: examples/voice_agents/README.md | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents