Skip to content

Google assistant bot that knows about holidays in Argentina

License

Notifications You must be signed in to change notification settings

eisenjulian/holidays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Holiday Pal

Google assistant bot that knows about holidays in Argentina based on api.ai and Google Cloud Functions

Requirements

  1. Install Node.js
  2. Install Google Cloud SDK
  3. Install ngrok to test locally
  4. Create an api.ai account
  5. Have or create a Google Cloud Project with Cloud Functions API and billing enabled

Setup

$ git clone https://github.com/eisenjulian/holidays.git
$ cd holidays
$ # install dependencies
$ npm install
$ # install cloud functions emulator
$ npm install -g @google-cloud/functions-emulator
$ gloud init
$ gcloud components update && gcloud components install beta
$ gcloud config set project <project_id>
$ # create a bucket in Google Cloud Storage to store files: if you use a different name update package.json
$ gsutil mb gs://holiday-bot-bucket
$ # deploy your cloud function
$ # in the logs you will get the URL for your cloud function to use in the api.ai integrations page
$ npm run deploy
  1. Use the Actions on Google Console to add a new project with a name of your choosing.
  2. Click "Use API.AI" and then "Create Actions on API.AI" which will redirect you to api.ai.
  3. Click "Save" to save the project.
  4. Click on the gear icon to see the project settings.
  5. Select "Export and Import".
  6. Select "Restore from zip". Follow the directions to restore from the holidayPal.zip in this repo.
  7. In the Fulfillment page of the API.AI console, enable Webhook, set the URL to the hosting URL, then save.
  8. Open API.AI's Integrations page, open the Settings menu for Actions on Google, then click Test.
  9. Click View to open the Actions on Google simulator.
  10. Type "Talk to my test app" in the simulator, or say "OK Google, talk to my test app" to any Actions on Google enabled device signed into your developer account.

To update the Cloud Function

$ npm run deploy

To test locally

$ functions start
$ npm run start
$ <ngrok_location>/ngrok http 8010

You will get a URL that looks like https://XXXXXX.ngrok.io/<you-project>/<your-zone>/holidayPal that points to your local server and where changes are updated immediately. Go to your api.ai agent integrations page and update the webhook. Don't forget to change it back when you're done testing

Acknowledgements

About

Google assistant bot that knows about holidays in Argentina

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published