Skip to content

wahengchang/wit-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

It is a customized module for wit.ai API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published