Lucio
04/13/2025, 9:52 PMVapi Support Bot
04/13/2025, 9:54 PMmessagePlan.idleMessages
feature. This is specifically designed to handle situations where you need to play messages during periods of inactivity - perfect for slow tool calls!
Here's how to implement it:
You'll need to update your assistant's messagePlan
configuration using a PATCH request to the VAPI API. Here's an example:
curl -X PATCH https://api.vapi.ai/assistant/id \
-H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d '{
"messagePlan": {
"idleMessages": [
"This might take a second...",
"Still working on it..."
],
"idleMessageMaxSpokenCount": 3,
"idleTimeoutSeconds": 8
}
}'
This configuration will:
- Display one of your specified messages every 8 seconds during idle periods (like when waiting for a tool call)
- Rotate through your messages (you can add as many variations as you want)
- Stop after speaking a maximum of 3 messages (you can adjust this number)
According to the information I found, this is actually how VAPI's existing LLMs implement the "This might take a second" message - they use this idle messages feature to ensure "long silences are never completely silent" when waiting for tool calls to complete.
For your custom LLM integration, you might also want to consider:
1. Setting appropriate timeoutSeconds
for your tool calls (e.g., "timeoutSeconds": 30
) to ensure they don't hang indefinitely
2. Deciding whether your tools should be synchronous or asynchronous, as this affects how timeouts are handled
Is there anything specific about this implementation you'd like me to clarify further?
Sources:Vapi Support Bot
04/13/2025, 9:54 PMLucio
04/13/2025, 10:14 PMShubham Bajaj
04/13/2025, 10:16 PMLucio
04/13/2025, 10:20 PMShubham Bajaj
04/13/2025, 10:25 PMLucio
04/13/2025, 10:41 PMKings_big💫
04/14/2025, 6:54 AMLucio
04/16/2025, 8:44 AM