- Get a WWO API key, by going to https://developer.worldweatheronline.com/api/ and following the instructions to get an API key that includes forecasts 14 days into the future
- Paste your API key for the value of the
wwoApiKey
varible on line 20 offunctions/index.js
- Create an account on Dialogflow
- Create a new Dialogflow agent
- Restore the
dialogflow-agent.zip
ZIP file in the root of this repo - Go to your agent's settings and then the Export and Import tab
- Click the Restore from ZIP button
- Select the
dialogflow-agent.zip
ZIP file in the root of this repo - Type RESTORE and and click the Restore button
Choose between using Dialogflow's inline editor (recommended) or Firebase's CLI to setup fulfillment for you Dialogflow agent. Do only one of the following:
- Sign up for or sign into Dialogflow
- Create a Dialogflow agent
- Enable the Cloud Function for Firebase inline editor
- Copy this code in
functions/index.js
theindex.js
file in the Dialogflow Cloud Function for Firebase inline editor. - Click
Deploy
- Create a Dialogflow agent
- Go to your agent's settings and Restore from zip using the
advancedAgent.zip
in this directory (Note: this will overwrite your existing agent) cd
to thefunctions
directory- Run
npm install
- Install the Firebase CLI by running
npm install -g firebase-tools
- Login to your Google account with
firebase login
- Add your project to the sample with
firebase use [project ID]
find your project ID here - Run
firebase deploy --only functions:dialogflowFirebaseFulfillment
and make a note of the URL printed in the console upon deploy. - Set the fulfillment URL in Dialogflow to your Cloud Function for Firebase URL
- Go to your agent's fulfillment page
- Click the switch to enable webhook for your agent
- Enter you Cloud Function for Firebase URL (e.g.
https://central-project.cloudfunctions.net/dialogflowFirebaseFulfillment
) to the URL field - Click Save at the bottom of the page
- Dialogflow documentation: https://docs.dialogflow.com.
- If you find any issues, please open a bug on GitHub.
- Questions are answered on StackOverflow.
Please read and follow the steps in the CONTRIBUTING.md.
See LICENSE.md.
Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service.