Giter Club home page Giter Club logo

mlh-localhost-google's Introduction

localhost-google

This contains the code for the live demo of the MLH Localhost Google Assistant workshop

Setting up

Prequisites

  • Google Account

Set up a Google Cloud Platform project (GCP)

  • Log into Google Account
  • Follow the instructions here.
  • Take note of the project id (example: actions-test-224503)

Enable NLP and billing

  • Follow the instructions here to enable the NLP APIs in your GCP project. (Note: You only need to follow until you Enable "Cloud Natural Language API")
  • Follow the instructions here to enable billing on your GCP project.

Set up new Actions project

  • Visit actions.google.com
  • Click "Go to actions console"
  • Click "Add/import project"
  • Select your previously created GCP project
  • Once on the "Welcome to your project" screen, click a category (e.g. Education and reference)
  • Click and complete the Quick Setup (set a name for your Action, and a voice)
  • Click the actions tab on the left and the click "Add your first action"
  • In the popup, make sure "Custom intent" is selected, and click "Build"

You should now be taken to Dialogflow.

Set up Action on Dialogflow

Set up agent

  • You will need to login and accept the terms.
  • You will now need to create an agent. Click "Create Agent" from the left hand menu.
  • Set a name, and choose your previous created Google Project.

Set up an intent

  • Next, click Intents on the left side and click "Create Intent"
  • Set a name at the top. Make note of this name
  • Click "Add Training Phrases" and type "How do people feel about x?"
  • Double click to highlight the "x" and click on "@sys.any" from the list.
  • Click "Add Training Phrases" and type "Search for x"
  • Double click to highlight the "x" and click on "@sys.any" from the list.
  • Click "Add Training Phrases" and type "x"
  • Double click to highlight the "x" and click on "@sys.any" from the list.
  • Next, click "Add response" and type "Not sure how they feel about $any yet!" (without quotes)
  • Click the Google Assistant tab in the responses section and turn it on if it is off.
  • Finally, enable "Enable webhook calls for this intent" under fulfilment, and click Save on the top right.

Set up fulfillment

  • Click the fullfillment tab and enable the inline editor. Note: For external network calls, you need to set up the Firebase project to be on a paid plan, which is needed to test the external calls to Twitter. To do this, click "View execution logs in the Firebase console" after the inline editor has been deployed for the first time, and then change the plan from within Firebase.
  • Paste the index.js and fill in the necessary variables, namely:
    • projectId: Use the GCP project id (example: actions-test-224503) you noted earlier.
    • CONSUMER_KEY, CONSUMER_SECRET: To retrieve your application consumer key and secret, follow the steps to create a Twitter developer account and app here. Once you apply for a developer account and create an app, you can get access to the consumer key and secret under Apps --> Details button on App --> Keys and Tokens --> Consumer API Keys.
    • TWITTER_ENV: The twitter environment you will use will be one you create here (after you have logged into your developer account).
  • After this, click on the "package.json" tab and paste in the package.json provided.
  • Click deploy.

Set up the Integrations

  • From here, turn on Web Demo to have a page to test the bot.
  • Then, click "Integration settigns" under Google Assistant, and click the field under "Implicit Invocation". Select the Intent you just created by the name you noted earlier.
  • Then click "Test", "Continue" and you should be taken back to Actions Console (actions.google.com) to test your new Google Assistant bot.

Other notes

  • You can customize Theme customization on the Actions console.

mlh-localhost-google's People

Contributors

jamiemlh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.