From f5a62d3f370800cb9afc911e82c190368993f3f6 Mon Sep 17 00:00:00 2001 From: Sarah Dwyer Date: Fri, 28 Sep 2018 11:54:53 -0700 Subject: [PATCH] Including samples Change-Id: I96cd2695297b3432712f5afd38a37023aa6dc6c1 --- README.md | 70 ++++++++++++++++++++++--------------------------------- 1 file changed, 28 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 9b86a46..5b0966e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Dialogflow Fulfillment: Node.js Weather Sample ## Dialogflow and Fulfillment Setup -Select **only one** of three options below. +Select **only one** of the options below. -### Option 1: Add to Dialogflow (recommended) -To create this agent from our template, click: +### Option 1: Add to Dialogflow (Recommended) +To create this agent from our template:   @@ -15,25 +15,10 @@ To create this agent from our template, click: 3. Select **Deploy**. 4. In Dialogflow Console > **Settings** ⚙ > select **Google Cloud** link in Project ID section. From Google Cloud Platform > **menu** ☰ > **Enable Billing**. -### Option 2: Dialogflow Inline Editor -1. `git clone https://github.com/dialogflow/fulfillment-weather-nodejs.git` -2. Create a [Dialogflow Agent](https://console.dialogflow.com/). -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 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](https://console.dialogflow.com/) -3. In Dialogflow console under **Settings** ⚙ > [Restore from Zip](https://dialogflow.com/docs/agents#export_and_import) using the `weather-agent.zip` in this Github repoA. +### Option 2: Firebase CLI +1. Create a [Dialogflow Agent](https://console.dialogflow.com/) +2. `git clone https://github.com/dialogflow/fulfillment-weather-nodejs.git` +3. In Dialogflow console under **Settings** ⚙ > [Restore from Zip](https://dialogflow.com/docs/agents#export_and_import) using the `weather-agent.zip` in this directory. 4. Get a WWO Local Weather REST API key from https://developer.worldweatheronline.com/api/ 5. Replace with your WWO API key on line 20 of `functions/index.js` 6. `cd` to the `functions` directory @@ -41,39 +26,40 @@ To create this agent from our template, click: 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**. + + In Dialogflow console under **Settings** ⚙ > **General** tab > copy **Project ID**. 11. Run `firebase deploy --only functions:dialogflowFulfillmentLibAdvancedSample` 12. When successfully deployed, visit the **Project Console** link > **Functions** > **Dashboard** - + Copy the link under the events column. For example: `https://us-central1-.cloudfunctions.net/` + + Copy the link under the events column. + + For example: `https://us-central1-.cloudfunctions.net/` 13. Back in Dialogflow Console > **Fulfullment** > **Enable** Webhook. 14. Paste the URL from the Firebase Console’s events column into the **URL** field > **Save**. 15. In Dialogflow Console > **Settings** ⚙ > select **Google Cloud** link in Project ID section. From Google Cloud Platform > **menu** ☰ > **Enable Billing**. -## Samples +## Related Samples -| Name | Language | -| ------------------------------------ |:---------------------------------| -| [Fulfillment Webhook JSON](https://github.com/dialogflow/fulfillment-webhook-json)| JSON | -| [Fulfillment & Firestore](https://github.com/dialogflow/fulfillment-firestore-nodejs) | Node.js | -| [Dialogflow Console Template](https://github.com/dialogflow/fulfillment-webhook-nodejs)| Node.js -| [Bike Shop-Google Calendar API](https://github.com/dialogflow/fulfillment-bike-shop-nodejs)| Node.js| +| Name | Language | +| ------------- |:-------------:| +| [Fulfillment & Regex Validation](https://github.com/dialogflow/fulfillment-regex-nodejs) | Node.js | +| [Weather: Fulfillment & WWO API](https://github.com/dialogflow/fulfillment-weather-nodejs) | Node.js | +| [Bike Shop: Fulfillment & Google Calendar API](https://github.com/dialogflow/fulfillment-bike-shop-nodejs)| Node.js | +| [Temperature Trivia: Fulfillment & Actions on Google](https://github.com/dialogflow/fulfillment-temperature-converter-nodejs) | Node.js | +| [Fulfillment & Actions on Google](https://github.com/dialogflow/fulfillment-actions-library-nodejs) | Node.js | +| [Fulfillment & Firestore Database](https://github.com/dialogflow/fulfillment-firestore-nodejs) | Node.js | | [Multi-language/locale](https://github.com/dialogflow/fulfillment-multi-locale-nodejs) | Node.js | -| [WWO Weather API](https://github.com/dialogflow/fulfillment-weather-nodejs)| Node.js | +| [Basic Slot Filling](https://github.com/dialogflow/fulfillment-slot-filling-nodejs) | Node.js | | [Alexa Importer](https://github.com/dialogflow/fulfillment-importer-nodejs) | Node.js | -| [Temperature Trivia](https://github.com/dialogflow/fulfillment-temperature-converter-nodejs) | Node.js | -| [Human-Agent](https://github.com/dialogflow/agent-human-handoff-nodejs) | Node.js | -| [Google Translation API](https://github.com/dialogflow/fulfillment-translate-python) | Python | -| [WWO Weather API](https://github.com/dialogflow/fulfillment-weather-python) | Python | + +For Fulfillment Webhook [JSON Requests & Responses](https://github.com/dialogflow/fulfillment-webhook-json). ## References & Issues -* Questions? Try [StackOverflow](https://stackoverflow.com/questions/tagged/dialogflow). -* Find a bug? Report it on [GitHub](https://github.com/dialogflow/fulfillment-webhook-json/issues). -* Dialogflow [Documentation](https://dialogflow.com/docs/getting-started/basics). -* For more info on [Cloud Functions for Firebase Inline Editor](https://dialogflow.com/docs/fulfillment#cloud_functions_for_firebase). -* For more info about [billing](https://dialogflow.com/docs/concepts/google-projects-faq). ++ Questions? Try [StackOverflow](https://stackoverflow.com/questions/tagged/dialogflow) or [Dialogflow Developer Community](https://plus.google.com/communities/103318168784860581977). ++ For bugs, please report an issue on [Github](https://github.com/dialogflow/dialogflow-fulfillment-nodejs/issues). ++ Dialogflow [Documentation](https://docs.dialogflow.com). ++ Dialogflow [Classes Reference Doc](https://github.com/dialogflow/dialogflow-fulfillment-nodejs/tree/master/docs). ++ For more info about [billing](https://dialogflow.com/docs/concepts/google-projects-faq). -## How to make contributions? +## Make Contributions Please read and follow the steps in the CONTRIBUTING.md. ## License