future-stone-69754
07/30/2025, 1:15 PMtall-airline-16756
07/30/2025, 1:16 PMtall-airline-16756
07/30/2025, 1:17 PMaudio_enabled=False in RoomOutputOptions and enable text input by setting text_enabled=True in RoomInputOptions.
• Read text streams: Text input is sent using TextStream to the lk.chat topic, and agent output is sent through TextStream to the lk.transcription topic. This allows you to process incoming text incrementally or as complete streams.
• Use text-only agents: LiveKit provides examples of text-only agents that skip voice entirely. You can configure them with options like room_input_options=RoomInputOptions(text_enabled=True, audio_enabled=False) and room_output_options=RoomOutputOptions(transcription_enabled=True, audio_enabled=False).
The text streams feature works across all LiveKit client SDKs and supports flexible text processing methods.
Sources: Text and transcriptions | LiveKit Docs | README.mdfuture-stone-69754
07/30/2025, 1:18 PMtall-airline-16756
07/30/2025, 1:20 PMasync def entrypoint(ctx: JobContext):
session = AgentSession(
llm=openai.LLM(model="gpt-4o-mini"),
# note that no TTS or STT are needed here
)
await session.start(
agent=MyAgent(),
room=ctx.room,
room_input_options=RoomInputOptions(text_enabled=True, audio_enabled=False),
room_output_options=RoomOutputOptions(transcription_enabled=True, audio_enabled=False),
)
Text Input and Output Flow
• Text Input: You'll receive text input using TextStream on the lk.chat topic.
• Text Output: Your agent will send responses through TextStream on the lk.transcription topic.
Think of it like your agent is always listening for messages on the lk.chat text stream and ready to chat back!
Configuration Options
• Want to go full text-only? Just set audio_enabled=False in RoomOutputOptions. Your agent will happily send text responses to the lk.transcription text stream topic.
• If you want to disable text input, you can set text_enabled=False in RoomInputOptions.
Alternative Input Methods
Got other ways to send text? No problem! You've got options:
• Send text input via: generate_reply(user_input="user's input text")
• Catch the agent's response with session.on("conversation_item_added", ev)
Event Handling
Want to stay in the loop? You can get notified whenever a text message comes in or goes out by listening to the conversation_item_added event.
This approach is super efficient – perfect for creating smooth, text-based AI conversations without any audio complexity. Pretty cool, right?
Sources: examples/other/chat-stream-receiver.py | Text and transcriptions | LiveKit Docsfuture-stone-69754
07/30/2025, 1:21 PMtall-airline-16756
07/30/2025, 1:22 PMlk.transcription topic, complete with sender details.
• Configuration Control: Want to turn off text output completely? No problem! Just set transcription_enabled=False in RoomOutputOptions.
Basically, LiveKit treats your text like a live, direct output stream - super flexible and powerful, without the need for audio synthesis. Pretty neat, right?
Sources: livekit-agents/livekit/agents/voice/agent_activity.py | Text and transcriptions | LiveKit Docs