wit icon indicating copy to clipboard operation
wit copied to clipboard

Issue with API message

Open tarakdesai1983 opened this issue 8 years ago • 2 comments

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()); }

tarakdesai1983 avatar Jul 12 '18 07:07 tarakdesai1983

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

l5t avatar Jul 13 '18 14:07 l5t

Thanks a lot for your help

tarakdesai1983 avatar Jul 20 '18 11:07 tarakdesai1983