Botfuel adapter for Google Assistant
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/adapters feat(errors): Handle errors Sep 4, 2018
.gitignore chore(gitignore): Add gitignore Jul 31, 2018
LICENCE chore(licence): Add Licence Jul 31, 2018
README.md feat(adapter): Google assistant adapter Jul 31, 2018
index.js feat(adapter): Google assistant adapter Jul 31, 2018
package-lock.json feat(adapter): Google assistant adapter Jul 31, 2018
package.json

README.md

Google Assistant Adapter for Botfuel

Installation

In your botfuel project, run :

npm install --save botfuel-module-adapter-assistant

Set-up

Botfuel

Create a new config file in the root directory of your project (eg: assistant-config.js)

module.exports = {
  adapter: {
    name: 'assistant',
  },
  modules: ['botfuel-module-adapter-assistant']
};

Assistant

In order to make your bot work with the assistant, you need to create an action.json file

{
  "actions": [
    {
      "description": "Default Welcome Intent",
      "name": "MAIN",
      "fulfillment": {
        "conversationName": "<YOUR_APP_NAME>"
      },
      "intent": {
        "name": "actions.intent.MAIN",
        "trigger": {
          "queryPatterns": [
            "talk to <YOUR_APP_NAME>"
          ]
        }
      }
    }
  ],
  "conversations": {
    "<YOUR_APP_NAME>": {
      "name": "<YOUR_APP_NAME>",
      "url": "<YOUR_BOT_URL>/webhook"
    }
  },
  "locale": "en"
}

Once your have this file, you need to deploy it using the gactions CLI

gactions update --action_package action.json --project <YOUR_GOOGLE_ACTIONS_PROJECT_ID>

For more info on how to use gactions, visit this link https://developers.google.com/actions/tools/gactions-cli

Run your bot

BOTFUEL_APP_TOKEN=<YOUR_APP_TOKEN> BOTFUEL_APP_ID=<YOUR_APP_TOKEN> BOTFUEL_APP_KEY=<YOUR_APP_TOKEN> npm start assistant-config.js