wit-module

1.2.0 • Public • Published

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

Package Sidebar

Install

npm i wit-module

Weekly Downloads

3

Version

1.2.0

License

ISC

Last publish

Collaborators

  • wahengchang