bulky-wall-61623
08/30/2025, 7:20 AMtall-airline-16756
08/30/2025, 7:20 AMtall-airline-16756
08/30/2025, 7:21 AMupdate_agent method of the AgentSession class. But don’t worry—the frontend can still ask the server to make that switch by calling a server-side function tool based on what the user wants.
Here’s a simple way to set up agent switching:
1. Define a few different agent classes, each with its own setup.
2. Create server-side function tools that either call update_agent() or provide a new agent instance.
3. From the frontend, trigger these tools whenever the user takes an action or a certain condition is met.
4. The framework will smoothly handle swapping agents while keeping the conversation flow intact.
If you’d like, I’m happy to share more details or examples to help you get this up and running!
Sources: Workflows | LiveKit Docs | avatars/hedra/education_avatar/education-frontend/components/session-view.t... | agents/src/voice/agent_session.ts