npm

Need private packages and team management tools?Check out npm Orgs. »

node-api-ai

1.0.0 • Public • Published

API AI Node Interface

Travis Code Coverage Version Downloads ISC License

Description

  • Simple API for interacting with API AI
  • Follows the intent naming convention supplied from api.ai and provides method to check if text is of a specific intent.

Installation

npm install node-api-ai --save

Usage

const AIEntity = require('node-api-ai')
const entity = AIEntity({
  dev_key: '<developer access token>',
  client_key: '<client access token>',
  logging: false // optional
})
 
// IS SINGLE INTENT
entity.initialized
.then(function () {
  return entity.confirmation.isYes('<some text query>') //
})
.then(function (result) {
  result // Boolean
})
 
// IS MULTIPLE INTENT
entity.findIntent('<some text query>')
.then(function (result) {
  const action = result.action
  return [
    action === entity.confirmation.yes,
    action === entity.confirmation.no
    ...
  ]
})
 

Dependencies

Keywords

none

install

npm i node-api-ai

Downloadsweekly downloads

2

version

1.0.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability