How to use Message plan with idle message
# support
m
I am trying to use the messagePlan with idleTimeoutSeconds: callId: 63e7b0f9-3523-4418-97c8-2795797ca0a3 Here is my configuration:
Copy code
"messagePlan": {
  "idleTimeoutSeconds": 5
},
I want expecting the agent to speak again cause no customer answer. But it didn't and the call ended in silence-timed-out. Am I missing something?
v
Hi there! 👋 I can see you're having trouble with your messagePlan configuration. While I can't analyze your specific call, I can definitely help with your messagePlan configuration. Looking at your current setup, I can see you're missing some key components in your messagePlan configuration. The idleTimeoutSeconds alone isn't enough - you need to include idleMessages for the agent to speak when there's no customer response. Here's how to properly configure your messagePlan:
Copy code
json
"messagePlan": {
  "idleMessages": [
    "Hello? Are you still there?",
    "I notice you're thinking about this. Take your time."
  ],
  "idleMessageMaxSpokenCount": 3,
  "idleTimeoutSeconds": 5
}
According to the [Vapi documentation](https://docs.vapi.ai/api-reference/assistants/update-assistant), you need to include: - `idleMessages`: An array of messages that will be spoken when the user is silent - `idleMessageMaxSpokenCount`: The maximum number of times idle messages will be spoken - `idleTimeoutSeconds`: The number of seconds of silence before an idle message is played You can update your configuration using a PATCH request:
Copy code
curl -X PATCH https://api.vapi.ai/assistant/id \
     -H "Authorization: Bearer token" \
     -H "Content-Type: application/json" \
     -d '{
  "messagePlan": {
    "idleMessages": [
      "Hello? Are you still there?",
      "I notice you're thinking about this. Take your time."
    ],
    "idleMessageMaxSpokenCount": 3,
    "idleTimeoutSeconds": 5
  }
}'
Additionally, you might want to consider adding a
silenceTimeoutMessage
to be played before the call ends due to silence:
Copy code
json
"messagePlan": {
  "idleMessages": [
    "Hello? Are you still there?"
  ],
  "idleMessageMaxSpokenCount": 3,
  "idleTimeoutSeconds": 5,
  "silenceTimeoutMessage": "I notice you haven't responded. I'll end the call now, but feel free to call back later."
}
Is there anything else you'd like to know about configuring messagePlan in Vapi? Sources:
o
Hey guys, I built a transient assitant using vapi and deployed it on make for outbound and ibound calls. But currently when i call the assistant for inbound or it calls for outbound.. Immediately it says the first message. He stops talking. He does not read nor respond to my voice repose. What could be wrong. Note: I worked perfectly well just yesterday
m
Hey @OgagaPengist , I suggest you to open a new issue for that, as it's not related to the support case I've opened
k
Thank you for reaching out to us. We've received your message and will get back to you as soon as possible.
Hi, checking if this is resolved/solved for you?
m
No, it's not resolved. Can you share me a working configuration for message plan?
k
Here's a complete working messagePlan configuration: \`\`\`json "messagePlan": { "idleMessages": \[ "Hello, are you still there?", "I'm waiting for your response.", "If you need more time to think, that's completely fine." \], "idleMessageMaxSpokenCount": 3, "idleTimeoutSeconds": 5, } \`\`\` From the codebase, here's what each parameter does: 1\. `idleMessages`: Array of messages the agent will randomly select from when the user is silent for
idleTimeoutSeconds
duration. 2\. `idleMessageMaxSpokenCount`: Limits how many idle messages can be spoken during the call (default is 3, min 1, max 10 according to the codebase). 3\. `idleTimeoutSeconds`: How many seconds of silence before playing an idle message (default is 10, min 5, max 60 according to the code). To update your assistant with this configuration, you can use a PATCH request:
Copy code
curl -X PATCH https://api.vapi.ai/assistant/{assistant_id} \
  -H "Authorization: Bearer {your_api_key}" \
  -H "Content-Type: application/json" \
  -d '{
    "messagePlan": {
      "idleMessages": [
        "Hello, are you still there?",
        "I'm waiting for your response.",
        "If you need more time to think, that's completely fine."
      ],
      "idleMessageMaxSpokenCount": 3,
      "idleTimeoutSeconds": 5
    }
  }'
Additionally, you might want to set the
silenceTimeoutSeconds
parameter, which determines when the call ends due to silence. From the code, this is separate from the messagePlan and has a default of 30 seconds:
Copy code
{
  "messagePlan": {
    /* Your messagePlan configuration */
  },
  "silenceTimeoutSeconds": 30
}
Marem, let me know if you require anything else or further help. Happy to Contribute.
m
Thanks @Shubham Bajaj , that should be ok with that. I won't be able to test before end of week so you can close the issue, I'll open a new one in case I need further help
k
Marking this ticket as Solved ✅
2 Views