aloof-scooter-47164
05/07/2026, 12:21 AMtall-airline-16756
05/07/2026, 12:21 AMtall-airline-16756
05/07/2026, 12:21 AMsession.generate_reply(instructions="...") in on_enter so the agent generates and speaks a response immediately.
• Or call session.say("...") in on_enter to play a predefined message. Use allow_interruptions=False if you want the message to play fully unless explicitly interrupted.
Minimal example:
class SpecialistAgent(Agent):
async def on_enter(self) -> None:
# option A: generate a response from the LLM and speak it
await self.session.generate_reply(instructions="Introduce yourself and ask how I can help.")
# option B: play a predefined audio/text prompt immediately
# await self.session.say("Hi, I'm the specialist. How can I help you today?", allow_interruptions=False)
Would you like the example adapted for a specific language/runtime or for playing a prerecorded audio file instead of TTS?
Sources: Agents and handoffs | LiveKit Documentation | Pipeline nodes and hooks | LiveKit Documentation | Agent speech and audio | LiveKit Documentation | The Handoff Pattern for Voice Agents That Replaces IVR Menus | LiveKit, with interactive elementsaloof-scooter-47164
05/07/2026, 12:22 AMtall-airline-16756
05/07/2026, 12:22 AMon_enter.
Sources: Agents and handoffs | LiveKit Documentation | https://docs.livekit.io/agents/models/realtime/plugins/openai.md| | https://docs.livekit.io/agents/models/realtime/plugins/xai.md|, with interactive elements