genetic-orange
genetic-orange3d ago

Server side background messages

Is it possible to send a background message to update the conversation history from a server? Or is that only possible from a client?
1 Reply
Vapi Support Bot
Based on the documentation, background messages are added to the chat history using the vapi.send() function, typically in a client-side context:
vapi.send({
type: "add-message",
message: {
role: "system",
content: "The user has pressed the button, say peanuts",
},
});
vapi.send({
type: "add-message",
message: {
role: "system",
content: "The user has pressed the button, say peanuts",
},
});
However, the documentation does not specify if this can be done from a server. For server-side support, you may need to contact Vapi support or check for a dedicated server API endpoint for background messages.
(Source: Vapi background messages documentation)
⤵️ Mention @Vapi Support Bot for follow-ups 🐥

Did you find this page helpful?