0.0.2 • Published 5 years ago

botmaster-aog v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

botmaster-aog

Actions on Google integration for the Botmaster chatbot framework.

The Actions on Google bot exposes a request fulfillment endpoint that accepts requests from Google Assistant using the actions-on-google Actions SDK.

Note: Currently only supports simple responses (i.e. no Cards or Table support).

Installation

Install the Botmaster AoG package:

  • Yarn: yarn add botmaster-aog

  • NPM: npm install --save botmaster-aog

Usage

The simplest way to use the Actions on Google integration is to add it to your Botmaster application as follows:

const ActionsOnGoogleBot = require('botmaster-aog');
const aogSettings = {
    port: 8080,
    actionId: '<Actions on Google project ID'
};
const aogBot = new ActionsOnGoogleBot(aogSettings);
botmaster.addBot(aogBot);

Options

The Actions on Google bot integration supports the following options:

OptionTypeDescriptionDefault
idstringBot identifieractions-on-google
actionIdstringThe Actions on Google project identifier
clientIdstringActions on Google account linking client id
debugbooleanActions on Google debug loggingfalse
errorMessagestringDefault error message
portstringPort to start the new webhook server on
expressAppobjectExisting Express app to mount the webhook on

Note: Either the expressApp or port option must be specified. If an Express app is specified, the webhook is mounted on the existing app. Otherwise, a new Express app is created and started on the specified port.

Fulfillment Endpoint

The Actions on fulfillment endpoint is mounted at:

GET /<id>/fulfillment

If no id is specified in the options list, the endpoint will default to:

GET /actions-on-google/fulfillment

Intents

The Actions on Google bot currently handles the following intents:

  • actions.intent.MAIN
  • FALLBACK

The user utterance (text) is formatted and emitted as a Botmaster update.