able-jackal-84140
07/10/2025, 8:29 AMsession.say()
or session.generate_reply()
tall-airline-16756
07/10/2025, 8:29 AMtall-airline-16756
07/10/2025, 8:30 AMadd_to_chat_ctx
parameter (default True
).
◦ Use when you want exact spoken responses (greetings, confirmations, scripted text).
• session.generate_reply()
◦ Prompts an LLM to dynamically generate a response based on your instructions or user input.
◦ Requires an LLM (Language Model) to be configured.
◦ Automatically adds relevant context to chat history (either instructions or user input based).
◦ Use when you want the agent to produce context-aware, AI-generated responses.
Both methods return a SpeechHandle
for tracking, support the allow_interruptions
parameter, and trigger speech_created
events.
In short, use say()
for fixed text and generate_reply()
for dynamic, AI-driven responses.
Sources: Agent speech and audio | LiveKit Docs | examples/voice_agents/multi_agent.py