Skip to content

muneebtech07/fulfillment-weather-nodejs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dialogflow Fulfillment Weather Sample Node.js

Setup: WWO Weather API

  1. 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
  2. Paste your API key for the value of the wwoApiKeyvarible on line 20 of functions/index.js

Setup: Dialogflow Agent

  1. Create an account on Dialogflow
  2. Create a new Dialogflow agent
  3. Restore the dialogflow-agent.zip ZIP file in the root of this repo
  4. Go to your agent's settings and then the Export and Import tab
  5. Click the Restore from ZIP button
  6. Select the dialogflow-agent.zip ZIP file in the root of this repo
  7. Type RESTORE and and click the Restore button

Setup: Fulfillment

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:

Option 1: Dialogflow Inline Editor (recommended)

  1. Sign up for or sign into Dialogflow
  2. Create a Dialogflow agent
  3. Enable the Cloud Function for Firebase inline editor
  4. Copy this code in functions/index.js the index.js file in the Dialogflow Cloud Function for Firebase inline editor.
  5. Click Deploy

Option 2: Firebase CLI

  1. Create a Dialogflow agent
  2. Go to your agent's settings and Restore from zip using the advancedAgent.zip in this directory (Note: this will overwrite your existing agent)
  3. cd to the functions directory
  4. Run npm install
  5. Install the Firebase CLI by running npm install -g firebase-tools
  6. Login to your Google account with firebase login
  7. Add your project to the sample with firebase use [project ID] find your project ID here
  8. Run firebase deploy --only functions:dialogflowFirebaseFulfillment and make a note of the URL printed in the console upon deploy.
  9. Set the fulfillment URL in Dialogflow to your Cloud Function for Firebase URL
  10. Go to your agent's fulfillment page
  11. Click the switch to enable webhook for your agent
  12. Enter you Cloud Function for Firebase URL (e.g. https://central-project.cloudfunctions.net/dialogflowFirebaseFulfillment) to the URL field
  13. Click Save at the bottom of the page

References and How to report bugs

How to make contributions?

Please read and follow the steps in the CONTRIBUTING.md.

License

See LICENSE.md.

Terms

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%