New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

apiai-nodejs-co

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apiai-nodejs-co

Node.js SDK for api.ai

1.0.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created

api-ai-node-js

Fork of Original Node.js SDK for Api.ai, for making api.ai requests

Plugin makes it easy to integrate your Node.js application with api.ai natural language processing service.

Installation

  • Make sure that Node.js installed.
  • Install Node.js library with npm:
npm install apiai-nodejs-co

Usage

  • Create main.js file. Insert into following code.
var apiai = require('apiai');

var options = {
    hostname: "api.api.ai",
    port: 443,
    path: "/v1/query",
    version: "20150910"
}
var app = apiai("<your client acces token>", "<your client subscribtion key>" options);

var reqOptions = {
	lang: "en",
	timezone: "<eg Africa/Lagos>",
	sessionId: "<sessionId here>"
}
var request = app.textRequest('<Your text query>' reqOptions);

request.on('response', function(response) {
    console.log(response);
});

request.on('error', function(error) {
    console.log(error);
});

request.end()
  • Run following command.
node main.js

FAQs

Package last updated on 19 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts