A promise / callback API for the NLP platform wit.ai.
This library is aimed at people, which try to automate the creation and deployment of a wit.ai application.
npm i --save wit.ai-http-api
let WitAi = require('wit.ai-http-api');
let wit = new WitAi(process.env.WIT_TOKEN);
let params = {name: 'MyAwesomeApp', lang: 'en', private: 'true', desc: 'Test'};
wit.apps.postApp(params, (err, data) => {
if (err) {
console.error(err);
} else {
console.log(data);
/**
* data will contain an object like this:
* {
* "access_token" : "NEW_ACCESS_TOKEN",
* "app_id" : "NEW_APP_ID"
* }
*/
}
})
This library supports native promises.
let params = {name: 'MyAwesomeApp', lang: 'en', private: 'true', desc: 'Test'};
try {
let result = await wit.apps.postApp(params);
} catch (e) {
throw e;
}
For a (semi) complete API documentation please refer to the Tests and the API docs.
Currently the needed parameters are not documented. Please refer to the official Wit.ai HTTP API documentation.
Contributions are highly appreciated. Please make sure your contribution align with the eslint standards in this project. If you feel like your code belongs in the master, feel free to submit a pull request.
In case of issues, submit a Github Issue here.