Open quarbby opened 8 years ago
config.js
$ curl -XGET 'https://api.wit.ai/message?q=can%20i%20have%20a%20penguin%20picture?' \ -H 'Authorization: Bearer $token' { "msg_id" : "b7299d5f-596c-4745-bb92-da43ef11dc54", "_text" : "can i have a penguin picture?", "outcomes" : [ { "_text" : "can i have a penguin picture?", "confidence" : null, "intent" : "default_intent", "entities" : { "local_search_query" : [ { "type" : "value", "value" : "penguin picture", "suggested" : true } ], "intent" : [ { "value" : "picture" } ] } } ]
app.js
text
Wit.ai
intent
switch (intent) { do something; }
Use node-wit API and the online docs
config.js
. Extract intent of such a message:app.js
text
from user messagetext
toWit.ai
intent
fromWit.ai
botswitch (intent) { do something; }