wooden-librarian-60399
08/05/2025, 7:13 PMtall-airline-16756
08/05/2025, 7:13 PMtall-airline-16756
08/05/2025, 7:13 PMwooden-librarian-60399
08/05/2025, 7:16 PMtall-airline-16756
08/05/2025, 7:17 PM@function_tool decorator to create a function that does exactly what you need.
2. Call the Tool: When your agent’s running, call that tool function. Just remember, don’t have it reply right away after the tool runs.
3. Wait for User Input: Use the session’s generate_reply method to pause and wait for the user’s next message before moving on.
4. Handle Context: The output from the tool will automatically be added to the chat history, so everything stays connected.
This way, your agent can do its thing with the tool and then patiently wait for the user’s next message before continuing the chat. Pretty neat, right?
Sources: livekit-agents/livekit/agents/voice/agent_activity.py | Function calling with Voice Agents | LiveKit Docs