Skip to content

clintonfeyi/fulfillment-weather-nodejs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dialogflow Fulfillment: Node.js Weather Sample

Dialogflow and Fulfillment Setup

Select only one of three options below.

Option 1: Add to Dialogflow (recommended)

Select Weather Sample to create a new agent.

  1. Get a WWO Local Weather REST API key from https://developer.worldweatheronline.com/api/
  2. Replace <ENTER_WWO_API_KEY_HERE> with your WWO API key on line 20 of functions/index.js
  3. Select Deploy.

Option 2: Dialogflow Inline Editor

  1. git clone https://github.com/dialogflow/fulfillment-weather-nodejs.git
  2. Create a Dialogflow Agent.
  3. In Dialogflow console > Settings ⚙ > Restore from Zip with weather-agent.zip in this Github repo.A.
  4. Under Fulfillment > Enable Inline Editor.
  5. In the Inline editor > copy the contents of functions/index.js into index.js.
  6. Get a WWO Local Weather REST API key from https://developer.worldweatheronline.com/api/
  7. Replace <ENTER_WWO_API_KEY_HERE> with your WWO API key on line 20 of functions/index.js
  8. Change the name of the function in functions/index.js from dialogflowFulfillmentLibAdvancedSample to dialogflowFirebaseFulfillment
  9. Select Deploy.
  10. In Dialogflow Console > Settings ⚙ > select Google Cloud link in Project ID section. From Google Cloud Platform > menu ☰ > Enable Billing.

A.Note: Restore from Zip will overwrite any existing agent.

Option 3: Firebase CLI

  1. git clone https://github.com/dialogflow/fulfillment-weather-nodejs.git
  2. Create a Dialogflow Agent
  3. In Dialogflow console under Settings ⚙ > Restore from Zip using the weather-agent.zip in this Github repoA.
  4. Get a WWO Local Weather REST API key from https://developer.worldweatheronline.com/api/
  5. Replace <ENTER_WWO_API_KEY_HERE> with your WWO API key on line 20 of functions/index.js
  6. cd to the functions directory
  7. Run npm install
  8. Install the Firebase CLI with npm install -g firebase-tools
  9. Login to your Google account with firebase login
  10. Add your project to the sample with firebase use [project ID]
  • In Dialogflow console under Settings ⚙ > General tab > copy Project ID.
  1. Run firebase deploy --only functions:dialogflowFulfillmentLibAdvancedSample
  2. When successfully deployed, visit the Project Console link > Functions > Dashboard
  • Copy the link under the events column. For example: https://us-central1-<PROJECTID>.cloudfunctions.net/<FUNCTIONNAME>
  1. Back in Dialogflow Console > Fulfullment > Enable Webhook.
  2. Paste the URL from the Firebase Console’s events column into the URL field > Save.
  3. In Dialogflow Console > Settings ⚙ > select Google Cloud link in Project ID section. From Google Cloud Platform > menu ☰ > Enable Billing.

Samples

Name Language
Fulfillment Webhook JSON JSON
Dialogflow Console Template Node.js
Bike Shop-Google Calendar API Node.js
WWO Weather API Node.js
Alexa Importer Node.js
Temperature Trivia Node.js
Human-Agent Node.js
Google Translation API Python
WWO Weather API Python

References & Issues

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

Integrating an API with Dialogflow's Fulfillment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%