Issue with API message
Do you want to request a feature, report a bug, or ask a question about wit? Bug What is the current behavior? I have 3 entities, two intents book_hotel,book_flight and wit/greetings and wit/datetime entities. When message i m typing is Good Morning then https://api.wit.ai/message?v=20170307&n=${n}&q is giving back response is as below.
entities : { intent: [ { confidence: 0.0032467125565982, value: 'book_flight' }, { confidence: 0.0030873928441121, value: 'book_hotel' } ], greetings: [ { confidence: 0.998062193379, value: 'true' } ] }
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. call api https://api.wit.ai/message?v=20170307&n=${n}&q='Good Morning'. What is the expected behavior? It should response with greetings and no other intent. What is the App ID where you are experiencing this issue (if applicable)? 5b45e25c-dbcf-4a0e-aedd-d743cf0ad1a9
Sample Code
function queryWit(text, n=3) {
return fetch(
https://api.wit.ai/message?v=20170307&n=${n}&q=${encodeURIComponent(text)},
{
headers: {
Authorization: Bearer ${NEW_ACCESS_TOKEN},
'Content-Type': 'application/json',
},
}
).then(res => res.json());
}
You use the n param (n-best trait entities you want to get back). https://wit.ai/docs/http/20170307#get--message-link, so this is the expected behavior. Please feel free to reopen
Thanks a lot for your help