Giter VIP home page Giter VIP logo

google-runtime's Introduction

google-runtime

circle ci Coverage sonar quality gate

google-runtime is an http webhook service that handles Google Assistant/Dialogflow requests and generates a response. It manages the state of the user based on the project made on the Voiceflow Creator tool. It can be run independently from Voiceflow.

This is the same service that hosts all Google Actions and Dialogflow projects created on Voiceflow. This includes serving production apps on and handling millions of requests.

image

local/debugging setup

export your voiceflow project from the creator tool. Each time you update your project you will need to export again. You can find the export option here:

Screenshot from 2020-09-07 12-14-44

It should save a .vfr (voiceflow runtime) JSON file from your browser that would be named similar to this: VF-Project-nPDdD6qZJ9.vfr

fork/clone voiceflow/google-runtime to your local machine. Ensure nodejs, npm, and yarn are set up on your local machine. Run yarn to install all dependencies.

Add your VF-Project JSON file under projects/

Also add the following file to the local repository:

.env.local

SESSIONS_SOURCE='local'
PROJECT_SOURCE='[YOUR EXPORTED PROJECT FILE HERE (i.e. VF-Project-nPDdD6qZJ9.json)]'

AWS_REGION='localhost'

PORT=4000
SESSIONS_DYNAMO_TABLE="none"
VF_DATA_ENDPOINT="none"

INTEGRATIONS_HANDLER_ENDPOINT="none"

LOG_LEVEL="warn"
MIDDLEWARE_VERBOSITY="debug"

ADMIN_SERVER_DATA_API_TOKEN="none"

PG_USERNAME='PG_USERNAME'
PG_HOST='PG_HOST'
PG_DBNAME='PG_DBNAME'
PG_PASSWORD='PG_PASSWORD'
PG_PORT='PG_PORT'

Install a localhost tunnel tool such as ngrok, localtunnel, or bespoken proxy. This will allow you expose a localhost endpoint on the internet for Google Assistant to hit. For the purposes of this guide, we will implement ngrok

Run your local instance of voiceflow/google-runtime with

yarn start:local

This will now be running on port 4000 of localhost. Expose this with

ngrok http 4000

In your shell you will see a link similar to this - https://e9g1335dd0ac.ngrok.io, note this down. Ensure you copy the https:// version instead of http://

On https://console.actions.google.com/ find the action uploaded by the creator tool, click into it. On the left bar, select "Endpoint", it should say something similar to https://google.voiceflow.app/webhook/[versionID]. Replace the https://google.voiceflow.app portion with your own ngrok endpoint. It should end up looking something like this:

Screen Shot 2021-01-25 at 7 17 06 PM (make sure that it ends with /webhook/[versionID])

You should now be able to test your action using the Actions Contol Test tool or on an actual Google Assistant device and see that it is executing on your local machine.

with this .env.local configuration, the code, google, zapier, and API blocks will not work

every time you make changes on Voiceflow that you want to run, you will need to export again, move the project file to /projects and update PROJECT_SOURCE in .env.local and restart voiceflow/google-runtime - finally update the endpoint again on ADC (it will be overwritten by https://google.voiceflow.app again)

google-runtime's People

Contributors

renovate[bot] avatar xavidop avatar leartgjoni-voiceflow avatar decathectzero avatar dependabot[bot] avatar xavientois avatar z4o4z avatar jonahsnider avatar renovate-bot avatar trs avatar viniciusdacal avatar zhihil avatar effervescentia avatar frankgu968 avatar connorbyers avatar nidhigaday avatar mrpicklepinosaur avatar jgoping avatar matheuspoleza avatar vyancharuk avatar vf-service-account 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.