Skip to content

Commit

Permalink
Including samples
Browse files Browse the repository at this point in the history
Change-Id: I96cd2695297b3432712f5afd38a37023aa6dc6c1
  • Loading branch information
Sarah Dwyer committed Oct 2, 2018
1 parent 13fbf03 commit f5a62d3
Showing 1 changed file with 28 additions and 42 deletions.
70 changes: 28 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:

<a href="https://console.dialogflow.com/api-client/oneclick?templateUrl=https://oneclickgithub.appspot.com/dialogflow/fulfillment-weather-nodejs&agentName=WeatherSample" target="blank">
 <img src="https://dialogflow.com/images/deploy.png">
Expand All @@ -15,65 +15,51 @@ 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.<sup>A.</sup>
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**.


<sup>A.</sup>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 repo<sup>A.</sup>
### 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 <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**.
+ 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-<PROJECTID>.cloudfunctions.net/<FUNCTIONNAME>`
+ Copy the link under the events column.
+ For example: `https://us-central1-<PROJECTID>.cloudfunctions.net/<FUNCTIONNAME>`
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
Expand Down

0 comments on commit f5a62d3

Please sign in to comment.