0.2.1 • Published 5 years ago

@napoai/cloud v0.2.1

Weekly downloads
9
License
MIT
Repository
gitlab
Last release
5 years ago

@napoai/cloud

Installation

npm install @napoai/cloud --save

Quick example

const cloud = require('@napoai/cloud');

// Initiliase with cloud keys
await cloud.init('./PATH_TO_SERVICE_ACCOUNT');

let project = cloud.project('YOUR_PROJECT_ID');
let chat = project.chatEngine();

chat.handleMessage({
  text: 'hello',
  sender: 'default'
}).then(reply => {
  // Reply
  // Hi! How are you doing?
});

chat.train({
  data: './PATH_TO_TRAINING_DATA',
  version: '1.0'
}).then(result => {
  console.log(result);
});

chat.getStatus().then(status => {
  // Status
})

chat.setActionsEndpoint('ACTIONS_ENDPOINT').then(result => {
  // 200 - Success
});

Documentation

Please refer to the @napoai/admin documentation for more details.

License

Copyright (c) 2019

Licensed under the MIT license.