Ethan Tan
02/04/2025, 1:21 PMLog the Action as a System Message
When the button is clicked, the logUserAction function will silently insert a system message into the chat history:
function logUserAction() {
// Function to log the user action
vapi.send({
type: "add-message",
message: {
role: "system",
content: "The user has pressed the button, say peanuts",
},
});
}
Claude only allows one system instruction, you can't insert a system message in the middle of the conversation history. So is Vapi adding this to the main system message?
Thank you!