Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
index.js
package.json

README.md

Smartly.ai node.js client

It's a node.js client for Smartly.ai; it simplifies calls to the api.

Installation

  • Install Node.js
  • Install Smartly.ai SDK with npm:
npm install smartlyai

Usage

Sample use:

  • Create main.js file with the following code:
var smartlyai = require('smartlyai');

var dialog = smartlyai("<your client access token>");

dialog.newSession({
  user_id: '<unique user id>', // Required
  skill_id: '<your skill id>', // Required
  lang: '<lang of the skill id>', // Required
  [ input: 'your input', // Required for newInput method ]
  [ user_data: {<your user data>} // Optional]
})
.then(data =>
  console.log(data)
)
.catch(err => {
  console.error(err.message)
})
  • Run following command.
node main.js

You must first pass the token to the smartlyai module, then you can call newSession or newInput; the first create a new session (i.e. goes back to the Welcome State) while the second simulates user input (e.g. "Hello there.").

The two methods return native promises.

For more information, see our doc Smartlyai's API documentation on section API/Dialog

You can’t perform that action at this time.