crooked-dawn-90821
12/02/2025, 5:15 PMtall-airline-16756
12/02/2025, 5:15 PMtall-airline-16756
12/02/2025, 5:15 PMfrom livekit.agents import AgentSession
from livekit.agents.voice import room_io
session = AgentSession(...)
await session.start(
agent=my_agent,
room=ctx.room,
room_options=room_io.RoomOptions(
audio_input=False,
audio_output=False,
),
)
• Node.js:
import { voice } from '@livekit/agents';
const session = new voice.AgentSession({...});
await session.start({
agent,
room: ctx.room,
inputOptions: { audioEnabled: false },
outputOptions: { audioEnabled: false },
});
2) Send text input
• Clients send text on the lk.chat topic:
await room.localParticipant.sendText("Hello", { topic: 'lk.chat' });
• You can add a text_input_cb (TextInputOptions) to filter or preprocess incoming chat messages before the agent handles them.
3) Receive text output
• With audio disabled, the agent replies via the lk.transcription text stream (no audio track or STT/TTS used).
• Client example to read responses:
room.registerTextStreamHandler('lk.transcription', async (reader, participant) => {
const text = await reader.readAll();
console.log('Agent response:', text);
});
Summary
• Turn off audio input/output in your session options.
• Send user messages to lk.chat.
• Read agent replies from lk.transcription.
Would you like a minimal working example for your language (Python or Node.js) or help adding message filtering/commands?
Sources: Text and transcriptions | LiveKit docs | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agentscrooked-dawn-90821
12/02/2025, 5:41 PMtall-airline-16756
12/02/2025, 5:42 PMlk.chat and sends replies on lk.transcription. Replace placeholders (API keys, room, agent) with your values.
Python (async):
import asyncio
from livekit.agents import AgentSession
from livekit.agents.voice import room_io
# import or define your agent instance as `my_agent`
# from my_agent_module import my_agent
async def main():
session = AgentSession() # configure your agent as needed
await session.start(
agent=my_agent,
room="your-room-name-or-object",
room_options=room_io.RoomOptions(
audio_input=False,
audio_output=False,
),
)
print("Text-only agent session started. Waiting for messages...")
# keep running
await asyncio.Event().wait()
if __name__ == "__main__":
asyncio.run(main())
Client-side (send text to lk.chat):
// in your web client using LiveKit SDK
await room.localParticipant.sendText("Hello agent", { topic: 'lk.chat' });
Listen for agent replies (client):
room.registerTextStreamHandler('lk.transcription', async (reader, participant) => {
const reply = await reader.readAll();
console.log('Agent reply:', reply);
});
Node.js (server-side session):
import { voice } from '@livekit/agents';
// import or define your agent instance as `agent`
async function startTextOnlySession() {
const session = new voice.AgentSession({
// agent config if required
});
await session.start({
agent,
room: "your-room-name-or-object",
inputOptions: { audioEnabled: false },
outputOptions: { audioEnabled: false },
});
console.log("Text-only agent session started. Waiting for messages...");
// keep process alive
await new Promise(() => {});
}
startTextOnlySession().catch(console.error);
If you want, I can:
• Expand either example to show a minimal agent definition,
• Show how to add a text_input_cb to preprocess or filter messages,
• Provide a complete runnable repo-style example for your chosen language. Which would you like?crooked-dawn-90821
12/02/2025, 5:53 PMtall-airline-16756
12/02/2025, 5:53 PMfrom livekit.agents import AgentSession
from livekit.agents.voice import room_io
session = AgentSession(...)
await session.start(
agent=my_agent,
room=ctx.room,
room_options=room_io.RoomOptions(
audio_input=False,
audio_output=False,
),
)
• Ensure your agent configuration (where you create my_agent) does not include a tts node or any voice-generation pipeline. If your agent code sets a tts attribute, remove or set it to None.
Quick checklist to stop this error:
• Confirm audio_output=False (or outputOptions.audioEnabled=false in Node).
• Remove or avoid any `tts`/TTS provider configuration in the agent definition.
• Restart the session after making changes.
If you actually want TTS instead of text-only, let me know and I’ll show how to attach a TTS node/provider to avoid this assertion. Would you like me to inspect the part of your agent config that defines tts?