This plugin allows integrating agents from the Api.ai natural language processing service with your Node.js application.
- Install Node.js
- Install Api.ai SDK with
npm
:
npm install apiai
- Create
main.js
file with the following code:
var apiai = require('apiai');
var app = apiai("<your client access token>");
var request = app.textRequest('<Your text query>', {
sessionId: '<unique session id>'
});
request.on('response', function(response) {
console.log(response);
});
request.on('error', function(error) {
console.log(error);
});
request.end();
- Run following command.
node main.js
- Your can find more examples in
samples
directory.
Please read and follow the steps in the CONTRIBUTING.md.
See LICENSE.
Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service.
This is not an official Google product.