magnificent-helicopter-52189
10/13/2025, 2:58 PMtall-airline-16756
10/13/2025, 2:58 PMtall-airline-16756
10/13/2025, 2:59 PMsession.say() method within your agent's entrypoint or lifecycle hook. Here's a simple way to set it up:
Using session.say() for a Predefined Message:
• Just add this code in the entrypoint function right after the session starts:
await session.say("Hello, John")
This will use the Text-to-Speech (TTS) plugin you have configured to warmly deliver the message to your user. You can also include allow_interruptions=True if you'd like to let users jump in and interrupt the message.
Personalized Greetings:
If you'd like to make the greeting feel more personal (like "Hello, John"), you can fetch user-specific info from:
• Job Metadata: Pass user details along in the dispatch request and then parse them in the entrypoint.
• Room Metadata: Access properties like the room's name and other metadata.
• Participant Attributes: Pull user details from participant attributes.
Here's an example to illustrate:
async def entrypoint(ctx: JobContext):
user_name = "there"
if ctx.job.metadata:
metadata = json.loads(ctx.job.metadata)
user_name = metadata.get("user_name", "there")
session = AgentSession()
await session.start(agent=MyAgent(), room=ctx.room)
await session.say(f"Hello, {user_name}! How can I help you today?", allow_interruptions=True)
If you have any questions or need a hand with the implementation, please don’t hesitate to reach out—I’m here to help!
Sources: pipeline-tts/short_replies_only.py | Agent speech and audio | LiveKit Docs | delay-handling/agent.py | examples/warm-transfer/warm_transfer.py | Job lifecycle | LiveKit Docs