apiai
TypeScript icon, indicating that this package has built-in type declarations

4.0.3 • Public • Published

Node.js SDK for Api.ai

This plugin allows integrating agents from the Api.ai natural language processing service with your Node.js application.

Installation

  • Install Node.js
  • Install Api.ai SDK with npm:
npm install apiai

Usage

  • 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.

Package Sidebar

Install

npm i apiai

Weekly Downloads

4,446

Version

4.0.3

License

Apache 2.0

Last publish

Collaborators

  • sstepashka