hundreds-rainbow-68836
04/06/2026, 4:35 AMtall-airline-16756
04/06/2026, 4:35 AMtall-airline-16756
04/06/2026, 4:35 AMsession.say() or session.generate_reply() so the conversation stays responsive, then start the async tool.
• Run the long task outside the blocking LLM turn (e.g., push a job to your backend, queue, or an RPC/forwarding endpoint) and return control to the user. When the job completes, push the result back into the session or start a new reply from the agent (via an event or webhook).
• Use context.disallow_interruptions() for critical operations you don’t want interrupted, and use SpeechHandle.interrupt() to cancel interim speech when results arrive.
• Provide verbal status updates or “thinking” audio to improve user experience while waiting.
If you want, tell me which pattern you prefer (in-session async with immediate ack, external job queue + callback, or forwarding to frontend), and I’ll give a concise implementation outline and code pointers.
Sources: Function tool definition | LiveKit Documentation | Audio customization | LiveKit Documentation | External data and RAG | LiveKit Documentation | The ReAct Pattern for Voice Agents and How AI Agents Think, Act, and Respon... | Forwarding to the frontend | LiveKit Documentation, with interactive elements