Custom idle messages
# support
l
I use multilingual voice agents, I didnt find any options to choose any other language except english for idle messages. it breaks conversation experience. is there work around?
c
Vapi currently supports only English idle messages in the UI, but you can work around this by detecting the user's language at runtime and updating the
idleMessages
via API with language-specific prompts..
f
Please explain the steps
k
Detect the user’s language during the call and dynamically update the assistant’s idleMessages via the Vapi API using a PATCH request.. https://docs.vapi.ai/customization/multilingual https://docs.vapi.ai/assistants/idle-messages
f
How do I use the PATCH request to update the call idleMessages? I have written js node functions in my workflow to detect the conversation language, grab the listenUrl & controlURL but I'm stuck to how to update the call. The shared links are not straightforward.
c
Hey legolaz1336, I sincerely apologize for the delay in our responses this week. We experimented with some process adjustments that didn’t work as intended, and unfortunately, this caused some disruptions. That’s entirely my responsibility. Just a quick note—our team is unavailable on weekends. However, if something urgent or critical comes up, feel free to reach out to me directly, and I’ll assist you. The support issues will be resolved in the coming weeks, and starting Monday, you can expect more consistent and improved support. Thank you so much for your patience and for continuing to stick with us!
k
Send a PATCH request to /call/:callId with assistantOverrides.messagePlan containing language-specific idleMessages, triggered after your language detection logic.. https://docs.vapi.ai/api-reference/calls/update
f
I have set it up The patch request is returning error in n8n Here's my setup Method: Patch URL: https://api.vapi.ai/call/:id Input: { "customers": { "assistantOverrides": { "messagePlan": { "idleMessages": {{ JSON.stringify($json.idleMessages) }}, "idleTimeoutSeconds": 10, "idleMessageMaxSpokenCount": 5, "idleMessageResetCountOnUserSpeechEnabled": true } } } } Output { "customers": { "assistantOverrides": { "messagePlan": { "idleMessages": ["¿Sigues ahí?","¿Aún estás conmigo?","Hola - ¿sigues en la línea?","¿Seguimos conectados?","Solo verificando si me escuchas"], "idleTimeoutSeconds": 10, "idleMessageMaxSpokenCount": 5, "idleMessageResetCountOnUserSpeechEnabled": true } } } } ERROR MESSAGE Error code 400 Full message 400 - "{\"message\":[\"property customers should not exist\"],\"error\":\"Bad Request\",\"statusCode\":400}" Request { "body": { "customers": { "assistantOverrides": { "messagePlan": { "idleMessages": [ "¿Sigues ahí?", "¿Aún estás conmigo?", "Hola - ¿sigues en la línea?", "¿Seguimos conectados?", "Solo verificando si me escuchas" ], "idleTimeoutSeconds": 10, "idleMessageMaxSpokenCount": 5, "idleMessageResetCountOnUserSpeechEnabled": true } } } }, "headers": { "content-type": "application/json", "Authorization": "**hidden**", "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7" }, "method": "PATCH", "uri": "https://api.vapi.ai/call/:id, "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "timeout": 300000, "encoding": null, "json": false, "useStream": true }
This works, { "type": "say", "content": "{{$json.message}}", "endCallAfterSpoken": false } But there's no way to ensure the agent say those sentence at idleMessage timing
c
Checking if this is resolved/solved for you?
f
No, I will appreciate your help
k
Vapi built-in idleMessages timing can’t be triggered manually, so to control when messages are spoken, disable idle messages and detect silence yourself, then send say actions via the control URL after a custom timeout.. https://docs.vapi.ai/assistants/idle-messages
l
If I have existing assistant, should I use assistantOverrides to add idle messages? updated: works with assistantOverrides. thanks
k
To control when idle messages are spoken in Vapi, disable them in the assistant config and use assistantOverrides to enable them dynamically after detecting silence, sending a say action via the control URL.. https://docs.rs/vapi-client/latest/vapi_client/models/assistant_overrides/struct.AssistantOverrides.html