broad-painter-9222
11/03/2025, 1:37 PMtall-airline-16756
11/03/2025, 1:37 PMtall-airline-16756
11/03/2025, 1:37 PMsession.say() method inside the on_enter() lifecycle callback of your agent. This way, your agent will start speaking right away when the session begins, without waiting for user input.
Here’s a simple overview of the steps:
• Make sure you have a TTS plugin configured for your agent (like OpenAI TTS).
• Use the on_enter() callback to trigger the speech by calling session.say() with the message or stream you want.
• For example, in Python: await agent.say("Hello! How can I help you today?", allow_interruptions=True)
This approach will smoothly transition your agent through initializing → thinking → speaking, skipping the usual listening state.
If you’d like, feel free to share more about your setup—like which SDK or agent type you’re using—and I’d be glad to assist you further!
Sources: Web and mobile frontends | LiveKit Docs | delay-handling/agent.py | packages/basics/src/listen-and-respond.ts | livekit-agents/livekit/agents/voice/agent_activity.py | server/agent.py