Anil
06/11/2024, 9:47 AM{
"role": "assistant",
"content": "",
"_id": "666712f04609341fdee871a8"
}
The content is empty, can we stop sending the empty content conversation update?Vapi
06/11/2024, 9:49 AMVapi
06/11/2024, 9:49 AMcontent
field of each message. If the content
is empty, you can simply ignore that update and not store it in your array. Here's a basic example of how you could modify the message event handler to achieve this:
javascript
vapi.on("message", (msg) => {
// Check if the message is a transcript and if the content is not empty
if (msg.type === "transcript" && msg.content !== "") {
// Store the message in the array since the content is not empty
// Your array storing logic goes here
}
});
By adding this condition, you ensure that only messages with non-empty content are processed and stored. If you need any further assistance or have additional questions, please feel free to ask!Vapi
06/11/2024, 9:49 AMAnil
06/11/2024, 9:50 AMSahil
06/12/2024, 8:24 AM