nearLucid
03/09/2025, 10:18 PMVapi Support Bot
03/09/2025, 10:20 PM.send()
with system messages, you need to ensure the triggerResponseEnabled
flag is set to true
(which is the default). If it's set to false
, the message will be added to the context but won't trigger a response from the AI assistant.
javascript
vapi.send({
type: 'add-message',
message: {
role: 'system',
content: 'There is 1 minute remaining. End the call professionally...'
},
triggerResponseEnabled: true // Make sure this is true
});
2. **End Call Implementation**: For professionally ending calls, you have a few options:
a) Use the say
method with `endCallAfterSpoken`:
javascript
vapi.say("Thank you for trying our demo. To build your own AI agent, please create an account!", true);
b) Send a message followed by an end-call command:
javascript
// First send closing remarks
vapi.send({
type: "add-message",
message: {
role: "assistant",
content: "Thank you for your time and for trying the demo..."
},
triggerResponseEnabled: true
});
// Then end the call (with a slight delay if needed)
setTimeout(() => {
vapi.send({
type: "end-call"
});
}, 2000);
3. **Ensure endCall
tool is configured**: Make sure the endCall
tool is included in your assistant's configuration:
json
{
"model": {
"provider": "openai",
"model": "gpt-3.5-turbo",
"tools": [
{
"type": "endCall"
}
]
}
}
Vapi Support Bot
03/09/2025, 10:20 PMnearLucid
03/09/2025, 10:23 PMKyle Brunker
03/11/2025, 1:12 PMgodlike
04/05/2025, 6:35 PMgodlike
04/05/2025, 6:45 PMnearLucid
04/05/2025, 7:43 PMnearLucid
04/05/2025, 7:53 PMgodlike
04/06/2025, 4:52 AMnearLucid
04/06/2025, 7:10 AMnearLucid
04/06/2025, 7:10 AMnearLucid
04/06/2025, 7:11 AMnearLucid
04/06/2025, 7:11 AMnearLucid
04/06/2025, 7:11 AMgodlike
04/06/2025, 7:19 AMgodlike
04/06/2025, 7:20 AMgodlike
04/06/2025, 7:32 AMnearLucid
04/06/2025, 7:44 AMgodlike
04/06/2025, 9:56 AMgodlike
04/06/2025, 9:56 AMgodlike
04/07/2025, 5:40 AMgodlike
04/07/2025, 5:46 AMShubham Bajaj
04/07/2025, 12:56 PMgodlike
04/07/2025, 5:16 PMaa929ab9-e91a-4bf7-b17a-0db02355b6c5
Kyle Brunker
04/09/2025, 1:03 AM