Im trying to check the confidence of my API response within my HTML page. If confidence is 0 {Go to this page} If confidence is 1 {Go to this page} I can check other things but not the intent confidence how would i do this?
fetch(`https://api.wit.ai/message?q=${transcript}`,
{
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
}).then(res => res.json())
.then(function (data){
if (data.intents[0].value==[0]) {
console.log("intent 1")
//throw "Error";
}
else if (data.text==="pay"){
console.log("works")
}
else {
if(data.intents==="checkout"){
console.log("intent 2");
}
}
})