Rock-paper-scissors for DialogFlow
The chatbot application is written in the cross-platform Jovo Framework.
The primary goal of this project was not to implement a game, but to learn about Google DialogFlow, Actions, Functions and Jovo Framework.
Although this could be added relatively easy, there is currently no support to run this application as an Alexa Skill.
Prerequisites for building, running and deploying
In order to build this application and deploy it your own Google Cloud environment, here's what you need:
- Docker Community Edition >= version 17.03.0-ce
- docker-compose >= 1.11.2
- a Google Cloud account, plus
[~]$ mkdir mydir [~]$ cd mydir [mydir]$ git clone https://github.com/fdurant/dialogflow-rock-paper-scissors.git [mydir]$ cp /mydownloads/service_account.json . [mydir]$ pico .env (see immediately below)
Structure of the .env file inside mydir
PROJECTNAME=<projectname> PROJECTID=<projectid> AGENTNAME=<agentname> GOOGLE_APPLICATION_CREDENTIALS=/run/secrets/google_service_account.json
- <projectname> is the name of the Google Cloud Project containing the Dialogflow agent
- <projectid> is the identifier of the Google Cloud Project containing the Dialogflow agent
- <agentname> is the name of the Dialogflow Agent
Build, package, deploy and run the application on Google Cloud
[mydir]$ docker-compose up -d --build jovo
To force a redeployment, even when no application code has changed:
[mydir]$ FORCERERUNFROMHERE=`date -Iseconds` docker-compose up -d --build jovo