In the python agent starter, what is the best plac...
# ask-ai
s
In the python agent starter, what is the best place to generate the first sentence when a user joins the room?
t
Thanks for reaching out, aric. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — good question. For the Python agent starter, generate the agent’s first sentence in the Agent class’s
on_enter()
lifecycle hook.
on_enter()
runs when the agent becomes active in the session, so calling
await self.session.generate_reply(...)
there ensures the agent speaks immediately when a user joins. If you want, tell me the greeting style or any constraints (length, language, context) and I’ll suggest an exact
instructions=
string you can use. Sources: Pipeline nodes and hooks | LiveKit docs | Agents and handoffs | LiveKit docs