wit-module

It is a customized module for wit.ai API.

Usage no npm install needed!

<script type="module">
  import witModule from 'https://cdn.skypack.dev/wit-module';
</script>

README

wit-module

It is a customized module for wit.ai API.

NPM

Install

$ npm install --save wit-module

Usage

Initializing the wit token to process.env.WIT_TOKEN

var WIT = require("wit-module")
var witModule = new WIT(process.env.WIT_TOKEN);

witModule.converse('something to say?',_sessionId ).then(function(result){

  console.log(result);

},function(err){
  console.error(err);
})

Document

converse (_str, _sessionId, _postData)

return a promise with response body Read more about converse


WIT.prototype.converse (_str, _sessionId, _postData)

// {
//   "confidence": 0.021887092777471962,
//   "type": "action",
//   "action": "findTheater",
//   "entities": {
//     "datetime": [
//       {
//         .....
//       }
//     ],
//     "intent": [
//       {
//         "confidence": 0.9870533668643489,
//         "value": "movie"
//       }
//     ]
//   }
// }


License

MIT