From 8bcea44eb3cf931d9ba316b273a59be672d0da63 Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Tue, 24 Jul 2018 09:02:30 -0700 Subject: [PATCH] Move samples to seperate repos, bump version number Change-Id: Ibc8a8f5ad3be9e9c5282d3e7c001cf2c8889a1b0 --- README.md | 2 +- package.json | 2 +- samples/actions-on-google/README.md | 43 ----- .../actions-on-google/dialogflow-agent.zip | Bin 8257 -> 0 bytes .../dialogflow-agent/agent.json | 42 ----- .../intents/Action on Google List Select.json | 35 ----- .../intents/Default Fallback Intent.json | 41 ----- .../intents/Default Welcome Intent.json | 37 ----- .../intents/Other Intent.json | 28 ---- .../intents/Other Intent_usersays_en.json | 14 -- .../dialogflow-agent/package.json | 3 - samples/actions-on-google/firebase.json | 1 - samples/actions-on-google/functions/index.js | 99 ------------ .../actions-on-google/functions/package.json | 21 --- samples/multi-lang-and-locale/README.md | 43 ----- .../dialogflow-agent.zip | Bin 5379 -> 0 bytes .../dialogflow-agent/agent.json | 39 ----- .../intents/Default Fallback Intent.json | 33 ---- .../intents/Default Welcome Intent.json | 37 ----- .../Default Welcome Intent_usersays_en.json | 13 -- .../Default Welcome Intent_usersays_fr.json | 13 -- .../dialogflow-agent/package.json | 3 - samples/multi-lang-and-locale/firebase.json | 1 - .../multi-lang-and-locale/functions/index.js | 60 ------- .../functions/package.json | 21 --- .../README.md | 44 ------ .../dialogflow-agent.zip | Bin 7399 -> 0 bytes .../dialogflow-agent/agent.json | 39 ----- .../entities/absoluteTempUnit.json | 7 - .../entities/absoluteTempUnit_entries_en.json | 18 --- .../dialogflow-agent/entities/unit.json | 7 - .../entities/unit_entries_en.json | 18 --- .../dialogflow-agent/intents/Cancel.json | 35 ----- .../intents/Cancel_usersays_en.json | 38 ----- .../Convert Fahrenheit and Celsius.json | 64 -------- ...rt Fahrenheit and Celsius_usersays_en.json | 139 ---------------- .../intents/Convert Rankine and Kelvin.json | 46 ------ ...onvert Rankine and Kelvin_usersays_en.json | 58 ------- .../intents/Default Fallback Intent.json | 28 ---- .../intents/Default Welcome Intent.json | 32 ---- .../Default Welcome Intent_usersays_en.json | 13 -- .../dialogflow-agent/package.json | 3 - .../firebase.json | 1 - .../functions/index.js | 148 ------------------ .../functions/package.json | 21 --- samples/quick-start/README.md | 48 ------ samples/quick-start/dialogflow-agent.zip | Bin 4006 -> 0 bytes .../quick-start/dialogflow-agent/agent.json | 37 ----- .../intents/Default Fallback Intent.json | 41 ----- .../intents/Default Welcome Intent.json | 37 ----- .../quick-start/dialogflow-agent/package.json | 3 - samples/quick-start/firebase.json | 1 - samples/quick-start/functions/index.js | 62 -------- samples/quick-start/functions/package.json | 21 --- 54 files changed, 2 insertions(+), 1638 deletions(-) delete mode 100644 samples/actions-on-google/README.md delete mode 100644 samples/actions-on-google/dialogflow-agent.zip delete mode 100755 samples/actions-on-google/dialogflow-agent/agent.json delete mode 100755 samples/actions-on-google/dialogflow-agent/intents/Action on Google List Select.json delete mode 100755 samples/actions-on-google/dialogflow-agent/intents/Default Fallback Intent.json delete mode 100755 samples/actions-on-google/dialogflow-agent/intents/Default Welcome Intent.json delete mode 100755 samples/actions-on-google/dialogflow-agent/intents/Other Intent.json delete mode 100755 samples/actions-on-google/dialogflow-agent/intents/Other Intent_usersays_en.json delete mode 100755 samples/actions-on-google/dialogflow-agent/package.json delete mode 100644 samples/actions-on-google/firebase.json delete mode 100644 samples/actions-on-google/functions/index.js delete mode 100644 samples/actions-on-google/functions/package.json delete mode 100644 samples/multi-lang-and-locale/README.md delete mode 100644 samples/multi-lang-and-locale/dialogflow-agent.zip delete mode 100755 samples/multi-lang-and-locale/dialogflow-agent/agent.json delete mode 100755 samples/multi-lang-and-locale/dialogflow-agent/intents/Default Fallback Intent.json delete mode 100755 samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent.json delete mode 100755 samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent_usersays_en.json delete mode 100755 samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent_usersays_fr.json delete mode 100755 samples/multi-lang-and-locale/dialogflow-agent/package.json delete mode 100644 samples/multi-lang-and-locale/firebase.json delete mode 100644 samples/multi-lang-and-locale/functions/index.js delete mode 100644 samples/multi-lang-and-locale/functions/package.json delete mode 100644 samples/parameters-contexts-and-rich-responses/README.md delete mode 100644 samples/parameters-contexts-and-rich-responses/dialogflow-agent.zip delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/agent.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/absoluteTempUnit.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/absoluteTempUnit_entries_en.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/unit.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/unit_entries_en.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Cancel.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Cancel_usersays_en.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Fahrenheit and Celsius.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Fahrenheit and Celsius_usersays_en.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Rankine and Kelvin.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Rankine and Kelvin_usersays_en.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Fallback Intent.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Welcome Intent.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Welcome Intent_usersays_en.json delete mode 100755 samples/parameters-contexts-and-rich-responses/dialogflow-agent/package.json delete mode 100644 samples/parameters-contexts-and-rich-responses/firebase.json delete mode 100644 samples/parameters-contexts-and-rich-responses/functions/index.js delete mode 100644 samples/parameters-contexts-and-rich-responses/functions/package.json delete mode 100644 samples/quick-start/README.md delete mode 100644 samples/quick-start/dialogflow-agent.zip delete mode 100755 samples/quick-start/dialogflow-agent/agent.json delete mode 100755 samples/quick-start/dialogflow-agent/intents/Default Fallback Intent.json delete mode 100755 samples/quick-start/dialogflow-agent/intents/Default Welcome Intent.json delete mode 100755 samples/quick-start/dialogflow-agent/package.json delete mode 100644 samples/quick-start/firebase.json delete mode 100644 samples/quick-start/functions/index.js delete mode 100644 samples/quick-start/functions/package.json diff --git a/README.md b/README.md index 017b73c..fc1c394 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This library is intended to be help building Node.js Dialogflow fulfillment for 1. Create a Dialogflow agent 1. [Enable the Cloud Function for Firebase inline editor](https://dialogflow.com/docs/fulfillment#cloud_functions_for_firebase) 1. Copy this code in `samples/quick-start/functions/index.js` the `index.js` file in the Dialogflow Cloud Function for Firebase inline editor. -1. Add `"dialogflow-fulfillment": "^1.0.0"` to the `package.json` file's `dependencies` object in the Dialogflow Cloud Function for Firebase inline editor. +1. Add `"dialogflow-fulfillment": "^0.5.0"` to the `package.json` file's `dependencies` object in the Dialogflow Cloud Function for Firebase inline editor. 1. Click `Deploy` diff --git a/package.json b/package.json index c697eba..d54cf52 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "dialogflow-fulfillment", "description": "Dialogflow Fulfillment Library for Node.js", "main": "src/dialogflow-fulfillment.js", - "version": "0.4.1", + "version": "0.5.0", "license": "Apache-2.0", "author": "Google Inc.", "directories": { diff --git a/samples/actions-on-google/README.md b/samples/actions-on-google/README.md deleted file mode 100644 index 6ba362b..0000000 --- a/samples/actions-on-google/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Dialogflow Fulfillment Actions on Google Sample - -## Setup -Choose one of the three options listed below for setup. You only need to complete one of the three options below to setup this sample. - -### Option 1: Add to Dialogflow (recommended) -Click on the **Add to Dialogflow** button below and follow the prompts to create a new agent: - -[![Dialogflow Fullfillment: Actions on Google](https://storage.googleapis.com/dialogflow-oneclick/deploy.svg "Dialogflow Fullfillment: Actions on Google")](https://console.dialogflow.com/api-client/oneclick?templateUrl=https%3A%2F%2Fstorage.googleapis.com%2Fdialogflow-oneclick%2Factions-on-google-agent.zip&agentName=ActionsOnGoogleSample) - -### Option 2: Dialogflow Inline Editor -1. [Sign up for or sign into Dialogflow](https://console.dialogflow.com/api-client/#/login) and [create a agent](https://dialogflow.com/docs/agents#create_an_agent) -1. Go to your agent's settings and [Restore from zip](https://dialogflow.com/docs/agents#export_and_import) using the `dialogflow-agent.zip` in this directory (Note: this will overwrite your existing agent) -1. [Enable the Cloud Function for Firebase inline editor](https://dialogflow.com/docs/fulfillment#cloud_functions_for_firebase) -1. Copy this code in `functions/index.js` the `index.js` file in the Dialogflow Cloud Function for Firebase inline editor. -1. Add `"dialogflow-fulfillment": "^0.4.1"` and `"actions-on-google": "^2.1.3"` to the `package.json` file's `dependencies` object in the Dialogflow Cloud Function for Firebase inline editor. -1. Click `Deploy` - -### Option 3: Firebase CLI -1. [Sign up for or sign into Dialogflow](https://console.dialogflow.com/api-client/#/login) and [create a agent](https://dialogflow.com/docs/agents#create_an_agent) -1. Go to your agent's settings and [Restore from zip](https://dialogflow.com/docs/agents#export_and_import) using the `dialogflow-agent.zip` in this directory (Note: this will overwrite your existing agent) -1. `cd` to the `functions` directory -1. Run `npm install` -1. Install the Firebase CLI by running `npm install -g firebase-tools` -1. Login to your Google account with `firebase login` -1. Add your project to the sample with `firebase use [project ID]` [find your project ID here](https://dialogflow.com/docs/agents#settings) -1. Run `firebase deploy --only functions:dialogflowFirebaseFulfillment` -1. Paste the URL into your Dialogflow agent's fulfillment and click `Save` -1. Under the fulfillment section of your `Default Welcome Intent` and `Default Fallback Intent` check the box for `Use webhook` and click `Save` - -## References and How to report bugs -* Dialogflow documentation: [https://docs.dialogflow.com](https://docs.dialogflow.com). -* If you find any issues, please open a bug on [GitHub](https://github.com/dialogflow/dialogflow-fulfillment-nodejs/issues). -* Questions are answered on [StackOverflow](https://stackoverflow.com/questions/tagged/dialogflow). - -## 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](https://developers.google.com/terms/). diff --git a/samples/actions-on-google/dialogflow-agent.zip b/samples/actions-on-google/dialogflow-agent.zip deleted file mode 100644 index 6980265176124f699f274c0ba09a92397f3f0cf0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8257 zcmdT|c_7ql7aqIOVu);)WY02WOR|lvl&-PFP>gNt8KGn=!-U9k>vkz?kv&C1i?Wt2 z30boaLdITH=$lFOOVgzL{nMRchChDKdC&7c=e*~A;D@NF89>BWnsKG>=RdxDFo7T- zTSqGww7s1R+DpR99_8vOc?7W;bjP3dXs93SQ3Tcy2`4T#&1A=1zj z?T#Yiqylj8vC0hPYLIiil>roS5)$(aJ(l2UY6~^l?SZj;o#`{jcn;%K&hj!97|i)g z`Dxjmx@2cB3=;2+*;YzX4T+%gsbS}4?zE0?Yqt)$pA!?O_42WCNa3l_w>RA1B9O<& zs|2wSb^2*qm)jj9cW&*(E~t0TmNjEsuSY!Jrs$t>q9C2BTa#;+S@DKU=ZnOxp4*;j z)G7F}d&&PPGVGuiQlw%U`q&CG)VZu$)%+ewKV5+^s}K952$QVQ<-D|axPGt2rle!k z7Z)nrF8C%AvEE4YRthUnzz@;U%fg(?+X5@-R$8&k(Uj zGm+|5nn^!KqAhxB#{lEr}{f4FltmaI1Rme!V2hjopo7>z^W0hH0~RKgH0 ziaahz&;qMkJ;<=1w={rCAs9;yyTU4EK0>5{j($^Use&AVmeYjauQI|!eoG4%DH(m% zBGkzP?Ml>9E`g-{o)w~w8<`t+NkRNxn@F9>1%u0EA9_<3Tmef^?UGFRb67kfK`g)F z@}O-%|6`A3dVzEMC-FMjCCaKh{@~H(EO9rYvF1wHq5UF;R@O3{lfea2z@1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#{@cOLIBWIj4%y=%J0yj$c^CxO)_o(J|4qNOJdRAx?vkzwg><=6%#^$ zT~h#wWs{HaBU|gMZt*ZrIuZ+CJ?>XEM{H>8xdyr?vVcY7F%QT=uAUPl4X>5LBN|@h z6wU{TwgmG5lcQ*TChL{HUNx!!>{LwchOmF))vQnIYYhM$0(n4SJf?xLb>D6GYA!#q z0)8A1SRODyyi`obrj3vYMgHs1z$>UIAT%D+OHkv6QvGt-+E{vWfEcM5o2|c|-cQ2; zFBXb`aCnS4Bbk&oaD&)biduk}sTfP9jiva1g$Is|K!))cCuTA!uhu;2Tf@e(Rr@Ae zZhd*GY@P8Be3@f?FfKhNIt@WLgIB@~Nfk$5e#%? { - const agent = new WebhookClient({ request, response }); - console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); - console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); - - function googleAssistantOther(agent) { - // Get Actions on Google library conv instance - let conv = agent.conv(); - // Use Actions on Google library to add responses - conv.ask('Please choose an item:'); - conv.ask(new Carousel({ - title: 'Google Assistant', - items: { - 'WorksWithGoogleAssistantItemKey': { - title: 'Works With the Google Assistant', - description: 'If you see this logo, you know it will work with the Google Assistant.', - image: { - url: imageUrl, - accessibilityText: 'Works With the Google Assistant logo', - }, - }, - 'GoogleHomeItemKey': { - title: 'Google Home', - description: 'Google Home is a powerful speaker and voice Assistant.', - image: { - url: imageUrl2, - accessibilityText: 'Google Home' - }, - }, - }, - })); - // Add Actions on Google library responses to your agent's response - agent.add(conv); - } - - function welcome(agent) { - agent.add(`Welcome to my agent!`); - } - - function fallback(agent) { - agent.add(`I didn't understand`); - agent.add(`I'm sorry, can you try again?`); - } - - function other(agent) { - agent.add(`This message is from Dialogflow's Cloud Functions for Firebase editor!`); - agent.add(new Card({ - title: `Title: this is a card title`, - imageUrl: imageUrl, - text: `This is the body text of a card. You can even use line\n breaks and emoji! 💁`, - buttonText: 'This is a button', - buttonUrl: linkUrl - }) - ); - agent.add(new Suggestion(`Quick Reply`)); - agent.add(new Suggestion(`Suggestion`)); - agent.setContext({ name: 'weather', lifespan: 2, parameters: { city: 'Rome' }}); - } - - // Run the proper handler based on the matched Dialogflow intent - let intentMap = new Map(); - intentMap.set('Default Welcome Intent', welcome); - intentMap.set('Default Fallback Intent', fallback); - if (agent.requestSource === agent.ACTIONS_ON_GOOGLE) { - intentMap.set(null, googleAssistantOther); - } else { - intentMap.set(null, other); - } - agent.handleRequest(intentMap); -}); diff --git a/samples/actions-on-google/functions/package.json b/samples/actions-on-google/functions/package.json deleted file mode 100644 index 60339f8..0000000 --- a/samples/actions-on-google/functions/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "dialogflowFirebaseFulfillment", - "description": "Dialogflow Fulfillment Library quick start sample", - "version": "0.0.1", - "private": true, - "license": "Apache Version 2.0", - "author": "Google Inc.", - "engines": { - "node": ">=6.0" - }, - "scripts": { - "start": "firebase serve --only functions:dialogflowFirebaseFulfillment", - "deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment" - }, - "dependencies": { - "firebase-admin": "^5.12.1", - "firebase-functions": "^1.0.3", - "actions-on-google": "^2.1.3", - "dialogflow-fulfillment": "0.4.1" - } -} diff --git a/samples/multi-lang-and-locale/README.md b/samples/multi-lang-and-locale/README.md deleted file mode 100644 index 859f2ff..0000000 --- a/samples/multi-lang-and-locale/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Multi-language and Locale Sample - -## Setup -Choose one of the three options listed below for setup. You only need to complete one of the three options below to setup this sample. - -### Option 1: Add to Dialogflow (recommended) -Click on the **Add to Dialogflow** button below and follow the prompts to create a new agent: - -[![Multi-locale](https://storage.googleapis.com/dialogflow-oneclick/deploy.svg "Multi-locale")](https://console.dialogflow.com/api-client/oneclick?templateUrl=https%3A%2F%2Fstorage.googleapis.com%2Fdialogflow-oneclick%2Fmultilocale-agent.zip&agentName=MultilocaleSample) - -### Option 2: Dialogflow Inline Editor -1. [Sign up for or sign into Dialogflow](https://console.dialogflow.com/api-client/#/login) and [create a agent](https://dialogflow.com/docs/agents#create_an_agent) -1. Go to your agent's settings and [Restore from zip](https://dialogflow.com/docs/agents#export_and_import) using the `dialogflow-agent.zip` in this directory (Note: this will overwrite your existing agent) -1. [Enable the Cloud Function for Firebase inline editor](https://dialogflow.com/docs/fulfillment#cloud_functions_for_firebase) -1. Change the name of the function in `functions/index.js` from `dialogflowFulfillmentMultiLocale` to `dialogflowFirebaseFulfillment` -1. Copy this code in `functions/index.js` the `index.js` file in the Dialogflow Cloud Function for Firebase inline editor. -1. Add `"dialogflow-fulfillment": "^0.4.0"` to the `package.json` file's `dependencies` object in the Dialogflow Cloud Function for Firebase inline editor. -1. Click `Deploy` - -### Option 3: Firebase CLI -1. [Sign up for or sign into Dialogflow](https://console.dialogflow.com/api-client/#/login) and [create a agent](https://dialogflow.com/docs/agents#create_an_agent) -1. Go to your agent's settings and [Restore from zip](https://dialogflow.com/docs/agents#export_and_import) using the `dialogflow-agent.zip` in this directory (Note: this will overwrite your existing agent) -1. `cd` to the `functions` directory -1. Run `npm install` -1. Install the Firebase CLI by running `npm install -g firebase-tools` -1. Login to your Google account with `firebase login` -1. Add your project to the sample with `firebase use [project ID]` [find your project ID here](https://dialogflow.com/docs/agents#settings) -1. Run `firebase deploy --only functions:dialogflowFulfillmentMultiLocale` -1. Paste the URL into your Dialogflow agent's fulfillment - -## References and How to report bugs -* Dialogflow documentation: [https://docs.dialogflow.com](https://docs.dialogflow.com). -* If you find any issues, please open a bug on [GitHub](https://github.com/dialogflow/dialogflow-fulfillment-nodejs/issues). -* Questions are answered on [StackOverflow](https://stackoverflow.com/questions/tagged/dialogflow). - -## 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](https://developers.google.com/terms/). diff --git a/samples/multi-lang-and-locale/dialogflow-agent.zip b/samples/multi-lang-and-locale/dialogflow-agent.zip deleted file mode 100644 index c71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w1mUgCCR@nvIv%5Q zVn%n#Mi$)&05V?K>-S9PRRA_I0LED?ti!eDK!^aa*hg}72SAv)f(%554W!ZiD~kEu z+wpisGiAlQP4}!A+wmJ7WA0<{oq60}bL40g9YO&)kid809O85FUM$@rh@;Rv?}pb4 zaZBmrLeH4f;w1D2BF=>g%c`WNXXPgo@U(=yU4&FZ;^|!{Q<59-7rco?lB;K`Ym$>! zlB>gDW>!{a0?LZy^eTN@VpbZ(v$K;->2;;#xw{evvfUlX#Eb479#AI9kaHcyK%ph!2b1AvwJ&PY-12Pw{nes7r@==ytjqsw+|2uJ01nqn!XIj%o zkL$Xa091`oTS8H3yO5E^EvLfckK*@+MUHPS&|^Ap zyi`CoH#U}3Z@xIBuIw^l!{1@J;dQIiU!R$)toKYhKG1rqa6Vb`Y;09V7mxH8?h?v} zHe9RJQSN&s0SPD6Xja+_SW@;q{RI3(BIp zZ)sA#HE>^^ax7*$!eBkm=ln{t3qT#T*$Y z#RPVW*WJr`h}XHio}Ft<=>T)4~8tsQPXT>N5FbdXiD%_JR3oPHq;#lXs81I{=YZX z#Gecm@H5wy5XAD6rCs9VzEmHHl~<2{)0%rsDdaLa8>jbad3g^5{MX zWH&Piqh^rh8D((#W=dF@K>Gn&15&B^Vt7fz6*W{LX{fYcd;dp`)fU(NB76qZJLRrh zoomD05%Y^ZwC7b#=v2ddscm<>pEy}BglL%&Uz5XP#F%6gz(rvvz$8F?$T~3L*+R2A%2$4l#EHn}4ENuL5ry z2vE2|Div50=dKkn$n+KiJ``&l0gvJVUEECq2yr&0w#IYIpbe7U)S%K!oTiV!3QxV|Jo*1!J({|jo# diff --git a/samples/multi-lang-and-locale/dialogflow-agent/agent.json b/samples/multi-lang-and-locale/dialogflow-agent/agent.json deleted file mode 100755 index 4591d5f..0000000 --- a/samples/multi-lang-and-locale/dialogflow-agent/agent.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "description": "", - "language": "en", - "disableInteractionLogs": false, - "googleAssistant": { - "googleAssistantCompatible": true, - "project": "libsample-multilangandlocale", - "welcomeIntentSignInRequired": false, - "startIntents": [], - "systemIntents": [], - "endIntentIds": [], - "oAuthLinking": { - "required": false, - "grantType": "AUTH_CODE_GRANT" - }, - "voiceType": "MALE_1", - "capabilities": [], - "protocolVersion": "V2", - "autoPreviewEnabled": true - }, - "defaultTimezone": "America/Los_Angeles", - "webhook": { - "url": "https://us-central1-libsample-advanced.cloudfunctions.net/dialogflowFirebaseFulfillment", - "headers": { - "": "" - }, - "available": true, - "useForDomains": false, - "cloudFunctionsEnabled": true, - "cloudFunctionsInitialized": true - }, - "isPrivate": true, - "customClassifierMode": "use.after", - "mlMinConfidence": 0.3, - "supportedLanguages": [ - "fr" - ], - "onePlatformApiVersion": "v2" -} \ No newline at end of file diff --git a/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Fallback Intent.json b/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Fallback Intent.json deleted file mode 100755 index 9484bbe..0000000 --- a/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Fallback Intent.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": "43ca31a7-53ac-4cdb-a3fa-305e14c48c3e", - "name": "Default Fallback Intent", - "auto": false, - "contexts": [], - "responses": [ - { - "resetContexts": false, - "action": "input.unknown", - "affectedContexts": [], - "parameters": [], - "messages": [ - { - "type": 0, - "lang": "fr", - "speech": "webhook a échoué" - }, - { - "type": 0, - "lang": "en", - "speech": "Webhook Failed" - } - ], - "defaultResponsePlatforms": {}, - "speech": [] - } - ], - "priority": 500000, - "webhookUsed": true, - "webhookForSlotFilling": false, - "fallbackIntent": true, - "events": [] -} \ No newline at end of file diff --git a/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent.json b/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent.json deleted file mode 100755 index b4d117d..0000000 --- a/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "id": "2134273f-3417-4b8a-9f59-148572fd2e60", - "name": "Default Welcome Intent", - "auto": true, - "contexts": [], - "responses": [ - { - "resetContexts": false, - "action": "input.welcome", - "affectedContexts": [], - "parameters": [], - "messages": [ - { - "type": 0, - "lang": "fr", - "speech": "webhook a échoué" - }, - { - "type": 0, - "lang": "en", - "speech": "Webhook Failed" - } - ], - "defaultResponsePlatforms": {}, - "speech": [] - } - ], - "priority": 500000, - "webhookUsed": true, - "webhookForSlotFilling": false, - "fallbackIntent": false, - "events": [ - { - "name": "WELCOME" - } - ] -} \ No newline at end of file diff --git a/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent_usersays_en.json b/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent_usersays_en.json deleted file mode 100755 index 5bfd207..0000000 --- a/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent_usersays_en.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - { - "id": "79cef82e-4889-431e-94fa-87e18aa57c52", - "data": [ - { - "text": "hi", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0 - } -] \ No newline at end of file diff --git a/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent_usersays_fr.json b/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent_usersays_fr.json deleted file mode 100755 index dab3351..0000000 --- a/samples/multi-lang-and-locale/dialogflow-agent/intents/Default Welcome Intent_usersays_fr.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - { - "id": "9834e31e-bc3d-407d-b0ed-68e4ce36716c", - "data": [ - { - "text": "salut", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0 - } -] \ No newline at end of file diff --git a/samples/multi-lang-and-locale/dialogflow-agent/package.json b/samples/multi-lang-and-locale/dialogflow-agent/package.json deleted file mode 100755 index 688e939..0000000 --- a/samples/multi-lang-and-locale/dialogflow-agent/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "1.0.0" -} \ No newline at end of file diff --git a/samples/multi-lang-and-locale/firebase.json b/samples/multi-lang-and-locale/firebase.json deleted file mode 100644 index 9e26dfe..0000000 --- a/samples/multi-lang-and-locale/firebase.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/samples/multi-lang-and-locale/functions/index.js b/samples/multi-lang-and-locale/functions/index.js deleted file mode 100644 index 431968e..0000000 --- a/samples/multi-lang-and-locale/functions/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright 2017 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const functions = require('firebase-functions'); -const { WebhookClient } = require('dialogflow-fulfillment'); - -process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements - -exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { - const agent = new WebhookClient({ request, response }); - console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); - console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); - - // English handler functions and intent map - function welcome(agent) { - agent.add(`Welcome to my agent!`); - } - function fallback(agent) { - agent.add(`I didn't understand`); - agent.add(`I'm sorry, can you try again?`); - } - let enIntentMap = new Map(); // Map functions to English Dialogflow intent names - enIntentMap.set('Default Welcome Intent', welcome); - enIntentMap.set('Default Fallback Intent', fallback); - - // French handler functions and intent map - function bienvenue(agent) { - agent.add(`Bienvenue à mon agent!`); - } - function secours(agent) { - agent.add(`Je n'ai pas compris`); - agent.add(`Pouvez-vous essayer encore?`); - } - let frIntentMap = new Map(); // Map functions to French Dialogflow intent names - frIntentMap.set('Default Welcome Intent', bienvenue); - frIntentMap.set('Default Fallback Intent', secours); - - // Chose which intent map to use based on the language of the request - console.log(`Request locale: ${agent.locale}`); - if (agent.locale === 'en') { - agent.handleRequest(enIntentMap); - } else if (agent.locale === 'fr') { - agent.handleRequest(frIntentMap); - } -}); diff --git a/samples/multi-lang-and-locale/functions/package.json b/samples/multi-lang-and-locale/functions/package.json deleted file mode 100644 index 04ec488..0000000 --- a/samples/multi-lang-and-locale/functions/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "dialogflowFirebaseFulfillment", - "description": "Dialogflow Fulfillment Library multi-language and multi-locale sample", - "version": "0.0.1", - "private": true, - "license": "Apache Version 2.0", - "author": "Google Inc.", - "engines": { - "node": ">=6.0" - }, - "scripts": { - "start": "firebase serve --only functions:dialogflowFirebaseFulfillment", - "deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment" - }, - "dependencies": { - "firebase-admin": "^5.12.1", - "firebase-functions": "^1.0.3", - "dialogflow-fulfillment": "^0.4.1", - "actions-on-google": "^2.1.3" - } -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/README.md b/samples/parameters-contexts-and-rich-responses/README.md deleted file mode 100644 index 42666a2..0000000 --- a/samples/parameters-contexts-and-rich-responses/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Temperature Trivia - -## Setup -Choose one of the three options listed below for setup. You only need to complete one of the three options below to setup this sample. - -### Option 1: Add to Dialogflow (recommended) -Click on the **Add to Dialogflow** button below and follow the prompts to create a new agent: - -[![Temperature Trivia](https://storage.googleapis.com/dialogflow-oneclick/deploy.svg "Temperature Trivia")](https://console.dialogflow.com/api-client/oneclick?templateUrl=https%3A%2F%2Fstorage.googleapis.com%2Fdialogflow-oneclick%2Ftemperature-converter-agent.zip&agentName=TemperatureConverterSample) - -### Option 2: Dialogflow Inline Editor -1. [Sign up for or sign into Dialogflow](https://console.dialogflow.com/api-client/#/login) and [create a agent](https://dialogflow.com/docs/agents#create_an_agent) -1. Go to your agent's settings and [Restore from zip](https://dialogflow.com/docs/agents#export_and_import) using the `dialogflow-agent.zip` in this directory (Note: this will overwrite your existing agent) -1. [Enable the Cloud Function for Firebase inline editor](https://dialogflow.com/docs/fulfillment#cloud_functions_for_firebase) -1. Change the name of the function in `functions/index.js` from `dialogflowFulfillmentLibAdvancedSample` to `dialogflowFirebaseFulfillment` -1. Copy this code in `functions/index.js` the `index.js` file in the Dialogflow Cloud Function for Firebase inline editor. -1. Add `"dialogflow-fulfillment": "^0.4.0"` to the `package.json` file's `dependencies` object in the Dialogflow Cloud Function for Firebase inline editor. -1. Click `Deploy` - -### Setup: Firebase CLI (option 2) - -1. [Sign up for or sign into Dialogflow](https://console.dialogflow.com/api-client/#/login) and [create a agent](https://dialogflow.com/docs/agents#create_an_agent) -1. Go to your agent's settings and [Restore from zip](https://dialogflow.com/docs/agents#export_and_import) using the `dialogflow-agent.zip` in this directory (Note: this will overwrite your existing agent) -1. `cd` to the `functions` directory -1. Run `npm install` -1. Install the Firebase CLI by running `npm install -g firebase-tools` -1. Login to your Google account with `firebase login` -1. Add your project to the sample with `firebase use [project ID]` [find your project ID here](https://dialogflow.com/docs/agents#settings) -1. Run `firebase deploy --only functions:dialogflowFulfillmentLibAdvancedSample` -1. Paste the URL into your Dialogflow agent's fulfillment - -## References and How to report bugs -* Dialogflow documentation: [https://docs.dialogflow.com](https://docs.dialogflow.com). -* If you find any issues, please open a bug on [GitHub](https://github.com/dialogflow/dialogflow-fulfillment-nodejs/issues). -* Questions are answered on [StackOverflow](https://stackoverflow.com/questions/tagged/dialogflow). - -## 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](https://developers.google.com/terms/). diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent.zip b/samples/parameters-contexts-and-rich-responses/dialogflow-agent.zip deleted file mode 100644 index ede813e7fc710bfe1e812c4812f8a9f556fc46ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001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)lTwO->ZWz;lw7}z-jNNOqMWEyu86zqaQ@1x3RE$v>ndLd|wsP zt~_w{-F8suKU}gp$AE2M7#rvebi9~m{{c4zb1R=qe4Oq zBGfmIUeYUmhd^?dqZIbvS)AZ1PR|J4k&7G)R&?gy!A{QTe+r21WEqYHoFGOE zc$)1$Jri_O#(WHz{Om8_f0T8yEj}F`-2(9*Lq`JtjecCW|I_-QcXiTZfnv`63Uth0 z{m%L{BY?hNIY=?kZNcdq7QOk>9pht)4so(Y_?_9Wt%~0L=#RmkCqrX)N*_NR7ri%e u9K&7s6Yjq|>FFWRo5%TMA)b+=QAcZe=vcUThi!xu^@gE-v!pou>;C`+JNlOZ diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/agent.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/agent.json deleted file mode 100755 index 186442b..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/agent.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "description": "", - "language": "en", - "disableInteractionLogs": false, - "googleAssistant": { - "googleAssistantCompatible": true, - "project": "libsample-advanced", - "welcomeIntentSignInRequired": false, - "startIntents": [], - "systemIntents": [], - "endIntentIds": [ - "736b2be9-7526-4f76-91ca-e16f46ea2cca" - ], - "oAuthLinking": { - "required": false, - "grantType": "AUTH_CODE_GRANT" - }, - "voiceType": "MALE_1", - "capabilities": [], - "protocolVersion": "V2", - "autoPreviewEnabled": true - }, - "defaultTimezone": "America/Los_Angeles", - "webhook": { - "url": "https://us-central1-libsample-advanced.cloudfunctions.net/dialogflowFirebaseFulfillment", - "headers": { - "": "" - }, - "available": true, - "useForDomains": false, - "cloudFunctionsEnabled": true, - "cloudFunctionsInitialized": true - }, - "isPrivate": true, - "customClassifierMode": "use.after", - "mlMinConfidence": 0.3, - "supportedLanguages": [], - "onePlatformApiVersion": "v2" -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/absoluteTempUnit.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/absoluteTempUnit.json deleted file mode 100755 index 32ada23..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/absoluteTempUnit.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "bced28ff-00a9-44bc-80f7-ca2ff085f636", - "name": "absoluteTempUnit", - "isOverridable": true, - "isEnum": false, - "automatedExpansion": false -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/absoluteTempUnit_entries_en.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/absoluteTempUnit_entries_en.json deleted file mode 100755 index de7f662..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/absoluteTempUnit_entries_en.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "value": "Kelvin", - "synonyms": [ - "Kelvin", - "K", - "kelvin" - ] - }, - { - "value": "Rankine", - "synonyms": [ - "Rankine", - "R", - "rankine" - ] - } -] \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/unit.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/unit.json deleted file mode 100755 index d55cf74..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/unit.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "d2e0852d-a8fd-4d5b-a014-bf609dd9f445", - "name": "unit", - "isOverridable": true, - "isEnum": false, - "automatedExpansion": false -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/unit_entries_en.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/unit_entries_en.json deleted file mode 100755 index 181403e..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/entities/unit_entries_en.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "value": "Celsius", - "synonyms": [ - "Celsius", - "C", - "celsius" - ] - }, - { - "value": "Fahrenheit", - "synonyms": [ - "Fahrenheit", - "F", - "fahrenheit" - ] - } -] \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Cancel.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Cancel.json deleted file mode 100755 index d722adc..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Cancel.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "id": "736b2be9-7526-4f76-91ca-e16f46ea2cca", - "name": "Cancel", - "auto": true, - "contexts": [], - "responses": [ - { - "resetContexts": false, - "action": "cancel", - "affectedContexts": [ - { - "name": "temperature", - "parameters": {}, - "lifespan": 0 - } - ], - "parameters": [], - "messages": [ - { - "type": 0, - "lang": "en", - "speech": "Goodbye!" - } - ], - "defaultResponsePlatforms": {}, - "speech": [] - } - ], - "priority": 500000, - "webhookUsed": false, - "webhookForSlotFilling": false, - "lastUpdate": 1517002931, - "fallbackIntent": false, - "events": [] -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Cancel_usersays_en.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Cancel_usersays_en.json deleted file mode 100755 index 6c3c89d..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Cancel_usersays_en.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - { - "id": "090fe506-4c96-4330-9664-477b518d718c", - "data": [ - { - "text": "Exit", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0, - "updated": 1517002931 - }, - { - "id": "0bea9d01-7206-4389-9e9d-d7db36cb53c1", - "data": [ - { - "text": "Quit", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0, - "updated": 1517002931 - }, - { - "id": "b36b3d02-3569-489b-a254-63fd8a950c3f", - "data": [ - { - "text": "Cancel", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0, - "updated": 1517002931 - } -] \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Fahrenheit and Celsius.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Fahrenheit and Celsius.json deleted file mode 100755 index 83048b1..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Fahrenheit and Celsius.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "id": "a7e72b1d-225b-47ec-95ff-8e7ca3a12138", - "name": "Convert Fahrenheit and Celsius", - "auto": true, - "contexts": [], - "responses": [ - { - "resetContexts": false, - "action": "convert.common.temperature", - "affectedContexts": [ - { - "name": "temperature", - "parameters": {}, - "lifespan": 1 - } - ], - "parameters": [ - { - "id": "f0256fcd-8ef7-4de6-a027-060ff032d2f0", - "required": true, - "dataType": "@sys.number", - "name": "temperature", - "value": "$temperature", - "prompts": [ - { - "lang": "en", - "value": "What temperature would you like to convert?" - } - ], - "isList": false - }, - { - "id": "35303e91-1bb2-4bad-8b37-71dd34f7d54f", - "required": true, - "dataType": "@unit", - "name": "unit", - "value": "$unit", - "prompts": [ - { - "lang": "en", - "value": "Fahrenheit or Celsius?" - } - ], - "isList": false - } - ], - "messages": [ - { - "type": 0, - "lang": "en", - "speech": "Webhook Failed" - } - ], - "defaultResponsePlatforms": {}, - "speech": [] - } - ], - "priority": 500000, - "webhookUsed": true, - "webhookForSlotFilling": false, - "lastUpdate": 1517002171, - "fallbackIntent": false, - "events": [] -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Fahrenheit and Celsius_usersays_en.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Fahrenheit and Celsius_usersays_en.json deleted file mode 100755 index ee6a017..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Fahrenheit and Celsius_usersays_en.json +++ /dev/null @@ -1,139 +0,0 @@ -[ - { - "id": "c103174e-530f-4bbc-8afc-08db0f438bee", - "data": [ - { - "text": "27", - "alias": "temperature", - "meta": "@sys.number", - "userDefined": false - }, - { - "text": "°", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0 - }, - { - "id": "0ea802b7-5bcb-47b9-9c6e-c178ee32919f", - "data": [ - { - "text": "30", - "alias": "temperature", - "meta": "@sys.number", - "userDefined": true - }, - { - "text": " degrees", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0 - }, - { - "id": "cc81c27c-c714-4d8d-9c00-42710b683b35", - "data": [ - { - "text": "25", - "alias": "temperature", - "meta": "@sys.number", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0 - }, - { - "id": "ad5f4fed-4f1f-479b-bf0e-e2eefed09d7c", - "data": [ - { - "text": "How about ", - "userDefined": false - }, - { - "text": "45", - "alias": "temperature", - "meta": "@sys.number", - "userDefined": true - }, - { - "text": " degrees?", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0 - }, - { - "id": "6354925c-bf9c-4a5a-93d5-a1599051c65e", - "data": [ - { - "text": "27", - "alias": "temperature", - "meta": "@sys.number", - "userDefined": false - }, - { - "text": "° ", - "userDefined": false - }, - { - "text": "Celsius", - "alias": "unit", - "meta": "@unit", - "userDefined": true - } - ], - "isTemplate": false, - "count": 0 - }, - { - "id": "bd6fb6a7-bf35-409e-a2f3-dcc72b3bb696", - "data": [ - { - "text": "-40", - "alias": "temperature", - "meta": "@sys.number", - "userDefined": true - }, - { - "text": "° ", - "userDefined": false - }, - { - "text": "Fahrenheit", - "alias": "unit", - "meta": "@unit", - "userDefined": true - } - ], - "isTemplate": false, - "count": 0 - }, - { - "id": "c76b7675-a35b-48bd-bb4a-227aa40a436b", - "data": [ - { - "text": "45", - "alias": "temperature", - "meta": "@sys.number", - "userDefined": true - }, - { - "text": " degrees ", - "userDefined": false - }, - { - "text": "Celsius", - "alias": "unit", - "meta": "@unit", - "userDefined": true - } - ], - "isTemplate": false, - "count": 0 - } -] \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Rankine and Kelvin.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Rankine and Kelvin.json deleted file mode 100755 index 3991fc7..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Rankine and Kelvin.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "id": "78b4b898-d06d-461b-845b-1ee8dd5d6158", - "name": "Convert Rankine and Kelvin", - "auto": true, - "contexts": [ - "temperature" - ], - "responses": [ - { - "resetContexts": false, - "action": "convert.absolute.temperature", - "affectedContexts": [], - "parameters": [ - { - "id": "be3f3214-fdcf-4e2b-b057-7b0ae133e01d", - "required": true, - "dataType": "@absoluteTempUnit", - "name": "absoluteTempUnit", - "value": "$absoluteTempUnit", - "prompts": [ - { - "lang": "en", - "value": "Rankine or Kelvin?" - } - ], - "isList": false - } - ], - "messages": [ - { - "type": 0, - "lang": "en", - "speech": "Webhook Failed" - } - ], - "defaultResponsePlatforms": {}, - "speech": [] - } - ], - "priority": 500000, - "webhookUsed": true, - "webhookForSlotFilling": false, - "lastUpdate": 1517002804, - "fallbackIntent": false, - "events": [] -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Rankine and Kelvin_usersays_en.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Rankine and Kelvin_usersays_en.json deleted file mode 100755 index fed2084..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Convert Rankine and Kelvin_usersays_en.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "id": "360a5438-1113-4a65-8697-281d6773da90", - "data": [ - { - "text": "Kelvin", - "alias": "absoluteTempUnit", - "meta": "@absoluteTempUnit", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0, - "updated": 1517002804 - }, - { - "id": "9e035726-eb5f-4a7d-a8e8-ca2e09e58c4f", - "data": [ - { - "text": "Rankine", - "alias": "absoluteTempUnit", - "meta": "@absoluteTempUnit", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0, - "updated": 1517002804 - }, - { - "id": "b18572f8-1921-463e-9751-1dddca9d907b", - "data": [ - { - "text": "K", - "alias": "absoluteTempUnit", - "meta": "@absoluteTempUnit", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0, - "updated": 1517002804 - }, - { - "id": "55e31bdf-a41a-4884-8264-6f8d4114a6d6", - "data": [ - { - "text": "R", - "alias": "absoluteTempUnit", - "meta": "@absoluteTempUnit", - "userDefined": false - } - ], - "isTemplate": false, - "count": 2, - "updated": 1517002804 - } -] \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Fallback Intent.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Fallback Intent.json deleted file mode 100755 index 33385bb..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Fallback Intent.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": "296423e9-f6b2-4483-81c1-4462ae455719", - "name": "Default Fallback Intent", - "auto": false, - "contexts": [], - "responses": [ - { - "resetContexts": false, - "action": "input.unknown", - "affectedContexts": [], - "parameters": [], - "messages": [ - { - "type": 0, - "lang": "en", - "speech": "Webhook Failed" - } - ], - "defaultResponsePlatforms": {}, - "speech": [] - } - ], - "priority": 500000, - "webhookUsed": true, - "webhookForSlotFilling": false, - "fallbackIntent": true, - "events": [] -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Welcome Intent.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Welcome Intent.json deleted file mode 100755 index 0838201..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Welcome Intent.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "id": "37873ae7-a618-4462-a67d-8877e2128fa0", - "name": "Default Welcome Intent", - "auto": true, - "contexts": [], - "responses": [ - { - "resetContexts": false, - "action": "input.welcome", - "affectedContexts": [], - "parameters": [], - "messages": [ - { - "type": 0, - "lang": "en", - "speech": "Webhook Failed" - } - ], - "defaultResponsePlatforms": {}, - "speech": [] - } - ], - "priority": 500000, - "webhookUsed": true, - "webhookForSlotFilling": false, - "fallbackIntent": false, - "events": [ - { - "name": "WELCOME" - } - ] -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Welcome Intent_usersays_en.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Welcome Intent_usersays_en.json deleted file mode 100755 index 25d77d1..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/intents/Default Welcome Intent_usersays_en.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - { - "id": "759c6964-a552-40db-a12f-bf75a1ca99ff", - "data": [ - { - "text": "hi", - "userDefined": false - } - ], - "isTemplate": false, - "count": 0 - } -] \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/package.json b/samples/parameters-contexts-and-rich-responses/dialogflow-agent/package.json deleted file mode 100755 index 688e939..0000000 --- a/samples/parameters-contexts-and-rich-responses/dialogflow-agent/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "1.0.0" -} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/firebase.json b/samples/parameters-contexts-and-rich-responses/firebase.json deleted file mode 100644 index 9e26dfe..0000000 --- a/samples/parameters-contexts-and-rich-responses/firebase.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/samples/parameters-contexts-and-rich-responses/functions/index.js b/samples/parameters-contexts-and-rich-responses/functions/index.js deleted file mode 100644 index 10d37ab..0000000 --- a/samples/parameters-contexts-and-rich-responses/functions/index.js +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Copyright 2017 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const functions = require('firebase-functions'); -const {WebhookClient} = require('dialogflow-fulfillment'); -const {Text, Card, Image, Suggestion, Payload} = require('dialogflow-fulfillment'); - -process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements - -// Wikipedia link and image URLs -const wikipediaTemperatureUrl = 'https://en.wikipedia.org/wiki/Temperature'; -const wikipediaTemperatureImageUrl = 'https://upload.wikimedia.org/wikipedia/commons/2/23/Thermally_Agitated_Molecule.gif'; -const wikipediaCelsiusUrl = 'https://en.wikipedia.org/wiki/Celsius'; -const wikipediaCelsiusImageUrl = 'https://upload.wikimedia.org/wikipedia/commons/a/ad/Celsius_original_thermometer.png'; -const wikipediaFahrenheitUrl = 'https://en.wikipedia.org/wiki/Fahrenheit'; -const wikipediaFahrenheitImageUrl = 'https://upload.wikimedia.org/wikipedia/commons/b/bd/Fahrenheit_small.jpg'; -const wikipediaKelvinUrl = 'https://en.wikipedia.org/wiki/Kelvin'; -const wikipediaKelvinImageUrl = 'https://upload.wikimedia.org/wikipedia/commons/a/a0/Lord_Kelvin_photograph.jpg'; -const wikipediaRankineUrl = 'https://en.wikipedia.org/wiki/Rankine_scale'; -const wikipediaRankineImageUrl = 'https://upload.wikimedia.org/wikipedia/commons/5/58/Rankine_William_signature.jpg'; - -exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { - const agent = new WebhookClient({ request, response }); - console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); - console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); - - function welcome(agent) { - agent.add('Welcome to the temperature converter!'); - agent.add(new Card({ - title: 'Vibrating molecules', - imageUrl: wikipediaTemperatureImageUrl, - text: 'Did you know that temperature is really just a measure of how fast molecules are vibrating around?! 😱', - buttonText: 'Temperature Wikipedia Page', - buttonUrl: wikipediaTemperatureUrl - }) - ); - agent.add('I can convert Celsius to Fahrenheit and Fahrenheit to Celsius! What temperature would you like to convert?'); - agent.add(new Suggestion('27° Celsius')); - agent.add(new Suggestion('-40° Fahrenheit')); - agent.add(new Suggestion('Cancel')); - } - - function convertFahrenheitAndCelsius(agent) { - // Get parameters from Dialogflow to convert - const temperature = agent.parameters.temperature; - const unit = agent.parameters.unit; - console.log(`User requested to convert ${temperature}° ${unit}`); - - let convertedTemp, convertedUnit, temperatureHistory; - if (unit === 'Celsius') { - convertedTemp = temperature*(9/5) + 32; - convertedUnit = 'Fahrenheit'; - temperatureHistory = new Card({ - title: 'Fahrenheit', - imageUrl: wikipediaFahrenheitImageUrl, - text: 'Daniel Gabriel Fahrenheit, invented the Fahrenheit scale (first widely used, standardized temperature scale) and the mercury thermometer.', - buttonText: 'Fahrenheit Wikipedia Page', - buttonUrl: wikipediaFahrenheitUrl - }); - } else if (unit === 'Fahrenheit') { - convertedTemp = (temperature-32)*(5/9); - convertedUnit = 'Celsius'; - temperatureHistory = new Card({ - title: 'Celsius', - imageUrl: wikipediaCelsiusImageUrl, - text: 'The original Celsius thermometer had a reversed scale, where 100 is the freezing point of water and 0 is its boiling point.', - buttonText: 'Celsius Wikipedia Page', - buttonUrl: wikipediaCelsiusUrl - }); - } - - // Sent the context to store the parameter information - // and make sure the followup Rankine - agent.setContext({ - name: 'temperature', - lifespan: 1, - parameters:{temperature: temperature, unit: unit} - }); - - // Compile and send response - agent.add(`${temperature}° ${unit} is ${convertedTemp}° ${convertedUnit}`); - agent.add(temperatureHistory); - agent.add('Would you like to know what this temperature is in Kelvin or Rankine?'); - agent.add(new Suggestion('Kelvin')); - agent.add(new Suggestion('Rankine')); - agent.add(new Suggestion('Cancel')); - } - - function convertRankineAndKelvin(agent) { - const secondUnit = agent.parameters.absoluteTempUnit; - const tempContext = agent.getContext('temperature'); - const originalTemp = tempContext.parameters.temperature; - const originalUnit = tempContext.parameters.unit; - - // Convert temperature - let convertedTemp, convertedUnit, temperatureHistoryText, temperatureHistoryImage; - if (secondUnit === 'Kelvin') { - convertedTemp = originalTemp === 'Celsius' ? originalTemp + 273.15 : (originalTemp-32)*(5/9) + 273.15; - convertedUnit = 'Kelvin'; - temperatureHistoryText = 'Here is a picture of the namesake of the Rankine unit, William John Macquorn Rankine:'; - temperatureHistoryImage = new Image(wikipediaKelvinImageUrl); - } else if (secondUnit === 'Rankine') { - convertedTemp = originalTemp === 'Fahrenheit' ? originalTemp + 459.67 : originalTemp*(9/5) + 32 + 459.67; - convertedUnit = 'Rankine'; - temperatureHistoryText = 'Here is a picture of the namesake of the Kelvin unit, Lord Kelvin:'; - temperatureHistoryImage = new Image(wikipediaRankineImageUrl); - } - - // Set `temperature` context lifetime to zero - // to reset the conversational state and parameters - agent.setContext({name: 'temperature', lifespan: 0}); - - // Compile and send response - agent.add(`${originalTemp}° ${originalUnit} is ${convertedTemp}° ${convertedUnit}. ` + temperatureHistoryText); - agent.add(new Image(temperatureHistoryImage)); - agent.add('Go ahead and say another temperature to get the conversion.'); - agent.add(new Suggestion('27° Celsius')); - agent.add(new Suggestion('-40° Fahrenheit')); - agent.add(new Suggestion('Cancel')); - } - - function fallback(agent) { - agent.add('Woah! Its getting a little hot in here.'); - agent.add(`I didn't get that, can you try again?`); - } - - let intentMap = new Map(); // Map functions to Dialogflow intent names - intentMap.set('Default Welcome Intent', welcome); - intentMap.set('Convert Fahrenheit and Celsius', convertFahrenheitAndCelsius); - intentMap.set('Convert Rankine and Kelvin', convertRankineAndKelvin); - intentMap.set('Default Fallback Intent', fallback); - agent.handleRequest(intentMap); -}); diff --git a/samples/parameters-contexts-and-rich-responses/functions/package.json b/samples/parameters-contexts-and-rich-responses/functions/package.json deleted file mode 100644 index 1c740b3..0000000 --- a/samples/parameters-contexts-and-rich-responses/functions/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "dialogflowFirebaseFulfillment", - "description": "Dialogflow Fulfillment Library Sample for parameters, contexts and rich responses", - "version": "0.0.1", - "private": true, - "license": "Apache Version 2.0", - "author": "Google Inc.", - "engines": { - "node": ">=6.0" - }, - "scripts": { - "start": "firebase serve --only functions:dialogflowFirebaseFulfillment", - "deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment" - }, - "dependencies": { - "firebase-admin": "^5.12.1", - "firebase-functions": "^1.0.3", - "dialogflow-fulfillment": "^0.4.1", - "actions-on-google": "^2.1.3" - } -} \ No newline at end of file diff --git a/samples/quick-start/README.md b/samples/quick-start/README.md deleted file mode 100644 index cf361dd..0000000 --- a/samples/quick-start/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Getting Started Sample - -## Setup -Choose one of the three options listed below for setup. You only need to complete one of the three options below to setup this sample. - -### Option 1: Add to Dialogflow (recommended) -Click on the **Add to Dialogflow** button below and follow the prompts to create a new agent: - -[![Getting Started](https://storage.googleapis.com/dialogflow-oneclick/deploy.svg "Getting Started")](https://console.dialogflow.com/api-client/oneclick?templateUrl=https%3A%2F%2Fstorage.googleapis.com%2Fdialogflow-oneclick%2Fquickstart-agent.zip&agentName=QuickStartSample) - -### Option 2: Dialogflow Inline Editor -1. [Sign up for or sign into Dialogflow](https://console.dialogflow.com/api-client/#/login) and [create a agent](https://dialogflow.com/docs/agents#create_an_agent) -1. Go to your agent's settings and [Restore from zip](https://dialogflow.com/docs/agents#export_and_import) using the `dialogflow-agent.zip` in this directory (Note: this will overwrite your existing agent) -1. [Enable the Cloud Function for Firebase inline editor](https://dialogflow.com/docs/fulfillment#cloud_functions_for_firebase) -1. Copy this code in `functions/index.js` the `index.js` file in the Dialogflow Cloud Function for Firebase inline editor. -1. Add `"dialogflow-fulfillment": "^0.4.0"` to the `package.json` file's `dependencies` object in the Dialogflow Cloud Function for Firebase inline editor. -1. Click `Deploy` - -### Option 3: Firebase CLI -1. [Sign up for or sign into Dialogflow](https://console.dialogflow.com/api-client/#/login) and [create a agent](https://dialogflow.com/docs/agents#create_an_agent) -1. Go to your agent's settings and [Restore from zip](https://dialogflow.com/docs/agents#export_and_import) using the `dialogflow-agent.zip` in this directory (Note: this will overwrite your existing agent) -1. `cd` to the `functions` directory -1. Run `npm install` -1. Install the Firebase CLI by running `npm install -g firebase-tools` -1. Login to your Google account with `firebase login` -1. Add your project to the sample with `firebase use [project ID]` [find your project ID here](https://dialogflow.com/docs/agents#settings) -1. Run `firebase deploy --only functions:dialogflowFirebaseFulfillment` -1. Paste the URL into your Dialogflow agent's fulfillment and click `Save` -1. Under the fulfillment section of your `Default Welcome Intent` and `Default Fallback Intent` check the box for `Use webhook` and click `Save` - -## References and How to report bugs -* Dialogflow documentation: [https://docs.dialogflow.com](https://docs.dialogflow.com). -* If you find any issues, please open a bug on [GitHub](https://github.com/dialogflow/dialogflow-fulfillment-nodejs/issues). -* Questions are answered on [StackOverflow](https://stackoverflow.com/questions/tagged/dialogflow). - -## 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](https://developers.google.com/terms/). -e -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](https://developers.google.com/terms/). diff --git a/samples/quick-start/dialogflow-agent.zip b/samples/quick-start/dialogflow-agent.zip deleted file mode 100644 index 077e87f5926c1314d3099f60c3655d1d860cf72e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4006 zcmdT`dpwi-A0NYJn_RZ#vJytRFrkjqMOkiVSX*{vi9BPjGjc`D=~<>c0qsLn+Fp4ExRj{JV-&z`-W*YnyR-}mS9d4JyD&*x3Ihs)q# zNboo8k?sJ4JSdnFjOF7M7((*r1qC`WF|a`EA(!R)PhFS?817sKHAsVusTfSG;W#k8f0g#D(3X1>3ON2*wbTBV6S$0jK}?@Cbw_P2J)RFV#t=4&T8 zVC{AphoUd;o+LPRoK$ZQzu>=r|EA>DE$yy#M~logYMmTCZicN8Hf+ppUNpp8TkXI_ z>?|1Xzq}x3RH}d=TQsq+aa^`B0@Ja!ZE@S{ZkO2d(<8-%^=-U2j{4}aB?U&qqt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uwsV1nzSeX>psugHmE^ouc9Mm?E04b!#m;^8^6+w zkm9Uveyp+KyR&M$4%SbGd#e9z|ED?S`}p*om-?iOPbL;WEcKSFe(17*R`kmU+fDKz z^_+a`7)cGqj+#1_OZ;@VPEVL zG%4}ugW3jF2#SE;2BJ*YMRK1X@M~^khA1Jq3cPtU%jh#tVogb=1l@5&NJ>Kf8wkR@ z+eotBx%;RL0iPnDlY`VNnWuPZO6Ccrjs$@c@cZV1`X38aGUb^@LnoImB#w~Zi { - const agent = new WebhookClient({ request, response }); - console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); - console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); - - function welcome(agent) { - agent.add(`Welcome to my agent!`); - } - - function fallback(agent) { - agent.add(`I didn't understand`); - agent.add(`I'm sorry, can you try again?`); - } - - // // Uncomment and edit to make your own intent handler - // // uncomment `intentMap.set('your intent name here', yourFunctionHandler);` - // // below to get this funciton to be run when a Dialogflow intent is matched - // function yourFunctionHandler(agent) { - // agent.add(`This message is from Dialogflow's Cloud Functions for Firebase editor!`); - // agent.add(new Card({ - // title: `Title: this is a card title`, - // imageUrl: 'https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png', - // text: `This is the body text of a card. You can even use line\n breaks and emoji! 💁`, - // buttonText: 'This is a button', - // buttonUrl: 'https://assistant.google.com/' - // }) - // ); - // agent.add(new Suggestion(`Quick Reply`)); - // agent.add(new Suggestion(`Suggestion`)); - // agent.setContext({ name: 'weather', lifespan: 2, parameters: { city: 'Rome' }}); - // } - - // Run the proper function handler based on the matched Dialogflow intent name - let intentMap = new Map(); - intentMap.set('Default Welcome Intent', welcome); - intentMap.set('Default Fallback Intent', fallback); - // intentMap.set('your intent name here', yourFunctionHandler); - agent.handleRequest(intentMap); -}); diff --git a/samples/quick-start/functions/package.json b/samples/quick-start/functions/package.json deleted file mode 100644 index 7810bde..0000000 --- a/samples/quick-start/functions/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "dialogflowFirebaseFulfillment", - "description": "Dialogflow Fulfillment Library quick start sample", - "version": "0.0.1", - "private": true, - "license": "Apache Version 2.0", - "author": "Google Inc.", - "engines": { - "node": ">=6.0" - }, - "scripts": { - "start": "firebase serve --only functions:dialogflowFirebaseFulfillment", - "deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment" - }, - "dependencies": { - "firebase-admin": "^5.12.1", - "firebase-functions": "^1.0.3", - "dialogflow-fulfillment": "^0.4.1", - "actions-on-google": "^2.1.3" - } -} \ No newline at end of file