skinny-azureS

vapi.send (‘add-message’) is not working as expected

I’m currently trying to implement a 10 mins timer for the call, so when it reached 10 min I wanted the assistant to say something like ‘10 mins has already passed, do you want to continue or end the call right now?

so I’m trying to use background messages for that,

vapi.send({
type: "add-message",
message: {
role: "system",
content: "Ten minutes already passed, please remind the user about the time and asks the user if they want to end the call now or continue",
},
});

but what happens is 2 things:
  • the assistant will stop talking for a moment when I send this message
  • the assitant will ‘ignores’ it and just continue talking about the topic and does not remind about the time at all
please help to take a look into it, i’m using gpt-4o-realtime btw


*also fyi if i use ‘say’ then everything will work correctly but the downside is i can only use hardcoded message

vapi.send({
type: 'say',
message:
'By the way, I noticed ten minute has already passed, do you want to continue chatting or end the call?',
});
^this works
Was this page helpful?