robo-js-sdk
roboAi API SDK
Last updated 3 months ago by itscmtestuser .
ISC · Original npm · Tarball · package.json
$ cnpm install robo-js-sdk 
SYNC missed versions from official npm registry.

robo-js-sdk

Welcome to our robo-js-sdk github tutorial.

What is this SDK?

Javascript SDK to easily connect to roboAi API.

Instalation

Node.js

robo-js-sdk is available on npm. To install it try:

$ npm install robo-js-sdk

Browsers

You can also usee it within the browser, install via npm and use the roboAi-sdk.js file found within the download. For example:

<script src="./node_modules/robo-js-sdk/dist/roboAi.js"></script>

Usage

Import the library in your code, and then start a new roboAi to get new communication:

const roboAi = new roboAi(environment, oauth2, basicAuth);

For reference here is described how to start oauth2 and basic authentication:


const oauth2 = {
	username: "<your_api_key>",
	password: "<your_api_secret>"
};

const basicAuth = {
	user: "<your_basic_auth_user>",
	psw: "<your_basic_auth_psw>"
};

You may to specify environment too (sandbox or production), and for that you'll use js url.

Services available


roboAi.getAssistants() // returns the available Assistants
startDialogue(assistantUuid) // returns the needed dialogueUuid
// use the dialogueUuid to sendMessage
const messageRequest = {
	"encoding": "BASE64",
	"format": "TEXT_PLAIN",
	"language": "EN_US",
	"message": "hello",
	"messageProperties": {
		"additionalProp1": "string",
		"additionalProp2": "string",
		"additionalProp3": "string"
	},
	"model": "BROADBAND"
};
roboAi.sendMessage(dialogueUuid, messageRequest, acceptTypes.audioMp3);

Current Tags

  • 1.0.40                                ...           latest (3 months ago)

12 Versions

  • 1.0.40                                ...           3 months ago
  • 1.0.39                                ...           3 months ago
  • 1.0.38                                ...           3 months ago
  • 1.0.37                                ...           4 months ago
  • 1.0.36                                ...           4 months ago
  • 1.0.35                                ...           4 months ago
  • 1.0.34                                ...           4 months ago
  • 1.0.33                                ...           5 months ago
  • 1.0.32                                ...           5 months ago
  • 1.0.31                                ...           5 months ago
  • 1.0.3                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 12
Dependencies (6)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |