AgentSession built in
agent/src/agent.py.
agent/src/agent.py
agent/src/agent.py
Changing one
Three edits, all inagent/.
1
Add the plugin
2
Import it
Add it to the
from livekit.plugins import ... line in src/agent.py.3
Replace the argument
Swap the one constructor argument. The other two are untouched.
.env (and in agent/.env if you run
the worker by hand). Then rebuild the worker image:
Voice, model and language
Model names are strings on the constructor, so changing a voice or a model version is a one-word edit.inworld.TTS also takes voice, which is
"Ashley" by default.
VAD and turn detection are separate
vad and turn_handling are not provider choices in the same sense:
- The Silero VAD is loaded once per process in
prewarm()and shared across sessions throughctx.proc.userdata["vad"]. - Turn detection is LiveKit’s
MultilingualModel, and interruption is set to VAD mode.
scripts/doctor.py probes Deepgram, Cerebras and Inworld by name. Its
provider list is hardcoded, so after a swap it checks a key the session no
longer uses. Its agent-name, LiveKit and stack checks stay correct.Noise cancellation
An opt-in, noted in a comment insrc/agent.py:
RoomInputOptions from livekit.agents and noise_cancellation
from livekit.plugins, and pass it to session.start: