├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── daily-updates ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Confirm Daily Updates Subscription.json │ │ │ ├── Daily Lowest Temperature.json │ │ │ ├── Daily Lowest Temperature_usersays_en.json │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ ├── Subscribe to Daily Updates.json │ │ │ └── Subscribe to Daily Updates_usersays_en.json │ │ └── package.json │ └── test │ │ ├── dftest.sh │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Confirm_Daily_Updates_Subscription │ ├── req.json │ └── res.json │ ├── Daily_Lowest_Temperature │ ├── req.json │ └── res.json │ ├── Default_Welcome_Intent │ ├── req.json │ └── res.json │ ├── Subscribe_to_Daily_Updates │ ├── req.json │ └── res.json │ └── happy_path.js ├── dftest.sh ├── exits ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ └── Exit Conversation.json │ │ └── package.json │ └── test │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Exit_Conversation │ ├── req.json │ └── res.json │ └── happy_path.js ├── guest-users ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ ├── Save Preference.json │ │ │ └── Save Preference_usersays_en.json │ │ └── package.json │ └── test │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Guest_Save │ ├── req.json │ └── res.json │ ├── Guest_Welcome │ ├── req.json │ └── res.json │ ├── Verified_Save │ ├── req.json │ └── res.json │ ├── Verified_Welcome │ ├── req.json │ └── res.json │ └── happy_path.js ├── helpers ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Confirmation Handler.json │ │ │ ├── Confirmation.json │ │ │ ├── Confirmation_usersays_en.json │ │ │ ├── Date Time Handler.json │ │ │ ├── Date Time.json │ │ │ ├── Date Time_usersays_en.json │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ ├── Permission Handler.json │ │ │ ├── Permission.json │ │ │ ├── Permission_usersays_en.json │ │ │ ├── Place Handler.json │ │ │ ├── Place.json │ │ │ └── Place_usersays_en.json │ │ └── package.json │ └── test │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Confirmation │ ├── req.json │ └── res.json │ ├── Confirmation_Handler │ ├── req.json │ └── res.json │ ├── Date_Time │ ├── req.json │ └── res.json │ ├── Date_Time_Handler │ ├── req.json │ └── res.json │ ├── Permission │ ├── req.json │ └── res.json │ ├── Permission_Handler │ ├── req.json │ └── res.json │ ├── Place │ ├── req.json │ └── res.json │ ├── Place_Handler │ ├── req.json │ └── res.json │ └── happy_path.js ├── notifications ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Confirm Notifications Subscription.json │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ ├── Notification.json │ │ │ ├── Notification_usersays_en.json │ │ │ ├── Subscribe to Notifications.json │ │ │ └── Subscribe to Notifications_usersays_en.json │ │ └── package.json │ └── test │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Confirm_Notifications_Subscription │ ├── req.json │ └── res.json │ ├── Default_Welcome_Intent │ ├── req.json │ └── res.json │ ├── Subscribe_to_Notifications │ ├── req.json │ └── res.json │ └── happy_path.js ├── reprompts ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ └── Reprompt.json │ │ └── package.json │ └── test │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Reprompt_1 │ ├── req.json │ └── res.json │ ├── Reprompt_2 │ ├── req.json │ └── res.json │ ├── Reprompt_3 │ ├── req.json │ └── res.json │ └── happy_path.js ├── responses ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Advanced Table Card.json │ │ │ ├── Advanced Table Card_usersays_en.json │ │ │ ├── Basic Card.json │ │ │ ├── Basic Card_usersays_en.json │ │ │ ├── Browsing Carousel.json │ │ │ ├── Browsing Carousel_usersays_en.json │ │ │ ├── Carousel - OPTION.json │ │ │ ├── Carousel.json │ │ │ ├── Carousel_usersays_en.json │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ ├── List - OPTION.json │ │ │ ├── List.json │ │ │ ├── List_usersays_en.json │ │ │ ├── Media Response.json │ │ │ ├── Media Response_usersays_en.json │ │ │ ├── Media Status.json │ │ │ ├── SSML.json │ │ │ ├── SSML_usersays_en.json │ │ │ ├── Simple Response.json │ │ │ ├── Simple Response_usersays_en.json │ │ │ ├── Simple Table Card.json │ │ │ ├── Simple Table Card_usersays_en.json │ │ │ ├── Suggestion Chips.json │ │ │ ├── Suggestion Chips_usersays_en.json │ │ │ ├── Tapped Suggestion.json │ │ │ └── Tapped Suggestion_usersays_en.json │ │ └── package.json │ └── test │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Advanced_Table_Card │ ├── req.json │ └── res.json │ ├── Basic_Card │ ├── req.json │ └── res.json │ ├── Browsing_Carousel │ ├── req.json │ └── res.json │ ├── Carousel │ ├── req.json │ └── res.json │ ├── Carousel_-_OPTION │ ├── req.json │ └── res.json │ ├── List │ ├── req.json │ └── res.json │ ├── List_-_OPTION │ ├── req.json │ └── res.json │ ├── Media_Response │ ├── req.json │ └── res.json │ ├── Media_Status │ ├── req.json │ └── res.json │ ├── SSML │ ├── req.json │ └── res.json │ ├── Simple_Response │ ├── req.json │ └── res.json │ ├── Simple_Table_Card │ ├── req.json │ └── res.json │ ├── Suggestion_Chips │ ├── req.json │ └── res.json │ └── happy_path.js ├── save-data ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ ├── Don_t Save Sum.json │ │ │ ├── Don_t Save Sum_usersays_en.json │ │ │ ├── Forget Number.json │ │ │ ├── Forget Number_usersays_en.json │ │ │ ├── Get First Number.json │ │ │ ├── Get First Number_usersays_en.json │ │ │ ├── Get Second Number.json │ │ │ ├── Get Second Number_usersays_en.json │ │ │ ├── Save Sum.json │ │ │ └── Save Sum_usersays_en.json │ │ └── package.json │ └── test │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Default_Welcome_Intent │ ├── req.json │ └── res.json │ ├── Forget_Number │ ├── req.json │ └── res.json │ ├── Get_First_Number │ ├── req.json │ └── res.json │ ├── Get_Second_Number │ ├── req.json │ └── res.json │ ├── Save_Sum │ ├── req.json │ └── res.json │ ├── Save_Sum_Guest │ ├── req.json │ └── res.json │ └── happy_path.js ├── surface-capabilities ├── dialogflow │ ├── agent.zip │ ├── agent │ │ ├── agent.json │ │ ├── intents │ │ │ ├── Audio Only Intent.json │ │ │ ├── Audio Only Intent_usersays_en.json │ │ │ ├── Current Capabilities.json │ │ │ ├── Current Capabilities_usersays_en.json │ │ │ ├── Default Fallback Intent.json │ │ │ ├── Default Welcome Intent.json │ │ │ ├── Default Welcome Intent_usersays_en.json │ │ │ ├── Media Only Intent.json │ │ │ ├── Media Only Intent_usersays_en.json │ │ │ ├── Screen Only Intent.json │ │ │ ├── Screen Only Intent_usersays_en.json │ │ │ ├── Transfer Surface - NEW_SURFACE.json │ │ │ ├── Transfer Surface.json │ │ │ ├── Transfer Surface_usersays_en.json │ │ │ ├── Web Only Capability.json │ │ │ └── Web Only Capability_usersays_en.json │ │ └── package.json │ └── test │ │ └── dialog.csv ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── index.js │ ├── package.json │ └── test │ ├── Current_Capabilities │ ├── req.json │ └── res.json │ ├── Transfer_Surface │ ├── req.json │ └── res.json │ ├── Transfer_Surface_-_NEW_SURFACE │ ├── req.json │ └── res.json │ ├── Transfer_Surface_-_Screen │ ├── req.json │ └── res.json │ └── happy_path.js └── transactions ├── dialogflow ├── agent.zip ├── agent │ ├── agent.json │ ├── intents │ │ ├── Default Fallback Intent.json │ │ ├── Default Welcome Intent.json │ │ ├── Delivery Address Complete.json │ │ ├── Delivery Address.json │ │ ├── Delivery Address_usersays_en.json │ │ ├── Send Order Update.json │ │ ├── Send Order Update_usersays_en.json │ │ ├── Sign In Complete.json │ │ ├── Sign In.json │ │ ├── Sign In_usersays_en.json │ │ ├── Transaction Check Complete.json │ │ ├── Transaction Check Google.json │ │ ├── Transaction Check Google_usersays_en.json │ │ ├── Transaction Check Merchant.json │ │ ├── Transaction Check Merchant_usersays_en.json │ │ ├── Transaction Decision Complete.json │ │ ├── Transaction Decision.json │ │ └── Transaction Decision_usersays_en.json │ └── package.json └── test │ ├── dftest.sh │ └── dialog.csv ├── firebase.json └── functions ├── .eslintrc.json ├── index.js ├── package.json └── test ├── Delivery_Address ├── req.json └── res.json ├── Delivery_Address_Complete ├── req.json └── res.json ├── Sign_In ├── req.json └── res.json ├── Sign_In_Complete ├── req.json └── res.json ├── Transaction_Check_Complete ├── req.json └── res.json ├── Transaction_Check_Google ├── req.json └── res.json ├── Transaction_Check_Merchant ├── req.json └── res.json ├── Transaction_Decision ├── req.json └── res.json ├── Transaction_Decision_Complete ├── req.json └── res.json └── happy_path.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | package-lock.json 3 | yarn.lock 4 | .firebaserc 5 | *.DS_Store 6 | *.log 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to become a contributor and submit your own code 2 | 3 | ## Contributor License Agreements 4 | 5 | We'd love to accept your sample apps and patches! Before we can take them, we 6 | have to jump a couple of legal hurdles. 7 | 8 | Please fill out either the individual or corporate Contributor License Agreement 9 | (CLA). 10 | 11 | * If you are an individual writing original source code and you're sure you 12 | own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). 13 | * If you work for a company that wants to allow you to contribute your work, 14 | then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). 15 | 16 | Follow either of the two links above to access the appropriate CLA and 17 | instructions for how to sign and return it. Once we receive it, we'll be able to 18 | accept your pull requests. 19 | 20 | ## Contributing A Patch 21 | 22 | 1. Submit an issue describing your proposed change to the repo in question. 23 | 1. The repo owner will respond to your issue promptly. 24 | 1. If your proposed change is accepted, and you haven't already done so, sign a 25 | Contributor License Agreement (see details above). 26 | 1. Fork the desired repo, develop and test your code changes. 27 | 1. Ensure that your code adheres to the existing style in the sample to which 28 | you are contributing. Refer to the 29 | [Google Cloud Platform Samples Style Guide](https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the 30 | recommended coding standards for this organization. 31 | 1. Ensure that your code has an appropriate set of unit tests which all pass. 32 | 1. Submit a pull request. 33 | -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/daily-updates/dialogflow/agent.zip -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [ 14 | { 15 | "intentId": "6c5d9338-389e-4e22-8f85-72664c4b81b0", 16 | "signInRequired": false 17 | } 18 | ], 19 | "systemIntents": [], 20 | "endIntentIds": [], 21 | "oAuthLinking": { 22 | "required": false, 23 | "providerId": "", 24 | "authorizationUrl": "", 25 | "tokenUrl": "", 26 | "scopes": "", 27 | "privacyPolicyUrl": "", 28 | "grantType": "AUTH_CODE_GRANT" 29 | }, 30 | "voiceType": "MALE_1", 31 | "capabilities": [], 32 | "env": "", 33 | "protocolVersion": "V2", 34 | "autoPreviewEnabled": false, 35 | "isDeviceAgent": false 36 | }, 37 | "defaultTimezone": "America/Denver", 38 | "webhook": { 39 | "url": "https://us-central1-PROJECT-ID.cloudfunctions.net/dialogflowFirebaseFulfillment", 40 | "username": "", 41 | "headers": { 42 | "": "" 43 | }, 44 | "available": true, 45 | "useForDomains": false, 46 | "cloudFunctionsEnabled": false, 47 | "cloudFunctionsInitialized": false 48 | }, 49 | "isPrivate": true, 50 | "customClassifierMode": "use.after", 51 | "mlMinConfidence": 0.3, 52 | "supportedLanguages": [], 53 | "onePlatformApiVersion": "v2", 54 | "analyzeQueryTextSentiment": false, 55 | "enabledKnowledgeBaseNames": [], 56 | "knowledgeServiceConfidenceAdjustment": -0.4, 57 | "dialogBuilderMode": false, 58 | "baseActionPackagesUrl": "" 59 | } -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/intents/Confirm Daily Updates Subscription.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "77be28a0-cb7c-443f-902a-e315d6c85309", 3 | "name": "Confirm Daily Updates Subscription", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": [] 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [ 27 | { 28 | "name": "actions_intent_REGISTER_UPDATE" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/intents/Daily Lowest Temperature.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "6c5d9338-389e-4e22-8f85-72664c4b81b0", 3 | "name": "Daily Lowest Temperature", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": [] 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/intents/Daily Lowest Temperature_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "8d01af7a-d313-4274-9768-af3e5d150869", 4 | "data": [ 5 | { 6 | "text": "hear the lowest temperature for ", 7 | "userDefined": false 8 | }, 9 | { 10 | "text": "today", 11 | "meta": "@sys.ignore", 12 | "userDefined": false 13 | } 14 | ], 15 | "isTemplate": false, 16 | "count": 0, 17 | "updated": 0 18 | }, 19 | { 20 | "id": "5cc6d237-d23f-45a0-973f-e36c01877d84", 21 | "data": [ 22 | { 23 | "text": "hear the lowest temperature for the day", 24 | "userDefined": false 25 | } 26 | ], 27 | "isTemplate": false, 28 | "count": 0, 29 | "updated": 0 30 | }, 31 | { 32 | "id": "0f30f517-ac5e-4f1b-8410-3f2663d80164", 33 | "data": [ 34 | { 35 | "text": "lowest temperature for ", 36 | "userDefined": false 37 | }, 38 | { 39 | "text": "today", 40 | "meta": "@sys.ignore", 41 | "userDefined": false 42 | } 43 | ], 44 | "isTemplate": false, 45 | "count": 0, 46 | "updated": 0 47 | }, 48 | { 49 | "id": "af1cb682-b178-4363-8245-feec5b0a3d22", 50 | "data": [ 51 | { 52 | "text": "lowest daily temperature", 53 | "userDefined": false 54 | } 55 | ], 56 | "isTemplate": false, 57 | "count": 0, 58 | "updated": 0 59 | }, 60 | { 61 | "id": "2af506ee-e236-4703-8b6b-9c8633548a90", 62 | "data": [ 63 | { 64 | "text": "lowest temperature", 65 | "userDefined": false 66 | } 67 | ], 68 | "isTemplate": false, 69 | "count": 0, 70 | "updated": 0 71 | }, 72 | { 73 | "id": "15113638-dbd7-4356-af88-627e66b5399a", 74 | "data": [ 75 | { 76 | "text": "Hear lowest temperature", 77 | "userDefined": false 78 | } 79 | ], 80 | "isTemplate": false, 81 | "count": 0, 82 | "updated": 0 83 | } 84 | ] -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "c685e103-e922-4cbc-aabb-ee669fa88288", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [ 17 | "I didn\u0027t get that. Can you say it again?", 18 | "I missed what you said. What was that?", 19 | "Sorry, could you say that again?", 20 | "Sorry, can you say that again?", 21 | "Can you say that again?", 22 | "Sorry, I didn\u0027t get that. Can you rephrase?", 23 | "Sorry, what was that?", 24 | "One more time?", 25 | "What was that?", 26 | "Say that one more time?", 27 | "I didn\u0027t get that. Can you repeat?", 28 | "I missed that, say that again?" 29 | ] 30 | } 31 | ], 32 | "defaultResponsePlatforms": {}, 33 | "speech": [] 34 | } 35 | ], 36 | "priority": 500000, 37 | "webhookUsed": false, 38 | "webhookForSlotFilling": false, 39 | "fallbackIntent": true, 40 | "events": [] 41 | } -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "5b02f307-fdb9-45e0-b84e-1a599c7fde12", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [], 13 | "defaultResponsePlatforms": {}, 14 | "speech": [] 15 | } 16 | ], 17 | "priority": 500000, 18 | "webhookUsed": true, 19 | "webhookForSlotFilling": false, 20 | "fallbackIntent": false, 21 | "events": [ 22 | { 23 | "name": "WELCOME" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/intents/Subscribe to Daily Updates.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "c5b19840-ffaf-42ec-9a0d-222da9d90b75", 3 | "name": "Subscribe to Daily Updates", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": [] 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/intents/Subscribe to Daily Updates_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "4c9f58bb-87ee-43c8-90ae-8a08bda40253", 4 | "data": [ 5 | { 6 | "text": "subscribe to daily updates", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "73dc300c-68e5-48f1-a46d-7f267282610e", 16 | "data": [ 17 | { 18 | "text": "end updates", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "900e0a46-9d5e-4fe2-bbb4-e83f7ffbcea2", 28 | "data": [ 29 | { 30 | "text": "daily updates", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "198b73da-0df0-4a3d-a518-512b1bc82840", 40 | "data": [ 41 | { 42 | "text": "Send daily updates", 43 | "userDefined": false 44 | } 45 | ], 46 | "isTemplate": false, 47 | "count": 0, 48 | "updated": 0 49 | } 50 | ] -------------------------------------------------------------------------------- /daily-updates/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /daily-updates/dialogflow/test/dftest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Keep track of PWD, before switching to script directory 4 | # All commands are run relative to script directory 5 | OLD_DIR=$PWD 6 | CURRENT_DIR=$(dirname "$BASH_SOURCE") 7 | cd $CURRENT_DIR 8 | 9 | # Unzip zipped agent to ensure same as unzipped 10 | echo "Checking zipped and unzipped agents are identical..." 11 | unzip ../agent.zip -d _test_unzipped > /dev/null 2>&1 12 | agent_diff=$(diff -r _test_unzipped ../agent) 13 | if [[ $? != 0 ]]; then 14 | echo "Error: Make sure the zipped and unzipped agents are identical" 15 | rm -rf _test_unzipped 16 | exit 1 17 | fi 18 | echo "Success: Agents are identical" 19 | rm -rf _test_unzipped 20 | 21 | # Check whether strings match intents as intended 22 | # Currently does a very naive grep for string inclusion 23 | dialog=dialog.csv 24 | all_intents_matched=true 25 | OLDIFS=$IFS 26 | IFS=, 27 | while read training_phrase intent 28 | do 29 | echo "Checking phrase $training_phrase matches $intent..." 30 | # Get matched filename as a string 31 | matched_path=$(grep $training_phrase ../agent/intents/$intent.json) 32 | if [[ $? != 0 ]]; then 33 | echo "Error: Intent not matched for $training_phrase" 34 | all_intents_matched=false 35 | fi 36 | done < $dialog 37 | 38 | if [[ $all_intents_matched = true ]]; then 39 | echo "Success: dialog.csv matched all intents" 40 | fi 41 | IFS=$OLDIFS 42 | 43 | cd $OLD_DIR -------------------------------------------------------------------------------- /daily-updates/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | Hear lowest temperature,Daily Lowest Temperature_usersays_en 2 | Send daily updates,Subscribe to Daily Updates_usersays_en 3 | actions_intent_REGISTER_UPDATE,Confirm Daily Updates Subscription 4 | -------------------------------------------------------------------------------- /daily-updates/firebase.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /daily-updates/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /daily-updates/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "daily-updates", 3 | "description": "Sample of daily updates", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0" 21 | }, 22 | "devDependencies": { 23 | "ava": "^2.1.0", 24 | "eslint": "^6.0.1", 25 | "eslint-config-google": "^0.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /daily-updates/functions/test/Confirm_Daily_Updates_Subscription/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": false, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Ok, I'll start giving you daily updates." 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /daily-updates/functions/test/Daily_Lowest_Temperature/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "The lowest temperature for today is 75 degrees Fahrenheit" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "I can send you daily updates with the lowest temperature of the day. Would you like that?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "Send daily updates" 21 | } 22 | ] 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /daily-updates/functions/test/Default_Welcome_Intent/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Hi! Welcome to Lowest Temperature Updates! I can tell you the lowest temperature each day." 10 | } 11 | } 12 | ], 13 | "suggestions": [ 14 | { 15 | "title": "Hear lowest temperature" 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /daily-updates/functions/test/Subscribe_to_Daily_Updates/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.REGISTER_UPDATE", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.RegisterUpdateValueSpec", 9 | "intent": "Daily Lowest Temperature", 10 | "triggerContext": { 11 | "timeContext": { 12 | "frequency": "DAILY" 13 | } 14 | } 15 | } 16 | } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /daily-updates/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /dftest.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | #!/bin/bash 16 | 17 | # Keep track of PWD, before switching to script directory 18 | # All commands are run relative to script directory 19 | OLD_DIR=$PWD 20 | CURRENT_DIR=$(dirname "$BASH_SOURCE") 21 | cd $CURRENT_DIR 22 | 23 | for sample_dir in $CURRENT_DIR/*/ 24 | do 25 | # Unzip zipped agent to ensure same as unzipped 26 | echo "Testing directory: $sample_dir" 27 | echo "Checking zipped and unzipped agents are identical..." 28 | unzip $sample_dir/dialogflow/agent.zip -d _test_unzipped > /dev/null 2>&1 29 | agent_diff=$(diff -r _test_unzipped $sample_dir/dialogflow/agent) 30 | if [[ $? != 0 ]]; then 31 | echo "Error: Make sure the zipped and unzipped agents are identical" 32 | rm -rf _test_unzipped 33 | exit 1 34 | fi 35 | echo "Success: Agents are identical" 36 | rm -rf _test_unzipped 37 | 38 | # Check whether strings match intents as intended 39 | # Currently does a very naive grep for string inclusion 40 | dialog=$sample_dir/dialogflow/test/dialog.csv 41 | all_intents_matched=true 42 | OLDIFS=$IFS 43 | IFS=, 44 | while read training_phrase intent 45 | do 46 | echo "Checking phrase $training_phrase matches $intent..." 47 | # Get matched filename as a string 48 | matched_path=$(grep $training_phrase $sample_dir/dialogflow/agent/intents/$intent.json) 49 | if [[ $? != 0 ]]; then 50 | echo "Error: Intent not matched for $training_phrase" 51 | all_intents_matched=false 52 | fi 53 | done < $dialog 54 | 55 | if [[ $all_intents_matched = true ]]; then 56 | echo "Success: dialog.csv matched all intents" 57 | echo 58 | else 59 | exit 1 60 | fi 61 | IFS=$OLDIFS 62 | 63 | cd $OLD_DIR 64 | done 65 | -------------------------------------------------------------------------------- /exits/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/exits/dialogflow/agent.zip -------------------------------------------------------------------------------- /exits/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [], 14 | "systemIntents": [], 15 | "endIntentIds": [], 16 | "oAuthLinking": { 17 | "required": false, 18 | "providerId": "", 19 | "authorizationUrl": "", 20 | "tokenUrl": "", 21 | "scopes": "", 22 | "privacyPolicyUrl": "", 23 | "grantType": "AUTH_CODE_GRANT" 24 | }, 25 | "voiceType": "MALE_1", 26 | "capabilities": [], 27 | "env": "", 28 | "protocolVersion": "V2", 29 | "autoPreviewEnabled": true, 30 | "isDeviceAgent": false 31 | }, 32 | "defaultTimezone": "America/Denver", 33 | "webhook": { 34 | "url": "https://example.com", 35 | "username": "", 36 | "headers": { 37 | "": "" 38 | }, 39 | "available": true, 40 | "useForDomains": false, 41 | "cloudFunctionsEnabled": false, 42 | "cloudFunctionsInitialized": false 43 | }, 44 | "isPrivate": true, 45 | "customClassifierMode": "use.after", 46 | "mlMinConfidence": 0.3, 47 | "supportedLanguages": [], 48 | "onePlatformApiVersion": "v2", 49 | "analyzeQueryTextSentiment": false, 50 | "enabledKnowledgeBaseNames": [], 51 | "knowledgeServiceConfidenceAdjustment": -0.4, 52 | "dialogBuilderMode": false, 53 | "baseActionPackagesUrl": "" 54 | } -------------------------------------------------------------------------------- /exits/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "efeccc9b-f53c-42ad-b1b2-ed21088f00f6", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [ 17 | "I didn\u0027t get that. Can you say it again?", 18 | "I missed what you said. What was that?", 19 | "Sorry, could you say that again?", 20 | "Sorry, can you say that again?", 21 | "Can you say that again?", 22 | "Sorry, I didn\u0027t get that. Can you rephrase?", 23 | "Sorry, what was that?", 24 | "One more time?", 25 | "What was that?", 26 | "Say that one more time?", 27 | "I didn\u0027t get that. Can you repeat?", 28 | "I missed that, say that again?" 29 | ] 30 | } 31 | ], 32 | "defaultResponsePlatforms": {}, 33 | "speech": [] 34 | } 35 | ], 36 | "priority": 500000, 37 | "webhookUsed": false, 38 | "webhookForSlotFilling": false, 39 | "fallbackIntent": true, 40 | "events": [] 41 | } -------------------------------------------------------------------------------- /exits/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "2e450db8-d48f-4515-b6dc-bb2c708a7e1f", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": "Hi! Try saying \u0027cancel\u0027 or \u0027exit\u0027." 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": false, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [ 28 | { 29 | "name": "WELCOME" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /exits/dialogflow/agent/intents/Exit Conversation.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b506991f-ad7a-4c4b-8adc-5e6c62727381", 3 | "name": "Exit Conversation", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Exit Conversation" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [ 27 | { 28 | "name": "actions_intent_CANCEL" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /exits/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /exits/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | actions_intent_CANCEL,Exit Conversation 2 | -------------------------------------------------------------------------------- /exits/firebase.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /exits/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /exits/functions/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Google, Inc. 2 | // Licensed under the Apache License, Version 2.0 (the 'License'); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an 'AS IS' BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | 'use strict'; 15 | 16 | // [START df_js_exit] 17 | const {dialogflow} = require('actions-on-google'); 18 | const functions = require('firebase-functions'); 19 | 20 | const app = dialogflow({debug: true}); 21 | 22 | app.intent('Exit Conversation', (conv) => { 23 | conv.close(`Okay, talk to you next time!`); 24 | }); 25 | 26 | exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app); 27 | // [END df_js_exit] 28 | 29 | -------------------------------------------------------------------------------- /exits/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "exits", 3 | "description": "Sample of conversation exits", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0" 21 | }, 22 | "devDependencies": { 23 | "ava": "^2.1.0", 24 | "eslint": "^6.0.1", 25 | "eslint-config-google": "^0.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /exits/functions/test/Exit_Conversation/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": false, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Okay, talk to you next time!" 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /exits/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /guest-users/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/guest-users/dialogflow/agent.zip -------------------------------------------------------------------------------- /guest-users/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [], 14 | "systemIntents": [], 15 | "endIntentIds": [], 16 | "oAuthLinking": { 17 | "required": false, 18 | "providerId": "", 19 | "authorizationUrl": "", 20 | "tokenUrl": "", 21 | "scopes": "", 22 | "privacyPolicyUrl": "", 23 | "grantType": "AUTH_CODE_GRANT" 24 | }, 25 | "voiceType": "MALE_1", 26 | "capabilities": [], 27 | "env": "", 28 | "protocolVersion": "V2", 29 | "autoPreviewEnabled": false, 30 | "isDeviceAgent": false 31 | }, 32 | "defaultTimezone": "America/Denver", 33 | "webhook": { 34 | "url": "https://example.com", 35 | "username": "", 36 | "headers": { 37 | "": "" 38 | }, 39 | "available": true, 40 | "useForDomains": false, 41 | "cloudFunctionsEnabled": false, 42 | "cloudFunctionsInitialized": false 43 | }, 44 | "isPrivate": true, 45 | "customClassifierMode": "use.after", 46 | "mlMinConfidence": 0.3, 47 | "supportedLanguages": [], 48 | "onePlatformApiVersion": "v2", 49 | "analyzeQueryTextSentiment": false, 50 | "enabledKnowledgeBaseNames": [], 51 | "knowledgeServiceConfidenceAdjustment": -0.4, 52 | "dialogBuilderMode": false, 53 | "baseActionPackagesUrl": "" 54 | } -------------------------------------------------------------------------------- /guest-users/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "7706f946-f1ba-4f49-bd5f-cff78dbfd875", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [ 17 | "I didn\u0027t get that. Can you say it again?", 18 | "I missed what you said. What was that?", 19 | "Sorry, could you say that again?", 20 | "Sorry, can you say that again?", 21 | "Can you say that again?", 22 | "Sorry, I didn\u0027t get that. Can you rephrase?", 23 | "Sorry, what was that?", 24 | "One more time?", 25 | "What was that?", 26 | "Say that one more time?", 27 | "I didn\u0027t get that. Can you repeat?", 28 | "I missed that, say that again?" 29 | ] 30 | } 31 | ], 32 | "defaultResponsePlatforms": {}, 33 | "speech": [] 34 | } 35 | ], 36 | "priority": 500000, 37 | "webhookUsed": false, 38 | "webhookForSlotFilling": false, 39 | "fallbackIntent": true, 40 | "events": [] 41 | } -------------------------------------------------------------------------------- /guest-users/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "fa98541e-4c23-46fe-86f7-3bb4f58069d8", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": "Webhook failed for intent: Default Welcome Intent" 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [ 28 | { 29 | "name": "WELCOME" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /guest-users/dialogflow/agent/intents/Save Preference.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3486a76b-5a7e-4872-b392-32f1a80044ad", 3 | "name": "Save Preference", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [ 11 | { 12 | "id": "74f0838a-07ba-4911-8e93-f841586ad918", 13 | "required": false, 14 | "dataType": "@sys.color", 15 | "name": "color", 16 | "value": "$color", 17 | "promptMessages": [], 18 | "noMatchPromptMessages": [], 19 | "noInputPromptMessages": [], 20 | "outputDialogContexts": [], 21 | "isList": false 22 | } 23 | ], 24 | "messages": [ 25 | { 26 | "type": 0, 27 | "lang": "en", 28 | "speech": "Webhook failed for intent: Save Preference" 29 | } 30 | ], 31 | "defaultResponsePlatforms": {}, 32 | "speech": [] 33 | } 34 | ], 35 | "priority": 500000, 36 | "webhookUsed": true, 37 | "webhookForSlotFilling": false, 38 | "fallbackIntent": false, 39 | "events": [] 40 | } -------------------------------------------------------------------------------- /guest-users/dialogflow/agent/intents/Save Preference_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "8150ec88-2908-4d44-a992-65da24f85fdc", 4 | "data": [ 5 | { 6 | "text": "yellow", 7 | "alias": "color", 8 | "meta": "@sys.color", 9 | "userDefined": false 10 | }, 11 | { 12 | "text": " is my favorite", 13 | "userDefined": false 14 | } 15 | ], 16 | "isTemplate": false, 17 | "count": 0, 18 | "updated": 0 19 | }, 20 | { 21 | "id": "7a9d1ab8-1ff4-4495-8ca2-a296e08312d9", 22 | "data": [ 23 | { 24 | "text": "I like ", 25 | "userDefined": false 26 | }, 27 | { 28 | "text": "red", 29 | "alias": "color", 30 | "meta": "@sys.color", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "6352c652-264b-4a99-8b42-dbe382d6b758", 40 | "data": [ 41 | { 42 | "text": "blue", 43 | "alias": "color", 44 | "meta": "@sys.color", 45 | "userDefined": false 46 | } 47 | ], 48 | "isTemplate": false, 49 | "count": 0, 50 | "updated": 0 51 | } 52 | ] -------------------------------------------------------------------------------- /guest-users/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /guest-users/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | blue,Save Preference_usersays_en 2 | -------------------------------------------------------------------------------- /guest-users/firebase.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /guest-users/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /guest-users/functions/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Google, Inc. 2 | // Licensed under the Apache License, Version 2.0 (the 'License'); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an 'AS IS' BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | 'use strict'; 15 | 16 | const {dialogflow} = require('actions-on-google'); 17 | const functions = require('firebase-functions'); 18 | 19 | const app = dialogflow({debug: true}); 20 | 21 | app.intent('Default Welcome Intent', (conv) => { 22 | const savedColor = conv.user.storage.favoriteColor; 23 | if (savedColor) { 24 | conv.ask(`Hey there! I remember your favorite color is ${savedColor}`); 25 | conv.ask('Can you give me another color to remember?'); 26 | } else { 27 | conv.ask(`Hey there! What's your favorite color?`); 28 | } 29 | }); 30 | 31 | // [START df_js_guest_check] 32 | app.intent('Save Preference', (conv, {color}) => { 33 | if (conv.user.verification === 'VERIFIED') { 34 | conv.user.storage.favoriteColor = color; 35 | conv.close(`Alright, I'll remember that you like ${color}. See you!`); 36 | } else { 37 | conv.close(`${color} is my favorite too! I can't save that right now ` + 38 | `but you can tell me again next time!`); 39 | } 40 | }); 41 | // [END df_js_guest_check] 42 | 43 | exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app); 44 | -------------------------------------------------------------------------------- /guest-users/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guests", 3 | "description": "Sample of handling guest users", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0" 21 | }, 22 | "devDependencies": { 23 | "ava": "^2.1.0", 24 | "eslint": "^6.0.1", 25 | "eslint-config-google": "^0.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /guest-users/functions/test/Guest_Save/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": false, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "blue is my favorite too! I can't save that right now but you can tell me again next time!" 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /guest-users/functions/test/Guest_Welcome/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Hey there! What's your favorite color?" 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /guest-users/functions/test/Verified_Save/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": false, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Alright, I'll remember that you like blue. See you!" 10 | } 11 | } 12 | ] 13 | }, 14 | "userStorage": "{\"data\":{\"favoriteColor\":\"blue\"}}" 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /guest-users/functions/test/Verified_Welcome/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Hey there! I remember your favorite color is blue" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Can you give me another color to remember?" 15 | } 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /guest-users/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /helpers/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/helpers/dialogflow/agent.zip -------------------------------------------------------------------------------- /helpers/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [], 14 | "systemIntents": [], 15 | "endIntentIds": [], 16 | "oAuthLinking": { 17 | "required": false, 18 | "providerId": "", 19 | "authorizationUrl": "", 20 | "tokenUrl": "", 21 | "scopes": "", 22 | "privacyPolicyUrl": "", 23 | "grantType": "AUTH_CODE_GRANT" 24 | }, 25 | "voiceType": "MALE_1", 26 | "capabilities": [], 27 | "env": "", 28 | "protocolVersion": "V2", 29 | "autoPreviewEnabled": true, 30 | "isDeviceAgent": false 31 | }, 32 | "defaultTimezone": "America/Denver", 33 | "webhook": { 34 | "url": "https://example.com", 35 | "username": "", 36 | "headers": { 37 | "": "" 38 | }, 39 | "available": true, 40 | "useForDomains": false, 41 | "cloudFunctionsEnabled": false, 42 | "cloudFunctionsInitialized": false 43 | }, 44 | "isPrivate": true, 45 | "customClassifierMode": "use.after", 46 | "mlMinConfidence": 0.3, 47 | "supportedLanguages": [], 48 | "onePlatformApiVersion": "v2", 49 | "analyzeQueryTextSentiment": false, 50 | "enabledKnowledgeBaseNames": [], 51 | "knowledgeServiceConfidenceAdjustment": -0.4, 52 | "dialogBuilderMode": false, 53 | "baseActionPackagesUrl": "" 54 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Confirmation Handler.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "11cc7c8e-0710-42ea-9cd9-723aff03e97f", 3 | "name": "Confirmation Handler", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Confirmation Handler" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [ 27 | { 28 | "name": "actions_intent_CONFIRMATION" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Confirmation.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "8af443fe-1bf5-4e06-97ec-0ea9d032c9fe", 3 | "name": "Confirmation", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Confirmation" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Confirmation_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "9450c334-7b5f-4ba3-a464-563ca1419db2", 4 | "data": [ 5 | { 6 | "text": "show me the confirmation intent", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "25bc813a-6658-409b-b91b-c50419d87596", 16 | "data": [ 17 | { 18 | "text": "confirmation intents", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "1409671e-16f7-4f6a-9e54-7912ef94e37b", 28 | "data": [ 29 | { 30 | "text": "confirmation", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Date Time Handler.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3c145f18-32fe-40aa-842e-b99ab28c3f2a", 3 | "parentId": "b901c056-01d2-49b0-8ef0-45467279f4fc", 4 | "rootParentId": "b901c056-01d2-49b0-8ef0-45467279f4fc", 5 | "name": "Date Time Handler", 6 | "auto": true, 7 | "contexts": [ 8 | "DateTime-followup" 9 | ], 10 | "responses": [ 11 | { 12 | "resetContexts": false, 13 | "action": "DateTime.DateTime-custom", 14 | "affectedContexts": [], 15 | "parameters": [], 16 | "messages": [ 17 | { 18 | "type": 0, 19 | "lang": "en", 20 | "speech": "Webhook failed for intent: Date Time Handler" 21 | } 22 | ], 23 | "defaultResponsePlatforms": {}, 24 | "speech": [] 25 | } 26 | ], 27 | "priority": 500000, 28 | "webhookUsed": true, 29 | "webhookForSlotFilling": false, 30 | "fallbackIntent": false, 31 | "events": [ 32 | { 33 | "name": "actions_intent_DATETIME" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Date Time.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b901c056-01d2-49b0-8ef0-45467279f4fc", 3 | "name": "Date Time", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [ 10 | { 11 | "name": "DateTime-followup", 12 | "parameters": {}, 13 | "lifespan": 2 14 | } 15 | ], 16 | "parameters": [], 17 | "messages": [ 18 | { 19 | "type": 0, 20 | "lang": "en", 21 | "speech": "Webhook failed for intent: Date Time" 22 | } 23 | ], 24 | "defaultResponsePlatforms": {}, 25 | "speech": [] 26 | } 27 | ], 28 | "priority": 500000, 29 | "webhookUsed": true, 30 | "webhookForSlotFilling": false, 31 | "fallbackIntent": false, 32 | "events": [] 33 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Date Time_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "4bc7d0e9-8e6d-48e5-863d-dbac247d7de0", 4 | "data": [ 5 | { 6 | "text": "datetime", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "a9938553-3a52-481b-b82c-198abf90d098", 16 | "data": [ 17 | { 18 | "text": "show me the date time helper", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "d08a8986-3d26-46d6-a912-3154d3447681", 28 | "data": [ 29 | { 30 | "text": "appointments", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "ad9078d3-ebb2-4180-8182-6482b9f6046d", 40 | "data": [ 41 | { 42 | "text": "date time", 43 | "userDefined": false 44 | } 45 | ], 46 | "isTemplate": false, 47 | "count": 0, 48 | "updated": 0 49 | } 50 | ] -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "a0eb6390-8435-45f6-badf-850ed208ba17", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [ 17 | "I didn\u0027t get that. Can you say it again?", 18 | "I missed what you said. What was that?", 19 | "Sorry, could you say that again?", 20 | "Sorry, can you say that again?", 21 | "Can you say that again?", 22 | "Sorry, I didn\u0027t get that. Can you rephrase?", 23 | "Sorry, what was that?", 24 | "One more time?", 25 | "What was that?", 26 | "Say that one more time?", 27 | "I didn\u0027t get that. Can you repeat?", 28 | "I missed that, say that again?" 29 | ] 30 | } 31 | ], 32 | "defaultResponsePlatforms": {}, 33 | "speech": [] 34 | } 35 | ], 36 | "priority": 500000, 37 | "webhookUsed": false, 38 | "webhookForSlotFilling": false, 39 | "fallbackIntent": true, 40 | "events": [] 41 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "46793934-6b27-4a85-bac0-2d6da05f44a8", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": "suggestion_chips", 15 | "platform": "google", 16 | "lang": "en", 17 | "suggestions": [ 18 | { 19 | "title": "Permission" 20 | }, 21 | { 22 | "title": "Date/Time" 23 | }, 24 | { 25 | "title": "Place" 26 | }, 27 | { 28 | "title": "Confirmation" 29 | } 30 | ] 31 | }, 32 | { 33 | "type": 0, 34 | "lang": "en", 35 | "speech": "Hi! I can show you examples of helper intents. We recommend trying this sample on a phone so you can see all helper intents." 36 | } 37 | ], 38 | "defaultResponsePlatforms": { 39 | "google": true 40 | }, 41 | "speech": [] 42 | } 43 | ], 44 | "priority": 500000, 45 | "webhookUsed": false, 46 | "webhookForSlotFilling": false, 47 | "fallbackIntent": false, 48 | "events": [ 49 | { 50 | "name": "WELCOME" 51 | } 52 | ] 53 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Permission Handler.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d6fb99b5-c237-48ab-a6ca-db16e616dbbb", 3 | "parentId": "d9daf0b9-6568-4310-a8f1-a100ddc98033", 4 | "rootParentId": "d9daf0b9-6568-4310-a8f1-a100ddc98033", 5 | "name": "Permission Handler", 6 | "auto": true, 7 | "contexts": [ 8 | "Permission-followup" 9 | ], 10 | "responses": [ 11 | { 12 | "resetContexts": false, 13 | "action": "Permission.Permission-custom", 14 | "affectedContexts": [], 15 | "parameters": [], 16 | "messages": [ 17 | { 18 | "type": 0, 19 | "lang": "en", 20 | "speech": "Webhook failed for intent: Permission Handler" 21 | } 22 | ], 23 | "defaultResponsePlatforms": {}, 24 | "speech": [] 25 | } 26 | ], 27 | "priority": 500000, 28 | "webhookUsed": true, 29 | "webhookForSlotFilling": false, 30 | "fallbackIntent": false, 31 | "events": [ 32 | { 33 | "name": "actions_intent_PERMISSION" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Permission.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d9daf0b9-6568-4310-a8f1-a100ddc98033", 3 | "name": "Permission", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [ 10 | { 11 | "name": "Permission-followup", 12 | "parameters": {}, 13 | "lifespan": 2 14 | } 15 | ], 16 | "parameters": [], 17 | "messages": [ 18 | { 19 | "type": 0, 20 | "lang": "en", 21 | "speech": "Webhook failed for intent: Permission" 22 | } 23 | ], 24 | "defaultResponsePlatforms": {}, 25 | "speech": [] 26 | } 27 | ], 28 | "priority": 500000, 29 | "webhookUsed": true, 30 | "webhookForSlotFilling": false, 31 | "fallbackIntent": false, 32 | "events": [] 33 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Permission_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "08d586e2-ed9b-41a0-a9fc-3c10e3378fd4", 4 | "data": [ 5 | { 6 | "text": "show me the permission helper", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "bb60b7ff-8337-4de5-aea4-8777faff7753", 16 | "data": [ 17 | { 18 | "text": "name and location", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "2e8addad-6cae-4f5c-8563-3f3f367137c5", 28 | "data": [ 29 | { 30 | "text": "location", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "2cf9ceff-75f4-4b84-b2f7-f10e7ad16bba", 40 | "data": [ 41 | { 42 | "text": "name", 43 | "userDefined": false 44 | } 45 | ], 46 | "isTemplate": false, 47 | "count": 0, 48 | "updated": 0 49 | }, 50 | { 51 | "id": "676cdd74-ff53-44dc-80c1-d4b13968bc9c", 52 | "data": [ 53 | { 54 | "text": "user information", 55 | "userDefined": false 56 | } 57 | ], 58 | "isTemplate": false, 59 | "count": 0, 60 | "updated": 0 61 | }, 62 | { 63 | "id": "ebf5cf29-2b37-4f43-9c1d-2cca790ca8f9", 64 | "data": [ 65 | { 66 | "text": "permission intent", 67 | "userDefined": false 68 | } 69 | ], 70 | "isTemplate": false, 71 | "count": 0, 72 | "updated": 0 73 | }, 74 | { 75 | "id": "05a1821b-b09b-41e8-92e5-a3b00c91f91b", 76 | "data": [ 77 | { 78 | "text": "permission", 79 | "userDefined": false 80 | } 81 | ], 82 | "isTemplate": false, 83 | "count": 0, 84 | "updated": 0 85 | } 86 | ] -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Place Handler.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "4cf9e154-e151-44db-ae79-84d8c5a707de", 3 | "parentId": "320dd853-719c-45e4-8ba4-4d5c08247882", 4 | "rootParentId": "320dd853-719c-45e4-8ba4-4d5c08247882", 5 | "name": "Place Handler", 6 | "auto": true, 7 | "contexts": [ 8 | "Place-followup" 9 | ], 10 | "responses": [ 11 | { 12 | "resetContexts": false, 13 | "action": "Place.Place-custom", 14 | "affectedContexts": [], 15 | "parameters": [], 16 | "messages": [ 17 | { 18 | "type": 0, 19 | "lang": "en", 20 | "speech": "Webhook failed for intent: Place Handler" 21 | } 22 | ], 23 | "defaultResponsePlatforms": {}, 24 | "speech": [] 25 | } 26 | ], 27 | "priority": 500000, 28 | "webhookUsed": true, 29 | "webhookForSlotFilling": false, 30 | "fallbackIntent": false, 31 | "events": [ 32 | { 33 | "name": "actions_intent_PLACE" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Place.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "320dd853-719c-45e4-8ba4-4d5c08247882", 3 | "name": "Place", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [ 10 | { 11 | "name": "Place-followup", 12 | "parameters": {}, 13 | "lifespan": 2 14 | } 15 | ], 16 | "parameters": [], 17 | "messages": [ 18 | { 19 | "type": 0, 20 | "lang": "en", 21 | "speech": "Webhook failed for intent: Place" 22 | } 23 | ], 24 | "defaultResponsePlatforms": {}, 25 | "speech": [] 26 | } 27 | ], 28 | "priority": 500000, 29 | "webhookUsed": true, 30 | "webhookForSlotFilling": false, 31 | "fallbackIntent": false, 32 | "events": [] 33 | } -------------------------------------------------------------------------------- /helpers/dialogflow/agent/intents/Place_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "15778d91-c546-48db-b66c-c4c21472234b", 4 | "data": [ 5 | { 6 | "text": "place helper", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "9f9e3690-5241-40e8-8747-32cb5ab7c492", 16 | "data": [ 17 | { 18 | "text": "show me the place helper", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "ee9c4de8-9176-4ee3-beb2-0c0763ccf370", 28 | "data": [ 29 | { 30 | "text": "place", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /helpers/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /helpers/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | place,Place_usersays_en 2 | actions_intent_PLACE,Place Handler 3 | confirmation,Confirmation_usersays_en 4 | actions_intent_CONFIRMATION,Confirmation Handler 5 | date time,Date Time_usersays_en 6 | actions_intent_DATETIME,Date Time Handler 7 | permission,Permission_usersays_en 8 | actions_intent_PERMISSION,Permission Handler 9 | -------------------------------------------------------------------------------- /helpers/firebase.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /helpers/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /helpers/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "helpers", 3 | "description": "Sample of helper intents", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0" 21 | }, 22 | "devDependencies": { 23 | "ava": "^2.1.0", 24 | "eslint": "^6.0.1", 25 | "eslint-config-google": "^0.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /helpers/functions/test/Confirmation/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.CONFIRMATION", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.ConfirmationValueSpec", 9 | "dialogSpec": { 10 | "requestConfirmationText": "Can you confirm?" 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /helpers/functions/test/Confirmation_Handler/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Thank you for confirming" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Would you like to try another helper?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "DateTime" 21 | }, 22 | { 23 | "title": "Permission" 24 | }, 25 | { 26 | "title": "Place" 27 | } 28 | ] 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /helpers/functions/test/Date_Time/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.DATETIME", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.DateTimeValueSpec", 9 | "dialogSpec": { 10 | "requestDatetimeText": "When would you like to schedule the appointment?", 11 | "requestDateText": "What day was that?", 12 | "requestTimeText": "What time works for you?" 13 | } 14 | } 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /helpers/functions/test/Date_Time_Handler/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Great, we will see you on 14-810:30" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Would you like to try another helper?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "Confirmation" 21 | }, 22 | { 23 | "title": "Permission" 24 | }, 25 | { 26 | "title": "Place" 27 | } 28 | ] 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /helpers/functions/test/Permission/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.PERMISSION", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec", 9 | "optContext": "To address you by name and know your location", 10 | "permissions": [ 11 | "NAME", 12 | "DEVICE_PRECISE_LOCATION" 13 | ] 14 | } 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /helpers/functions/test/Permission_Handler/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Okay Sachit Mishra, I see you're at Google Building 40 1600 Amphitheatre Parkway, Mountain View, California 94043" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Would you like to try another helper?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "Confirmation" 21 | }, 22 | { 23 | "title": "DateTime" 24 | }, 25 | { 26 | "title": "Place" 27 | } 28 | ] 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /helpers/functions/test/Place/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.PLACE", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.PlaceValueSpec", 9 | "dialogSpec": { 10 | "extension": { 11 | "@type": "type.googleapis.com/google.actions.v2.PlaceValueSpec.PlaceDialogSpec", 12 | "permissionContext": "To find a location", 13 | "requestPrompt": "Where would you like to go?" 14 | } 15 | } 16 | } 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /helpers/functions/test/Place_Handler/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "KFC sounds like a great place to go!" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Would you like to try another helper?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "Confirmation" 21 | }, 22 | { 23 | "title": "DateTime" 24 | }, 25 | { 26 | "title": "Permission" 27 | } 28 | ] 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /helpers/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /notifications/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/notifications/dialogflow/agent.zip -------------------------------------------------------------------------------- /notifications/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [ 14 | { 15 | "intentId": "c3faf0c3-22e9-4617-b69e-caaa971e0709", 16 | "signInRequired": false 17 | } 18 | ], 19 | "systemIntents": [], 20 | "endIntentIds": [], 21 | "oAuthLinking": { 22 | "required": false, 23 | "providerId": "", 24 | "authorizationUrl": "", 25 | "tokenUrl": "", 26 | "scopes": "", 27 | "privacyPolicyUrl": "", 28 | "grantType": "AUTH_CODE_GRANT" 29 | }, 30 | "voiceType": "MALE_1", 31 | "capabilities": [], 32 | "env": "", 33 | "protocolVersion": "V2", 34 | "autoPreviewEnabled": true, 35 | "isDeviceAgent": false 36 | }, 37 | "defaultTimezone": "America/Denver", 38 | "webhook": { 39 | "url": "https://example.com", 40 | "username": "", 41 | "headers": { 42 | "": "" 43 | }, 44 | "available": true, 45 | "useForDomains": false, 46 | "cloudFunctionsEnabled": false, 47 | "cloudFunctionsInitialized": false 48 | }, 49 | "isPrivate": true, 50 | "customClassifierMode": "use.after", 51 | "mlMinConfidence": 0.3, 52 | "supportedLanguages": [], 53 | "onePlatformApiVersion": "v2", 54 | "analyzeQueryTextSentiment": false, 55 | "enabledKnowledgeBaseNames": [], 56 | "knowledgeServiceConfidenceAdjustment": -0.4, 57 | "dialogBuilderMode": false, 58 | "baseActionPackagesUrl": "" 59 | } -------------------------------------------------------------------------------- /notifications/dialogflow/agent/intents/Confirm Notifications Subscription.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "c7f7b30b-5b88-4bb5-b0b8-1cd0862d1dd2", 3 | "name": "Confirm Notifications Subscription", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "confirm.subscription", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [] 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [ 28 | { 29 | "name": "actions_intent_PERMISSION" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /notifications/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "edbba244-8203-4078-a9fc-0cf5c2032515", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [ 17 | "I didn\u0027t get that. Can you say it again?", 18 | "I missed what you said. What was that?", 19 | "Sorry, could you say that again?", 20 | "Sorry, can you say that again?", 21 | "Can you say that again?", 22 | "Sorry, I didn\u0027t get that. Can you rephrase?", 23 | "Sorry, what was that?", 24 | "One more time?", 25 | "What was that?", 26 | "Say that one more time?", 27 | "I didn\u0027t get that. Can you repeat?", 28 | "I missed that, say that again?" 29 | ] 30 | } 31 | ], 32 | "defaultResponsePlatforms": {}, 33 | "speech": [] 34 | } 35 | ], 36 | "priority": 500000, 37 | "webhookUsed": false, 38 | "webhookForSlotFilling": false, 39 | "fallbackIntent": true, 40 | "events": [] 41 | } -------------------------------------------------------------------------------- /notifications/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "8ca83a62-903f-4a56-be74-4de0ea1791fa", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [ 17 | "Hi! How are you doing?", 18 | "Hello! How can I help you?", 19 | "Good day! What can I do for you today?", 20 | "Greetings! How can I assist?" 21 | ] 22 | } 23 | ], 24 | "defaultResponsePlatforms": {}, 25 | "speech": [] 26 | } 27 | ], 28 | "priority": 500000, 29 | "webhookUsed": true, 30 | "webhookForSlotFilling": false, 31 | "fallbackIntent": false, 32 | "events": [ 33 | { 34 | "name": "WELCOME" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /notifications/dialogflow/agent/intents/Notification.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "c3faf0c3-22e9-4617-b69e-caaa971e0709", 3 | "name": "Notification", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "notification.intent", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [] 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [] 28 | } -------------------------------------------------------------------------------- /notifications/dialogflow/agent/intents/Notification_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "8a16c14c-c3b1-4f13-8ded-f41eea8d8795", 4 | "data": [ 5 | { 6 | "text": "trigger notification intent", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | } 14 | ] -------------------------------------------------------------------------------- /notifications/dialogflow/agent/intents/Subscribe to Notifications.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "ad0c25ae-239a-4fd6-b87a-c5942fc97440", 3 | "name": "Subscribe to Notifications", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "subscribe.notifications", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [] 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [] 28 | } -------------------------------------------------------------------------------- /notifications/dialogflow/agent/intents/Subscribe to Notifications_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "a2c69b71-83ec-4f37-a311-d376af541f1a", 4 | "data": [ 5 | { 6 | "text": "Send notifications", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "138f0d17-1ec2-4008-a75e-86586c73e296", 16 | "data": [ 17 | { 18 | "text": "Send me push notifications", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "ed500230-1261-47ec-aee6-ee4e5be349f6", 28 | "data": [ 29 | { 30 | "text": "Send me notifications", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /notifications/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /notifications/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | Send notifications,Subscribe to Notifications_usersays_en 2 | actions_intent_PERMISSION,Confirm Notifications Subscription 3 | -------------------------------------------------------------------------------- /notifications/firebase.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /notifications/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-unused-vars": 0 4 | }, 5 | "parserOptions": { 6 | "ecmaVersion": 8, 7 | "sourceType": "script" 8 | }, 9 | "extends": ["google"], 10 | "env": { 11 | "node": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /notifications/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "daily-updates", 3 | "description": "Sample of daily updates", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0", 21 | "request": "^2.88.0" 22 | }, 23 | "devDependencies": { 24 | "ava": "^2.3.0", 25 | "eslint": "^6.0.1", 26 | "eslint-config-google": "^0.9.1" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /notifications/functions/test/Confirm_Notifications_Subscription/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": false, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Ok, I'll start alerting you." 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /notifications/functions/test/Default_Welcome_Intent/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Hi! Welcome to Push Notifications!" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "I can send you push notifications. Would you like that?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "Send notifications" 21 | } 22 | ] 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /notifications/functions/test/Subscribe_to_Notifications/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.PERMISSION", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec", 9 | "permissions": [ 10 | "UPDATE" 11 | ], 12 | "updatePermissionValueSpec": { 13 | "intent": "Notification" 14 | } 15 | } 16 | } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /notifications/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /reprompts/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/reprompts/dialogflow/agent.zip -------------------------------------------------------------------------------- /reprompts/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [], 14 | "systemIntents": [], 15 | "endIntentIds": [], 16 | "oAuthLinking": { 17 | "required": false, 18 | "providerId": "", 19 | "authorizationUrl": "", 20 | "tokenUrl": "", 21 | "scopes": "", 22 | "privacyPolicyUrl": "", 23 | "grantType": "AUTH_CODE_GRANT" 24 | }, 25 | "voiceType": "MALE_1", 26 | "capabilities": [], 27 | "env": "", 28 | "protocolVersion": "V2", 29 | "autoPreviewEnabled": true, 30 | "isDeviceAgent": false 31 | }, 32 | "defaultTimezone": "America/Denver", 33 | "webhook": { 34 | "url": "https://example.com", 35 | "username": "", 36 | "headers": { 37 | "": "" 38 | }, 39 | "available": true, 40 | "useForDomains": false, 41 | "cloudFunctionsEnabled": false, 42 | "cloudFunctionsInitialized": false 43 | }, 44 | "isPrivate": true, 45 | "customClassifierMode": "use.after", 46 | "mlMinConfidence": 0.3, 47 | "supportedLanguages": [], 48 | "onePlatformApiVersion": "v2", 49 | "analyzeQueryTextSentiment": false, 50 | "enabledKnowledgeBaseNames": [], 51 | "knowledgeServiceConfidenceAdjustment": -0.4, 52 | "dialogBuilderMode": false, 53 | "baseActionPackagesUrl": "" 54 | } -------------------------------------------------------------------------------- /reprompts/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "4b53b5ac-dfa9-447b-9f16-bc28b7993a9a", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": "You triggered the fallback intent, so the no-input count will be reset. Try staying silent now." 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": false, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": true, 27 | "events": [] 28 | } -------------------------------------------------------------------------------- /reprompts/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3e64ecee-16b8-4fdc-9315-037d835df67d", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": "Hi! Try this sample on a speaker device, and stay silent when the mic is open. If trying on the Actions console simulator, click the no-input button next to the text input field." 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": false, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [ 28 | { 29 | "name": "WELCOME" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /reprompts/dialogflow/agent/intents/Reprompt.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "75dfd97d-6368-4436-9533-70f05ae76c96", 3 | "name": "Reprompt", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Reprompt" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [ 27 | { 28 | "name": "actions_intent_NO_INPUT" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /reprompts/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /reprompts/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | actions_intent_NO_INPUT,Reprompt 2 | -------------------------------------------------------------------------------- /reprompts/firebase.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /reprompts/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /reprompts/functions/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Google, Inc. 2 | // Licensed under the Apache License, Version 2.0 (the 'License'); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an 'AS IS' BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | 'use strict'; 15 | 16 | // [START df_js_reprompt] 17 | const {dialogflow} = require('actions-on-google'); 18 | const functions = require('firebase-functions'); 19 | 20 | const app = dialogflow({debug: true}); 21 | 22 | app.intent('Reprompt', (conv) => { 23 | const repromptCount = parseInt(conv.arguments.get('REPROMPT_COUNT')); 24 | if (repromptCount === 0) { 25 | conv.ask(`What was that?`); 26 | } else if (repromptCount === 1) { 27 | conv.ask(`Sorry I didn't catch that. Could you repeat yourself?`); 28 | } else if (conv.arguments.get('IS_FINAL_REPROMPT')) { 29 | conv.close(`Okay let's try this again later.`); 30 | } 31 | }); 32 | 33 | exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app); 34 | // [END df_js_reprompt] 35 | 36 | -------------------------------------------------------------------------------- /reprompts/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reprompt", 3 | "description": "Sample of no-input reprompts", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0" 21 | }, 22 | "devDependencies": { 23 | "ava": "^2.1.0", 24 | "eslint": "^6.0.1", 25 | "eslint-config-google": "^0.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /reprompts/functions/test/Reprompt_1/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "What was that?" 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /reprompts/functions/test/Reprompt_2/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Sorry I didn't catch that. Could you repeat yourself?" 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /reprompts/functions/test/Reprompt_3/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": false, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Okay let's try this again later." 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /reprompts/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /responses/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/responses/dialogflow/agent.zip -------------------------------------------------------------------------------- /responses/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [], 14 | "systemIntents": [], 15 | "endIntentIds": [], 16 | "oAuthLinking": { 17 | "required": false, 18 | "providerId": "", 19 | "authorizationUrl": "", 20 | "tokenUrl": "", 21 | "scopes": "", 22 | "privacyPolicyUrl": "", 23 | "grantType": "AUTH_CODE_GRANT" 24 | }, 25 | "voiceType": "MALE_1", 26 | "capabilities": [], 27 | "env": "", 28 | "protocolVersion": "V2", 29 | "autoPreviewEnabled": true, 30 | "isDeviceAgent": false 31 | }, 32 | "defaultTimezone": "America/Denver", 33 | "webhook": { 34 | "url": "https://us-central1-df-responses-kohler.cloudfunctions.net/dialogflowFirebaseFulfillment", 35 | "username": "", 36 | "headers": { 37 | "": "" 38 | }, 39 | "available": true, 40 | "useForDomains": false, 41 | "cloudFunctionsEnabled": false, 42 | "cloudFunctionsInitialized": false 43 | }, 44 | "isPrivate": true, 45 | "customClassifierMode": "use.after", 46 | "mlMinConfidence": 0.3, 47 | "supportedLanguages": [], 48 | "onePlatformApiVersion": "v2", 49 | "analyzeQueryTextSentiment": false, 50 | "enabledKnowledgeBaseNames": [], 51 | "knowledgeServiceConfidenceAdjustment": -0.4, 52 | "dialogBuilderMode": false, 53 | "baseActionPackagesUrl": "" 54 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Advanced Table Card.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "07ad0651-e391-4eaa-b764-05a135f92063", 3 | "name": "Advanced Table Card", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Advanced Table Card" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Advanced Table Card_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "68417b35-9380-493e-a19d-3f403e6ee155", 4 | "data": [ 5 | { 6 | "text": "complex table", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "64d34404-bca4-4edc-a297-48f6ec2a688b", 16 | "data": [ 17 | { 18 | "text": "complex table card", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "59fa8cb9-5a9a-43e9-a5c1-d001f481bcb4", 28 | "data": [ 29 | { 30 | "text": "advanced table", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "93d5efc2-30da-4f9b-948c-ed430d287703", 40 | "data": [ 41 | { 42 | "text": "show me an advanced table cardadvanced table", 43 | "userDefined": false 44 | } 45 | ], 46 | "isTemplate": false, 47 | "count": 0, 48 | "updated": 0 49 | } 50 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Basic Card.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "e4602269-7cf3-412d-a12c-50a39c69c4d2", 3 | "name": "Basic Card", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Basic Card" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Basic Card_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "d2255616-d005-4fb0-a965-c7bd30afc1a4", 4 | "data": [ 5 | { 6 | "text": "show me a basic card", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "fac88c4b-3326-45d3-bcb2-2164705559cf", 16 | "data": [ 17 | { 18 | "text": "basic card", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | } 26 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Browsing Carousel.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "9a25b83d-f25c-4ee6-90fb-a50a1d641307", 3 | "name": "Browsing Carousel", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Browsing Carousel" 16 | } 17 | ], 18 | "defaultResponsePlatforms": { 19 | "google": true 20 | }, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": true, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [] 29 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Browsing Carousel_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "b8b89f3d-c52b-4222-8b6f-6e37366c6f03", 4 | "data": [ 5 | { 6 | "text": "browsing carousel", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "5b517348-23d1-438f-a63a-eedc78095b14", 16 | "data": [ 17 | { 18 | "text": "Show me a browsing carousel", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | } 26 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Carousel - OPTION.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "89289810-95e0-4dfd-a26a-b49a2ac51406", 3 | "parentId": "10fd3def-4e35-406d-8091-4a363490ebf5", 4 | "rootParentId": "10fd3def-4e35-406d-8091-4a363490ebf5", 5 | "name": "Carousel - OPTION", 6 | "auto": true, 7 | "contexts": [ 8 | "Carousel-followup" 9 | ], 10 | "responses": [ 11 | { 12 | "resetContexts": false, 13 | "action": "Carousel.Carousel-custom", 14 | "affectedContexts": [], 15 | "parameters": [], 16 | "messages": [ 17 | { 18 | "type": 0, 19 | "lang": "en", 20 | "speech": "Webhook failed for intent: Carousel - OPTION" 21 | } 22 | ], 23 | "defaultResponsePlatforms": {}, 24 | "speech": [] 25 | } 26 | ], 27 | "priority": 500000, 28 | "webhookUsed": true, 29 | "webhookForSlotFilling": false, 30 | "fallbackIntent": false, 31 | "events": [ 32 | { 33 | "name": "actions_intent_OPTION" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Carousel.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "10fd3def-4e35-406d-8091-4a363490ebf5", 3 | "name": "Carousel", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [ 10 | { 11 | "name": "Carousel-followup", 12 | "parameters": {}, 13 | "lifespan": 2 14 | } 15 | ], 16 | "parameters": [], 17 | "messages": [ 18 | { 19 | "type": 0, 20 | "lang": "en", 21 | "speech": "Webhook failed for intent: Carousel" 22 | } 23 | ], 24 | "defaultResponsePlatforms": {}, 25 | "speech": [] 26 | } 27 | ], 28 | "priority": 500000, 29 | "webhookUsed": true, 30 | "webhookForSlotFilling": false, 31 | "fallbackIntent": false, 32 | "events": [] 33 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Carousel_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "0799bacf-5010-47a3-9a77-a91f2c845f9e", 4 | "data": [ 5 | { 6 | "text": "show me a carousel", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "59bbd8ea-7816-49f8-a09a-4804bd38944c", 16 | "data": [ 17 | { 18 | "text": "carousel", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | } 26 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3ab2f123-1df5-4f21-b8d3-b102031a69eb", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [ 17 | "I didn\u0027t get that. Can you say it again?", 18 | "I missed what you said. What was that?", 19 | "Sorry, could you say that again?", 20 | "Sorry, can you say that again?", 21 | "Can you say that again?", 22 | "Sorry, I didn\u0027t get that. Can you rephrase?", 23 | "Sorry, what was that?", 24 | "One more time?", 25 | "What was that?", 26 | "Say that one more time?", 27 | "I didn\u0027t get that. Can you repeat?", 28 | "I missed that, say that again?" 29 | ] 30 | } 31 | ], 32 | "defaultResponsePlatforms": {}, 33 | "speech": [] 34 | } 35 | ], 36 | "priority": 500000, 37 | "webhookUsed": false, 38 | "webhookForSlotFilling": false, 39 | "fallbackIntent": true, 40 | "events": [] 41 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3dbcc2bc-ca24-42d2-a1a2-1b55baea5475", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": "simple_response", 15 | "platform": "google", 16 | "lang": "en", 17 | "textToSpeech": "Hi! I can show you examples of response types. We recommend trying this sample on a phone so you can see all response types.", 18 | "ssml": "", 19 | "displayText": "" 20 | }, 21 | { 22 | "type": "simple_response", 23 | "platform": "google", 24 | "lang": "en", 25 | "textToSpeech": "Which response type would you like to see?", 26 | "ssml": "", 27 | "displayText": "" 28 | }, 29 | { 30 | "type": "suggestion_chips", 31 | "platform": "google", 32 | "lang": "en", 33 | "suggestions": [ 34 | { 35 | "title": "Basic Card" 36 | }, 37 | { 38 | "title": "List" 39 | }, 40 | { 41 | "title": "Carousel" 42 | }, 43 | { 44 | "title": "Simple Response" 45 | }, 46 | { 47 | "title": "SSML" 48 | }, 49 | { 50 | "title": "Table Card" 51 | }, 52 | { 53 | "title": "Media Response" 54 | } 55 | ] 56 | }, 57 | { 58 | "type": 0, 59 | "lang": "en", 60 | "speech": "Hi! I can show you examples of response types. Which response type would you like to see?" 61 | } 62 | ], 63 | "defaultResponsePlatforms": {}, 64 | "speech": [] 65 | } 66 | ], 67 | "priority": 500000, 68 | "webhookUsed": false, 69 | "webhookForSlotFilling": false, 70 | "fallbackIntent": false, 71 | "events": [ 72 | { 73 | "name": "WELCOME" 74 | } 75 | ] 76 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/List - OPTION.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "88904350-193e-4472-a2de-977eb5d9e26e", 3 | "parentId": "e01be5bb-f231-4f0e-9f90-8b70b1fee6fc", 4 | "rootParentId": "e01be5bb-f231-4f0e-9f90-8b70b1fee6fc", 5 | "name": "List - OPTION", 6 | "auto": true, 7 | "contexts": [ 8 | "List-followup" 9 | ], 10 | "responses": [ 11 | { 12 | "resetContexts": false, 13 | "action": "List.List-custom", 14 | "affectedContexts": [], 15 | "parameters": [], 16 | "messages": [ 17 | { 18 | "type": 0, 19 | "lang": "en", 20 | "speech": "Webhook failed for intent: List - OPTION" 21 | } 22 | ], 23 | "defaultResponsePlatforms": {}, 24 | "speech": [] 25 | } 26 | ], 27 | "priority": 500000, 28 | "webhookUsed": true, 29 | "webhookForSlotFilling": false, 30 | "fallbackIntent": false, 31 | "events": [ 32 | { 33 | "name": "actions_intent_OPTION" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/List.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "e01be5bb-f231-4f0e-9f90-8b70b1fee6fc", 3 | "name": "List", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [ 10 | { 11 | "name": "List-followup", 12 | "parameters": {}, 13 | "lifespan": 2 14 | } 15 | ], 16 | "parameters": [], 17 | "messages": [ 18 | { 19 | "type": 0, 20 | "lang": "en", 21 | "speech": "Webhook failed for intent: List" 22 | } 23 | ], 24 | "defaultResponsePlatforms": {}, 25 | "speech": [] 26 | } 27 | ], 28 | "priority": 500000, 29 | "webhookUsed": true, 30 | "webhookForSlotFilling": false, 31 | "fallbackIntent": false, 32 | "events": [] 33 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/List_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "cdb1d0a7-47d7-4cce-bb17-76d7a3ddf4d0", 4 | "data": [ 5 | { 6 | "text": "show me a list", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "dea4893d-ae41-478f-9664-1348b624b125", 16 | "data": [ 17 | { 18 | "text": "list", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | } 26 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Media Response.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3bff728f-6627-4da5-b40a-59f03ca62ac5", 3 | "name": "Media Response", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Media Response" 16 | } 17 | ], 18 | "defaultResponsePlatforms": { 19 | "google": true 20 | }, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": true, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [] 29 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Media Response_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "f3695752-b7c4-4d8e-a267-0ca4921e514d", 4 | "data": [ 5 | { 6 | "text": "show me a media response", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "9eebafe4-712e-4f38-8bc0-339101d0e9cd", 16 | "data": [ 17 | { 18 | "text": "show me media", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "b5c254c6-4580-4cb3-92ca-661909ce4e03", 28 | "data": [ 29 | { 30 | "text": "media responses", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "b2a06ece-8a58-4820-a870-65e7d2b62f83", 40 | "data": [ 41 | { 42 | "text": "media", 43 | "userDefined": false 44 | } 45 | ], 46 | "isTemplate": false, 47 | "count": 0, 48 | "updated": 0 49 | } 50 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Media Status.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "068b27d3-c148-4044-bfab-dfa37eebd90d", 3 | "name": "Media Status", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Media Status" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [ 27 | { 28 | "name": "actions_intent_MEDIA_STATUS" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/SSML.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "19310017-0419-42ea-8b41-7d9d0e47353b", 3 | "name": "SSML", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: SSML" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/SSML_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "8f5a60a4-970e-4b76-b74b-adac1c65336f", 4 | "data": [ 5 | { 6 | "text": "speech synthesis markup language", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "9ab4ec77-1ad7-4369-8e45-acc0a9979a0c", 16 | "data": [ 17 | { 18 | "text": "speech synthesis", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "ddb99988-6b40-4557-bb67-6e2c021d5922", 28 | "data": [ 29 | { 30 | "text": "ssmls", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "47c23ad6-16ce-470e-9676-553286ed7841", 40 | "data": [ 41 | { 42 | "text": "show me ssml", 43 | "userDefined": false 44 | } 45 | ], 46 | "isTemplate": false, 47 | "count": 0, 48 | "updated": 0 49 | } 50 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Simple Response.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b6257289-24ca-47bf-b1cc-1cd4f8284c0b", 3 | "name": "Simple Response", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Simple Response" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Simple Response_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "72e7c592-dced-4cf1-885c-a3d67aba6505", 4 | "data": [ 5 | { 6 | "text": "show me a simple response", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "6d075eac-a481-45fe-907a-bbe97ca1cf24", 16 | "data": [ 17 | { 18 | "text": "simple", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "4db4768a-7a8e-4497-866b-9921034f8db7", 28 | "data": [ 29 | { 30 | "text": "simple response", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Simple Table Card.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "a1f7c32e-c2f7-43ba-97f3-e2f6646f49be", 3 | "name": "Simple Table Card", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Simple Table Card" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Simple Table Card_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "bd2f98b0-76e6-4d22-b3d2-12f501419359", 4 | "data": [ 5 | { 6 | "text": "show me a table card", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "427393dd-ec7d-4c7c-b307-c60174f588b6", 16 | "data": [ 17 | { 18 | "text": "show me a table", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "f1bba13c-5f27-492c-9122-3c13f7873696", 28 | "data": [ 29 | { 30 | "text": "table cards", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Suggestion Chips.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "55eb1b7b-c997-497c-adaa-5c954a82faeb", 3 | "name": "Suggestion Chips", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Suggestion Chips" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Suggestion Chips_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "8a83600c-7698-4b65-849a-bfb0b917f30d", 4 | "data": [ 5 | { 6 | "text": "show me suggestion chips", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "df84350e-ffc6-4bbd-bf2c-650313608f16", 16 | "data": [ 17 | { 18 | "text": "show me suggestions", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "d143d4ee-f64d-4a20-8a38-660a3646539c", 28 | "data": [ 29 | { 30 | "text": "chips", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "b8fb646b-139f-461b-b366-4eea16c6acba", 40 | "data": [ 41 | { 42 | "text": "Suggestion chips", 43 | "userDefined": false 44 | } 45 | ], 46 | "isTemplate": false, 47 | "count": 0, 48 | "updated": 0 49 | } 50 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Tapped Suggestion.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "72fbb835-0b75-4a79-9751-145061c92a56", 3 | "name": "Tapped Suggestion", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": "simple_response", 14 | "platform": "google", 15 | "lang": "en", 16 | "textToSpeech": "You tapped a suggestion chip, matching one of the training phrases in the Tapped Suggestion intent!", 17 | "ssml": "", 18 | "displayText": "" 19 | }, 20 | { 21 | "type": "simple_response", 22 | "platform": "google", 23 | "lang": "en", 24 | "textToSpeech": "Which type of response would you like to see next?", 25 | "ssml": "", 26 | "displayText": "" 27 | }, 28 | { 29 | "type": "suggestion_chips", 30 | "platform": "google", 31 | "lang": "en", 32 | "suggestions": [ 33 | { 34 | "title": "Basic Card" 35 | }, 36 | { 37 | "title": "List" 38 | }, 39 | { 40 | "title": "Carousel" 41 | }, 42 | { 43 | "title": "Browsing Carousel" 44 | }, 45 | { 46 | "title": "Media Response" 47 | }, 48 | { 49 | "title": "SSML" 50 | } 51 | ] 52 | }, 53 | { 54 | "type": 0, 55 | "lang": "en", 56 | "speech": "You tapped a suggestion chip, matching one of the training phrases in the Tapped Suggestion intent!" 57 | } 58 | ], 59 | "defaultResponsePlatforms": {}, 60 | "speech": [] 61 | } 62 | ], 63 | "priority": 500000, 64 | "webhookUsed": false, 65 | "webhookForSlotFilling": false, 66 | "fallbackIntent": false, 67 | "events": [] 68 | } -------------------------------------------------------------------------------- /responses/dialogflow/agent/intents/Tapped Suggestion_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "b7f95709-1fd7-485e-9629-83b7e1deecb9", 4 | "data": [ 5 | { 6 | "text": "Suggestion ", 7 | "userDefined": false 8 | }, 9 | { 10 | "text": "3", 11 | "meta": "@sys.ignore", 12 | "userDefined": false 13 | } 14 | ], 15 | "isTemplate": false, 16 | "count": 0, 17 | "updated": 0 18 | }, 19 | { 20 | "id": "4f7151c5-e37d-469d-9878-3151acd9561f", 21 | "data": [ 22 | { 23 | "text": "Suggestion ", 24 | "userDefined": false 25 | }, 26 | { 27 | "text": "2", 28 | "meta": "@sys.ignore", 29 | "userDefined": false 30 | } 31 | ], 32 | "isTemplate": false, 33 | "count": 0, 34 | "updated": 0 35 | }, 36 | { 37 | "id": "3e04a382-406a-4fea-86bb-b57d71fe2998", 38 | "data": [ 39 | { 40 | "text": "Suggestion 1", 41 | "userDefined": false 42 | } 43 | ], 44 | "isTemplate": false, 45 | "count": 0, 46 | "updated": 0 47 | } 48 | ] -------------------------------------------------------------------------------- /responses/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /responses/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | advanced table card,Advanced Table Card_usersays_en 2 | complex table card,Advanced Table Card_usersays_en 3 | basic card,Basic Card_usersays_en 4 | browsing carousel,Browsing Carousel_usersays_en 5 | carousel,Carousel_usersays_en 6 | actions_intent_OPTION,Carousel - OPTION 7 | list,List_usersays_en 8 | actions_intent_OPTION,List - OPTION 9 | media response,Media Response_usersays_en 10 | actions_intent_MEDIA_STATUS,Media Status 11 | simple response,Simple Response_usersays_en 12 | table,Simple Table Card_usersays_en 13 | ssml,SSML_usersays_en 14 | suggestion chips,Suggestion Chips_usersays_en 15 | Suggestion 1,Tapped Suggestion_usersays_en -------------------------------------------------------------------------------- /responses/firebase.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /responses/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /responses/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "save-data", 3 | "description": "Sample of saving data", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0" 21 | }, 22 | "devDependencies": { 23 | "ava": "^2.3.0", 24 | "eslint": "^6.0.1", 25 | "eslint-config-google": "^0.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /responses/functions/test/Basic_Card/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Here's an example of a basic card." 10 | } 11 | }, 12 | { 13 | "basicCard": { 14 | "title": "Title: this is a title", 15 | "subtitle": "This is a subtitle", 16 | "formattedText": "This is a basic card. Text in a basic card can include \"quotes\" and\n most other unicode characters including emojis. Basic cards also support\n some markdown formatting like *emphasis* or _italics_, **strong** or\n __bold__, and ***bold itallic*** or ___strong emphasis___ as well as other\n things like line \nbreaks", 17 | "image": { 18 | "url": "https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png", 19 | "accessibilityText": "Image alternate text" 20 | }, 21 | "buttons": [ 22 | { 23 | "title": "This is a button", 24 | "openUrlAction": { 25 | "url": "https://assistant.google.com/" 26 | } 27 | } 28 | ], 29 | "imageDisplayOptions": "CROPPED" 30 | } 31 | }, 32 | { 33 | "simpleResponse": { 34 | "textToSpeech": "Which response would you like to see next?" 35 | } 36 | } 37 | ] 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /responses/functions/test/Browsing_Carousel/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Here's an example of a browsing carousel." 10 | } 11 | }, 12 | { 13 | "carouselBrowse": { 14 | "items": [ 15 | { 16 | "title": "Title of item 1", 17 | "openUrlAction": { 18 | "url": "https://example.com" 19 | }, 20 | "description": "Description of item 1", 21 | "footer": "Item 1 footer", 22 | "image": { 23 | "url": "https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png", 24 | "accessibilityText": "Image alternate text" 25 | } 26 | }, 27 | { 28 | "title": "Title of item 2", 29 | "openUrlAction": { 30 | "url": "https://example.com" 31 | }, 32 | "description": "Description of item 2", 33 | "footer": "Item 2 footer", 34 | "image": { 35 | "url": "https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png", 36 | "accessibilityText": "Image alternate text" 37 | } 38 | } 39 | ] 40 | } 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /responses/functions/test/Carousel_-_OPTION/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "You selected the first item" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Which response would you like to see next?" 15 | } 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /responses/functions/test/List_-_OPTION/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "You selected the Google Pixel!" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Which response would you like to see next?" 15 | } 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /responses/functions/test/Media_Response/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "This is a media response example." 10 | } 11 | }, 12 | { 13 | "mediaResponse": { 14 | "mediaType": "AUDIO", 15 | "mediaObjects": [ 16 | { 17 | "contentUrl": "https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3", 18 | "description": "A funky Jazz tune", 19 | "icon": { 20 | "url": "https://storage.googleapis.com/automotive-media/album_art.jpg", 21 | "accessibilityText": "Album cover of an ocean view" 22 | }, 23 | "name": "Jazz in Paris" 24 | } 25 | ] 26 | } 27 | } 28 | ], 29 | "suggestions": [ 30 | { 31 | "title": "Basic Card" 32 | }, 33 | { 34 | "title": "List" 35 | }, 36 | { 37 | "title": "Carousel" 38 | }, 39 | { 40 | "title": "Browsing Carousel" 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /responses/functions/test/Media_Status/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Hope you enjoyed the tune!" 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Which response would you like to see next?" 15 | } 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /responses/functions/test/SSML/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Here are SSML examples.Here is a buzzing fly and here's a short pause " 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Which response would you like to see next?" 15 | } 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /responses/functions/test/Simple_Response/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Here's an example of a simple response. Which type of response would you like to see next?", 10 | "displayText": "Here's a simple response. Which response would you like to see next?" 11 | } 12 | } 13 | ] 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /responses/functions/test/Simple_Table_Card/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "This is a simple table example." 10 | } 11 | }, 12 | { 13 | "tableCard": { 14 | "rows": [ 15 | { 16 | "cells": [ 17 | { 18 | "text": "row 1 item 1" 19 | }, 20 | { 21 | "text": "row 1 item 2" 22 | }, 23 | { 24 | "text": "row 1 item 3" 25 | } 26 | ], 27 | "dividerAfter": true 28 | }, 29 | { 30 | "cells": [ 31 | { 32 | "text": "row 2 item 1" 33 | }, 34 | { 35 | "text": "row 2 item 2" 36 | }, 37 | { 38 | "text": "row 2 item 3" 39 | } 40 | ], 41 | "dividerAfter": true 42 | } 43 | ], 44 | "columnProperties": [ 45 | { 46 | "header": "header 1" 47 | }, 48 | { 49 | "header": "header 2" 50 | }, 51 | { 52 | "header": "header 3" 53 | } 54 | ] 55 | } 56 | }, 57 | { 58 | "simpleResponse": { 59 | "textToSpeech": "Which response would you like to see next?" 60 | } 61 | } 62 | ] 63 | } 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /responses/functions/test/Suggestion_Chips/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "These are suggestion chips." 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Which type of response would you like to see next?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "Suggestion 1" 21 | }, 22 | { 23 | "title": "Suggestion 2" 24 | }, 25 | { 26 | "title": "Suggestion 3" 27 | } 28 | ], 29 | "linkOutSuggestion": { 30 | "destinationName": "Suggestion Link", 31 | "url": "https://assistant.google.com/" 32 | } 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /responses/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /save-data/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/save-data/dialogflow/agent.zip -------------------------------------------------------------------------------- /save-data/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [], 14 | "systemIntents": [], 15 | "endIntentIds": [ 16 | "ea477b99-f780-44b9-8d30-efd5b49a0822" 17 | ], 18 | "oAuthLinking": { 19 | "required": false, 20 | "providerId": "", 21 | "authorizationUrl": "", 22 | "tokenUrl": "", 23 | "scopes": "", 24 | "privacyPolicyUrl": "", 25 | "grantType": "AUTH_CODE_GRANT" 26 | }, 27 | "voiceType": "MALE_1", 28 | "capabilities": [], 29 | "env": "", 30 | "protocolVersion": "V2", 31 | "autoPreviewEnabled": true, 32 | "isDeviceAgent": false 33 | }, 34 | "defaultTimezone": "America/Denver", 35 | "webhook": { 36 | "url": "https://example.com", 37 | "username": "", 38 | "headers": { 39 | "": "" 40 | }, 41 | "available": true, 42 | "useForDomains": false, 43 | "cloudFunctionsEnabled": false, 44 | "cloudFunctionsInitialized": false 45 | }, 46 | "isPrivate": true, 47 | "customClassifierMode": "use.after", 48 | "mlMinConfidence": 0.3, 49 | "supportedLanguages": [], 50 | "onePlatformApiVersion": "v2", 51 | "analyzeQueryTextSentiment": false, 52 | "enabledKnowledgeBaseNames": [], 53 | "knowledgeServiceConfidenceAdjustment": -0.4, 54 | "dialogBuilderMode": false, 55 | "baseActionPackagesUrl": "" 56 | } 57 | -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "92b8ca01-90c2-4b48-9c16-8433a2b679ec", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": [ 17 | "I didn\u0027t get that. Can you say it again?", 18 | "I missed what you said. What was that?", 19 | "Sorry, could you say that again?", 20 | "Sorry, can you say that again?", 21 | "Can you say that again?", 22 | "Sorry, I didn\u0027t get that. Can you rephrase?", 23 | "Sorry, what was that?", 24 | "One more time?", 25 | "What was that?", 26 | "Say that one more time?", 27 | "I didn\u0027t get that. Can you repeat?", 28 | "I missed that, say that again?" 29 | ] 30 | } 31 | ], 32 | "defaultResponsePlatforms": {}, 33 | "speech": [] 34 | } 35 | ], 36 | "priority": 500000, 37 | "webhookUsed": false, 38 | "webhookForSlotFilling": false, 39 | "fallbackIntent": true, 40 | "events": [] 41 | } -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "632528a1-c6da-4b9f-b864-080ce955050f", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "speech": "Webhook failed for intent: Default Welcome Intent" 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [ 28 | { 29 | "name": "WELCOME" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Don_t Save Sum.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "ea477b99-f780-44b9-8d30-efd5b49a0822", 3 | "parentId": "ca2cbf4d-07b3-44ac-a3b9-d067a21571c1", 4 | "rootParentId": "073df893-c2d0-47f2-a089-224b8ee04322", 5 | "name": "Don\u0027t Save Sum", 6 | "auto": true, 7 | "contexts": [ 8 | "GetSecondNumber-followup" 9 | ], 10 | "responses": [ 11 | { 12 | "resetContexts": false, 13 | "action": "GetFirstNumber.GetFirstNumber-custom.GetSecondNumber-no", 14 | "affectedContexts": [], 15 | "parameters": [], 16 | "messages": [ 17 | { 18 | "type": 0, 19 | "lang": "en", 20 | "speech": "No problem, see you next time!" 21 | } 22 | ], 23 | "defaultResponsePlatforms": {}, 24 | "speech": [] 25 | } 26 | ], 27 | "priority": 500000, 28 | "webhookUsed": false, 29 | "webhookForSlotFilling": false, 30 | "fallbackIntent": false, 31 | "events": [] 32 | } -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Forget Number.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "cec8a081-44db-480e-979a-ab913cf08e14", 3 | "name": "Forget Number", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Forget Number" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Forget Number_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "69062068-d158-4920-876a-2e62fd468abf", 4 | "data": [ 5 | { 6 | "text": "clear user storage", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "8df27dbc-93f4-433c-ad3c-31ffd89b6f12", 16 | "data": [ 17 | { 18 | "text": "forget it", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "29511138-c21c-4d73-88b2-74471ebd15c4", 28 | "data": [ 29 | { 30 | "text": "forget the result", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Get First Number.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "073df893-c2d0-47f2-a089-224b8ee04322", 3 | "name": "Get First Number", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [ 10 | { 11 | "name": "GetFirstNumber-followup", 12 | "parameters": {}, 13 | "lifespan": 2 14 | } 15 | ], 16 | "parameters": [ 17 | { 18 | "id": "816517c1-3a26-4732-93d3-ec6a66087ba0", 19 | "required": false, 20 | "dataType": "@sys.number", 21 | "name": "firstNum", 22 | "value": "$firstNum", 23 | "promptMessages": [], 24 | "noMatchPromptMessages": [], 25 | "noInputPromptMessages": [], 26 | "isList": false 27 | } 28 | ], 29 | "messages": [ 30 | { 31 | "type": 0, 32 | "lang": "en", 33 | "speech": "Webhook failed for intent: Get First Number" 34 | } 35 | ], 36 | "defaultResponsePlatforms": {}, 37 | "speech": [] 38 | } 39 | ], 40 | "priority": 500000, 41 | "webhookUsed": true, 42 | "webhookForSlotFilling": false, 43 | "fallbackIntent": false, 44 | "events": [] 45 | } -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Get First Number_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "cff94b8a-2161-4c49-bc54-3c16b38f10eb", 4 | "data": [ 5 | { 6 | "text": "23", 7 | "alias": "firstNum", 8 | "meta": "@sys.number", 9 | "userDefined": false 10 | } 11 | ], 12 | "isTemplate": false, 13 | "count": 0, 14 | "updated": 0 15 | } 16 | ] -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Get Second Number.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "ca2cbf4d-07b3-44ac-a3b9-d067a21571c1", 3 | "parentId": "073df893-c2d0-47f2-a089-224b8ee04322", 4 | "rootParentId": "073df893-c2d0-47f2-a089-224b8ee04322", 5 | "name": "Get Second Number", 6 | "auto": true, 7 | "contexts": [ 8 | "GetFirstNumber-followup" 9 | ], 10 | "responses": [ 11 | { 12 | "resetContexts": false, 13 | "action": "GetFirstNumber.GetFirstNumber-custom", 14 | "affectedContexts": [ 15 | { 16 | "name": "GetSecondNumber-followup", 17 | "parameters": {}, 18 | "lifespan": 2 19 | } 20 | ], 21 | "parameters": [ 22 | { 23 | "id": "7f424ff1-7c5e-42bc-a116-0bad0f112e0e", 24 | "required": false, 25 | "dataType": "@sys.number", 26 | "name": "secondNum", 27 | "value": "$secondNum", 28 | "promptMessages": [], 29 | "noMatchPromptMessages": [], 30 | "noInputPromptMessages": [], 31 | "isList": false 32 | } 33 | ], 34 | "messages": [ 35 | { 36 | "type": 0, 37 | "lang": "en", 38 | "speech": "Webhook failed for intent: Get Second Number" 39 | } 40 | ], 41 | "defaultResponsePlatforms": {}, 42 | "speech": [] 43 | } 44 | ], 45 | "priority": 500000, 46 | "webhookUsed": true, 47 | "webhookForSlotFilling": false, 48 | "fallbackIntent": false, 49 | "events": [] 50 | } -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Get Second Number_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "20ed3c97-05fa-4965-8c6e-f1d8f8af76b9", 4 | "data": [ 5 | { 6 | "text": "45", 7 | "alias": "secondNum", 8 | "meta": "@sys.number", 9 | "userDefined": false 10 | } 11 | ], 12 | "isTemplate": false, 13 | "count": 0, 14 | "updated": 0 15 | } 16 | ] -------------------------------------------------------------------------------- /save-data/dialogflow/agent/intents/Save Sum.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "c6fccd47-1494-4707-a314-8791868a7cca", 3 | "parentId": "ca2cbf4d-07b3-44ac-a3b9-d067a21571c1", 4 | "rootParentId": "073df893-c2d0-47f2-a089-224b8ee04322", 5 | "name": "Save Sum", 6 | "auto": true, 7 | "contexts": [ 8 | "GetSecondNumber-followup" 9 | ], 10 | "responses": [ 11 | { 12 | "resetContexts": false, 13 | "action": "GetFirstNumber.GetFirstNumber-custom.GetSecondNumber-yes", 14 | "affectedContexts": [], 15 | "parameters": [], 16 | "messages": [ 17 | { 18 | "type": 0, 19 | "lang": "en", 20 | "speech": "Webhook failed for intent: Save Sum" 21 | } 22 | ], 23 | "defaultResponsePlatforms": {}, 24 | "speech": [] 25 | } 26 | ], 27 | "priority": 500000, 28 | "webhookUsed": true, 29 | "webhookForSlotFilling": false, 30 | "fallbackIntent": false, 31 | "events": [] 32 | } -------------------------------------------------------------------------------- /save-data/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /save-data/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | forget the result,Forget Number_usersays_en 2 | 23,Get First Number_usersays_en 3 | 45,Get Second Number_usersays_en 4 | Yes,Save Sum_usersays_en -------------------------------------------------------------------------------- /save-data/firebase.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /save-data/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /save-data/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "save-data", 3 | "description": "Sample of saving data", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0" 21 | }, 22 | "devDependencies": { 23 | "ava": "^2.1.0", 24 | "eslint": "^6.0.1", 25 | "eslint-config-google": "^0.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /save-data/functions/test/Default_Welcome_Intent/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Hi! Let's add two numbers." 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "What's the first number?" 15 | } 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /save-data/functions/test/Forget_Number/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Alright, I forgot your last result." 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Let's add two new numbers. What is the first number?" 15 | } 16 | } 17 | ] 18 | }, 19 | "userStorage": "{\"data\":{}}" 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /save-data/functions/test/Get_First_Number/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Got it, the first number is 23." 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "What's the second number?" 15 | } 16 | } 17 | ] 18 | } 19 | } 20 | }, 21 | "outputContexts": [ 22 | { 23 | "name": "projects/save-data-df-js/agent/sessions/ABwppHGfFkWJdHKPpBEYiGkhdoakWmYj_2sZa4o8pbGG9nj4q5_GfDTtNEXOY34mLX8G4o_d7oZdUW9bnBZC/contexts/_actions_on_google", 24 | "lifespanCount": 99, 25 | "parameters": { 26 | "data": "{\"firstNum\":23}" 27 | } 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /save-data/functions/test/Get_Second_Number/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Got it, the second number is 45.The sum of both numbers is 68." 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "Should I remember that for next time?" 15 | } 16 | } 17 | ] 18 | } 19 | } 20 | }, 21 | "outputContexts": [ 22 | { 23 | "name": "projects/save-data-df-js/agent/sessions/ABwppHGfFkWJdHKPpBEYiGkhdoakWmYj_2sZa4o8pbGG9nj4q5_GfDTtNEXOY34mLX8G4o_d7oZdUW9bnBZC/contexts/_actions_on_google", 24 | "lifespanCount": 99, 25 | "parameters": { 26 | "data": "{\"firstNum\":23,\"sum\":68}" 27 | } 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /save-data/functions/test/Save_Sum/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": false, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Alright, I'll store that for next time. See you then." 10 | } 11 | } 12 | ] 13 | }, 14 | "userStorage": "{\"data\":{\"sum\":68}}" 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /save-data/functions/test/Save_Sum_Guest/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": false, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "I can't save that right now, but we can add new numbers next time!" 10 | } 11 | } 12 | ] 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /save-data/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/surface-capabilities/dialogflow/agent.zip -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [], 14 | "systemIntents": [], 15 | "endIntentIds": [], 16 | "oAuthLinking": { 17 | "required": false, 18 | "providerId": "", 19 | "authorizationUrl": "", 20 | "tokenUrl": "", 21 | "scopes": "", 22 | "privacyPolicyUrl": "", 23 | "grantType": "AUTH_CODE_GRANT" 24 | }, 25 | "voiceType": "MALE_1", 26 | "capabilities": [], 27 | "env": "", 28 | "protocolVersion": "V2", 29 | "autoPreviewEnabled": true, 30 | "isDeviceAgent": false 31 | }, 32 | "defaultTimezone": "America/Denver", 33 | "webhook": { 34 | "url": "https://example.com", 35 | "username": "", 36 | "headers": { 37 | "": "" 38 | }, 39 | "available": true, 40 | "useForDomains": false, 41 | "cloudFunctionsEnabled": false, 42 | "cloudFunctionsInitialized": false 43 | }, 44 | "isPrivate": true, 45 | "customClassifierMode": "use.after", 46 | "mlMinConfidence": 0.3, 47 | "supportedLanguages": [], 48 | "onePlatformApiVersion": "v2", 49 | "analyzeQueryTextSentiment": false, 50 | "enabledKnowledgeBaseNames": [], 51 | "knowledgeServiceConfidenceAdjustment": -0.4, 52 | "dialogBuilderMode": false, 53 | "baseActionPackagesUrl": "" 54 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Audio Only Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "067d5703-afeb-4f81-bfcd-e29a9adfe90c", 3 | "name": "Audio Only Intent", 4 | "auto": true, 5 | "contexts": [ 6 | "actions_capability_audio_output" 7 | ], 8 | "responses": [ 9 | { 10 | "resetContexts": false, 11 | "affectedContexts": [], 12 | "parameters": [], 13 | "messages": [ 14 | { 15 | "type": 0, 16 | "lang": "en", 17 | "speech": "You\u0027re device has the audio capability! What else would you like to do?" 18 | } 19 | ], 20 | "defaultResponsePlatforms": {}, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": false, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [] 29 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Audio Only Intent_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "29a8aad6-be0c-4e1b-b1f0-c402df6062d9", 4 | "data": [ 5 | { 6 | "text": "Check Audio Capability", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | } 14 | ] -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Current Capabilities.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "4e191eef-ba17-4f68-8a97-85a43cbc9ed1", 3 | "name": "Current Capabilities", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Current Capabilities" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Current Capabilities_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "bd0f6175-7bf3-440d-baed-28a8e8f32633", 4 | "data": [ 5 | { 6 | "text": "what capabilities do i have now", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "6a72b860-d264-4395-bf66-0cd01b64a6a1", 16 | "data": [ 17 | { 18 | "text": "current device capabilities", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "56c41b4d-e255-41fa-9db1-1743f4a9016b", 28 | "data": [ 29 | { 30 | "text": "current capabilities", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "f7180c50-ba9f-4067-a8f0-25d3afc6b8e5", 3 | "name": "Default Fallback Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": "suggestion_chips", 15 | "platform": "google", 16 | "lang": "en", 17 | "suggestions": [ 18 | { 19 | "title": "Current Capabilities" 20 | }, 21 | { 22 | "title": "Transfer Surface" 23 | } 24 | ] 25 | }, 26 | { 27 | "type": 0, 28 | "lang": "en", 29 | "speech": "Hmm, I didn\u0027t get that. Maybe you tried checking for a capability not available on the current device. What else would you like to do?" 30 | } 31 | ], 32 | "defaultResponsePlatforms": { 33 | "google": true 34 | }, 35 | "speech": [] 36 | } 37 | ], 38 | "priority": 500000, 39 | "webhookUsed": false, 40 | "webhookForSlotFilling": false, 41 | "fallbackIntent": true, 42 | "events": [] 43 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "be4e48ee-a6f8-42d6-a6ba-3438bbde681a", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": "suggestion_chips", 15 | "platform": "google", 16 | "lang": "en", 17 | "suggestions": [ 18 | { 19 | "title": "Current capabilities" 20 | }, 21 | { 22 | "title": "Transfer surface" 23 | }, 24 | { 25 | "title": "Check Audio Capability" 26 | }, 27 | { 28 | "title": "Check Screen Capability" 29 | }, 30 | { 31 | "title": "Check Media Capability" 32 | }, 33 | { 34 | "title": "Check Web Capability" 35 | } 36 | ] 37 | }, 38 | { 39 | "type": 0, 40 | "lang": "en", 41 | "speech": "Hi! I can help you understand surface capabilities. What would you like to try?" 42 | } 43 | ], 44 | "defaultResponsePlatforms": { 45 | "google": true 46 | }, 47 | "speech": [] 48 | } 49 | ], 50 | "priority": 500000, 51 | "webhookUsed": false, 52 | "webhookForSlotFilling": false, 53 | "fallbackIntent": false, 54 | "events": [ 55 | { 56 | "name": "WELCOME" 57 | } 58 | ] 59 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Media Only Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d6ac3830-a742-4e5b-975c-4cf6f066b9d0", 3 | "name": "Media Only Intent", 4 | "auto": true, 5 | "contexts": [ 6 | "actions_capability_media_response_audio" 7 | ], 8 | "responses": [ 9 | { 10 | "resetContexts": false, 11 | "affectedContexts": [], 12 | "parameters": [], 13 | "messages": [ 14 | { 15 | "type": 0, 16 | "lang": "en", 17 | "speech": "You\u0027re device has the media capability! What else would you like to do?" 18 | } 19 | ], 20 | "defaultResponsePlatforms": {}, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": false, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [] 29 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Media Only Intent_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "f548982f-fba0-43c8-a3e6-e5b1d6abc622", 4 | "data": [ 5 | { 6 | "text": "Does this device have media response capability", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "cb236732-77eb-462c-aa78-7fea5cccaa69", 16 | "data": [ 17 | { 18 | "text": "Does this device have media capability", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "3cb1055c-6939-46de-b9a8-be1088c06558", 28 | "data": [ 29 | { 30 | "text": "Check media capability", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Screen Only Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "8fe67a78-a0ca-4167-8748-8c9fa3b52f2b", 3 | "name": "Screen Only Intent", 4 | "auto": true, 5 | "contexts": [ 6 | "actions_capability_screen_output" 7 | ], 8 | "responses": [ 9 | { 10 | "resetContexts": false, 11 | "affectedContexts": [], 12 | "parameters": [], 13 | "messages": [ 14 | { 15 | "type": 0, 16 | "lang": "en", 17 | "speech": "You\u0027re device has the screen output capability! What else would you like to do?" 18 | } 19 | ], 20 | "defaultResponsePlatforms": {}, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": false, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [] 29 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Screen Only Intent_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "f9659890-bf08-46c3-a09d-94b16a4c4d6e", 4 | "data": [ 5 | { 6 | "text": "Does this device have screen output", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "72cf700e-a2f1-4fb0-8c01-52446555101a", 16 | "data": [ 17 | { 18 | "text": "Check screen output", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "2dc6650c-5cd6-405c-b986-52fb63f151f3", 28 | "data": [ 29 | { 30 | "text": "Check screen capability", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Transfer Surface - NEW_SURFACE.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "9db3798d-bdac-4dc8-a8e7-52349a3af0e8", 3 | "name": "Transfer Surface - NEW_SURFACE", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Transfer Surface - NEW_SURFACE" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [ 27 | { 28 | "name": "actions_intent_NEW_SURFACE" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Transfer Surface.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "923c6a6f-ae91-4977-bc83-c23b341ddb2f", 3 | "name": "Transfer Surface", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "speech": "Webhook failed for intent: Transfer Surface" 16 | } 17 | ], 18 | "defaultResponsePlatforms": {}, 19 | "speech": [] 20 | } 21 | ], 22 | "priority": 500000, 23 | "webhookUsed": true, 24 | "webhookForSlotFilling": false, 25 | "fallbackIntent": false, 26 | "events": [] 27 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Transfer Surface_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "d19ef520-9e2c-4a29-a5b4-5f63d504ae78", 4 | "data": [ 5 | { 6 | "text": "transfer to screen", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "de5986b5-46ad-4ad1-87bd-785e47bc1812", 16 | "data": [ 17 | { 18 | "text": "move to screen", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "8552a037-3e77-4d56-abe1-8e516258ce16", 28 | "data": [ 29 | { 30 | "text": "multi surface conversation", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | }, 38 | { 39 | "id": "2624cc57-d065-475a-8317-db03cb22f0d9", 40 | "data": [ 41 | { 42 | "text": "Move surfaces", 43 | "userDefined": false 44 | } 45 | ], 46 | "isTemplate": false, 47 | "count": 0, 48 | "updated": 0 49 | }, 50 | { 51 | "id": "9b32b80f-8b4f-4126-9bd4-2f169b21aac0", 52 | "data": [ 53 | { 54 | "text": "Transfer surface", 55 | "userDefined": false 56 | } 57 | ], 58 | "isTemplate": false, 59 | "count": 0, 60 | "updated": 0 61 | } 62 | ] -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Web Only Capability.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "03c3fcc2-2142-4570-81a5-d2ea868242fc", 3 | "name": "Web Only Capability", 4 | "auto": true, 5 | "contexts": [ 6 | "actions_capability_web_browser" 7 | ], 8 | "responses": [ 9 | { 10 | "resetContexts": false, 11 | "affectedContexts": [], 12 | "parameters": [], 13 | "messages": [ 14 | { 15 | "type": 0, 16 | "lang": "en", 17 | "speech": "You\u0027re device has the web browser capability! What else would you like to do?" 18 | } 19 | ], 20 | "defaultResponsePlatforms": {}, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": false, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [] 29 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/intents/Web Only Capability_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "b9126d08-81c6-4284-8368-c669cd91ca69", 4 | "data": [ 5 | { 6 | "text": "Does this device have the web browser capability", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "b23b9fc9-c785-4db8-8364-8e6f09523a54", 16 | "data": [ 17 | { 18 | "text": "Ooes this device have the web capability", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "1dececa5-66d1-439a-9cc3-3381c11793a5", 28 | "data": [ 29 | { 30 | "text": "Check web capability", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /surface-capabilities/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | current capabilities,Current Capabilities_usersays_en 2 | Transfer surface,Transfer Surface_usersays_en 3 | actions_intent_NEW_SURFACE,Transfer Surface - NEW_SURFACE 4 | Check media capability,Media Only Intent_usersays_en 5 | Check Audio Capability,Audio Only Intent_usersays_en 6 | Check screen capability,Screen Only Intent_usersays_en 7 | Check web capability,Web Only Capability_usersays_en 8 | -------------------------------------------------------------------------------- /surface-capabilities/firebase.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /surface-capabilities/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /surface-capabilities/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "surface-capabilities", 3 | "description": "Sample of surface capabilities", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0" 21 | }, 22 | "devDependencies": { 23 | "ava": "^2.1.0", 24 | "eslint": "^6.0.1", 25 | "eslint-config-google": "^0.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /surface-capabilities/functions/test/Current_Capabilities/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Looks like your current device has the screen output capability, has the audio output capability, has the media capability, has the browser capability, does not have the interactive canvas capability, " 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "What else would you like to try?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "Transfer surface" 21 | }, 22 | { 23 | "title": "Check Audio Capability" 24 | }, 25 | { 26 | "title": "Check Screen Capability" 27 | }, 28 | { 29 | "title": "Check Media Capability" 30 | }, 31 | { 32 | "title": "Check Web Capability" 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /surface-capabilities/functions/test/Transfer_Surface/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.NEW_SURFACE", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.NewSurfaceValueSpec", 9 | "capabilities": [ 10 | "actions.capability.SCREEN_OUTPUT" 11 | ], 12 | "context": "Let's move you to a screen device for cards and other visual responses", 13 | "notificationTitle": "Try your Action here!" 14 | } 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /surface-capabilities/functions/test/Transfer_Surface_-_NEW_SURFACE/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Welcome to a screen device!" 10 | } 11 | }, 12 | { 13 | "basicCard": { 14 | "title": "You're on a screen device!", 15 | "formattedText": "Screen devices support basic cards and other visual responses!" 16 | } 17 | }, 18 | { 19 | "simpleResponse": { 20 | "textToSpeech": "What else would you like to try?" 21 | } 22 | } 23 | ], 24 | "suggestions": [ 25 | { 26 | "title": "Current Capabilities" 27 | }, 28 | { 29 | "title": "Check Audio Capability" 30 | }, 31 | { 32 | "title": "Check Screen Capability" 33 | }, 34 | { 35 | "title": "Check Media Capability" 36 | }, 37 | { 38 | "title": "Check Web Capability" 39 | } 40 | ] 41 | } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /surface-capabilities/functions/test/Transfer_Surface_-_Screen/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "You're already on a screen device." 10 | } 11 | }, 12 | { 13 | "simpleResponse": { 14 | "textToSpeech": "What else would you like to try?" 15 | } 16 | } 17 | ], 18 | "suggestions": [ 19 | { 20 | "title": "Current Capabilities" 21 | }, 22 | { 23 | "title": "Check Audio Capability" 24 | }, 25 | { 26 | "title": "Check Screen Capability" 27 | }, 28 | { 29 | "title": "Check Media Capability" 30 | }, 31 | { 32 | "title": "Check Web Capability" 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /surface-capabilities/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /transactions/dialogflow/agent.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/actions-on-google/dialogflow-quickstart-nodejs/0e35790a46cf024137cf2167b1ae74fc10635d5f/transactions/dialogflow/agent.zip -------------------------------------------------------------------------------- /transactions/dialogflow/agent/agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "", 3 | "language": "en", 4 | "shortDescription": "", 5 | "examples": "", 6 | "linkToDocs": "", 7 | "disableInteractionLogs": false, 8 | "disableStackdriverLogs": true, 9 | "googleAssistant": { 10 | "googleAssistantCompatible": true, 11 | "project": "", 12 | "welcomeIntentSignInRequired": false, 13 | "startIntents": [], 14 | "systemIntents": [], 15 | "endIntentIds": [], 16 | "oAuthLinking": { 17 | "required": false, 18 | "providerId": "", 19 | "authorizationUrl": "", 20 | "tokenUrl": "", 21 | "scopes": "", 22 | "privacyPolicyUrl": "", 23 | "grantType": "AUTH_CODE_GRANT" 24 | }, 25 | "voiceType": "MALE_1", 26 | "capabilities": [], 27 | "env": "", 28 | "protocolVersion": "V2", 29 | "autoPreviewEnabled": false, 30 | "isDeviceAgent": false 31 | }, 32 | "defaultTimezone": "America/New_York", 33 | "webhook": { 34 | "url": "https://example.com", 35 | "username": "", 36 | "headers": { 37 | "": "" 38 | }, 39 | "available": true, 40 | "useForDomains": false, 41 | "cloudFunctionsEnabled": false, 42 | "cloudFunctionsInitialized": false 43 | }, 44 | "isPrivate": false, 45 | "customClassifierMode": "use.after", 46 | "mlMinConfidence": 0.2, 47 | "supportedLanguages": [], 48 | "onePlatformApiVersion": "v2", 49 | "analyzeQueryTextSentiment": false, 50 | "enabledKnowledgeBaseNames": [], 51 | "knowledgeServiceConfidenceAdjustment": -0.4, 52 | "dialogBuilderMode": false, 53 | "baseActionPackagesUrl": "" 54 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Default Fallback Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "95c289de-3aa1-455c-bffd-1b22abba2088", 3 | "name": "Default Fallback Intent", 4 | "auto": false, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.unknown", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "condition": "", 17 | "speech": [ 18 | "I didn\u0027t get that. Can you say it again?", 19 | "I missed what you said. Say it again?", 20 | "Sorry, could you say that again?", 21 | "Sorry, can you say that again?", 22 | "Can you say that again?", 23 | "Sorry, I didn\u0027t get that.", 24 | "Sorry, what was that?", 25 | "One more time?", 26 | "What was that?", 27 | "Say that again?", 28 | "I didn\u0027t get that.", 29 | "I missed that." 30 | ] 31 | } 32 | ], 33 | "defaultResponsePlatforms": {}, 34 | "speech": [] 35 | } 36 | ], 37 | "priority": 500000, 38 | "webhookUsed": false, 39 | "webhookForSlotFilling": false, 40 | "fallbackIntent": true, 41 | "events": [], 42 | "conditionalResponses": [], 43 | "condition": "", 44 | "conditionalFollowupEvents": [] 45 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Default Welcome Intent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "f63afe46-b49f-430b-b56c-046a9e837ed1", 3 | "name": "Default Welcome Intent", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "input.welcome", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "condition": "", 17 | "speech": [] 18 | } 19 | ], 20 | "defaultResponsePlatforms": {}, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": true, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [ 29 | { 30 | "name": "WELCOME" 31 | } 32 | ], 33 | "conditionalResponses": [], 34 | "condition": "", 35 | "conditionalFollowupEvents": [] 36 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Delivery Address Complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "0be5d130-1760-4355-85e9-4dc01da8bf3c", 3 | "name": "Delivery Address Complete", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "condition": "", 16 | "speech": [] 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [ 28 | { 29 | "name": "actions_intent_DELIVERY_ADDRESS" 30 | } 31 | ], 32 | "conditionalResponses": [], 33 | "condition": "", 34 | "conditionalFollowupEvents": [] 35 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Delivery Address.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "acf13a24-d524-4fa1-bef3-90a3c0ea90ae", 3 | "name": "Delivery Address", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "condition": "", 16 | "speech": [] 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [], 28 | "conditionalResponses": [], 29 | "condition": "", 30 | "conditionalFollowupEvents": [] 31 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Delivery Address_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "27386920-1b26-4cc7-ae91-ece2af30b9b6", 4 | "data": [ 5 | { 6 | "text": "delivery address", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "11d60aff-5fc4-4cb8-a27a-d01fbfc555bb", 16 | "data": [ 17 | { 18 | "text": "get delivery address", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | } 26 | ] -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Send Order Update.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "9ca15e4c-f3ac-488f-bf18-42ba67ee6311", 3 | "name": "Send Order Update", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "condition": "", 16 | "speech": [] 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [], 28 | "conditionalResponses": [], 29 | "condition": "", 30 | "conditionalFollowupEvents": [] 31 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Send Order Update_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "a868e2e4-cf91-4488-a0f2-6c6feb0f2cb6", 4 | "data": [ 5 | { 6 | "text": "send an order update", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "4f7d774c-f49c-4f9c-889f-efb396272a11", 16 | "data": [ 17 | { 18 | "text": "send order update", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | } 26 | ] -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Sign In Complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "105b925b-b186-4f5d-8bde-a9a782a0fa9f", 3 | "name": "Sign In Complete", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [ 10 | { 11 | "name": "merchant_payment", 12 | "parameters": {}, 13 | "lifespan": 2 14 | } 15 | ], 16 | "parameters": [], 17 | "messages": [ 18 | { 19 | "type": 0, 20 | "lang": "en", 21 | "condition": "", 22 | "speech": [] 23 | } 24 | ], 25 | "defaultResponsePlatforms": {}, 26 | "speech": [] 27 | } 28 | ], 29 | "priority": 500000, 30 | "webhookUsed": true, 31 | "webhookForSlotFilling": false, 32 | "fallbackIntent": false, 33 | "events": [ 34 | { 35 | "name": "actions_intent_SIGN_IN" 36 | } 37 | ], 38 | "conditionalResponses": [], 39 | "condition": "", 40 | "conditionalFollowupEvents": [] 41 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Sign In.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "a472c557-16ac-4610-aa76-38fd306210ec", 3 | "name": "Sign In", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "affectedContexts": [], 10 | "parameters": [], 11 | "messages": [ 12 | { 13 | "type": 0, 14 | "lang": "en", 15 | "condition": "", 16 | "speech": [] 17 | } 18 | ], 19 | "defaultResponsePlatforms": {}, 20 | "speech": [] 21 | } 22 | ], 23 | "priority": 500000, 24 | "webhookUsed": true, 25 | "webhookForSlotFilling": false, 26 | "fallbackIntent": false, 27 | "events": [], 28 | "conditionalResponses": [], 29 | "condition": "", 30 | "conditionalFollowupEvents": [] 31 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Sign In_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "31caedaf-9b43-40aa-8083-5908013b4a78", 4 | "data": [ 5 | { 6 | "text": "merchant payment", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "4ef02243-d701-4896-89ea-529d79fdb7e0", 16 | "data": [ 17 | { 18 | "text": "transaction with merchant payment", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "dd1790d2-a6c7-414e-ad27-7191ffa41a02", 28 | "data": [ 29 | { 30 | "text": "check transaction with merchant payment", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Transaction Check Complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "fd16d86b-60db-4d19-a683-5b52a22f4795", 3 | "name": "Transaction Check Complete", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "transaction.check.complete", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "condition": "", 17 | "speech": "Failed to get transaction check results" 18 | } 19 | ], 20 | "defaultResponsePlatforms": {}, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": true, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [ 29 | { 30 | "name": "actions_intent_TRANSACTION_REQUIREMENTS_CHECK" 31 | } 32 | ], 33 | "conditionalResponses": [], 34 | "condition": "", 35 | "conditionalFollowupEvents": [] 36 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Transaction Check Google.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "67c00b09-bd44-4537-b740-09362444f4bb", 3 | "name": "Transaction Check Google", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "transaction.check.google", 10 | "affectedContexts": [ 11 | { 12 | "name": "google_payment", 13 | "parameters": {}, 14 | "lifespan": 2 15 | } 16 | ], 17 | "parameters": [], 18 | "messages": [ 19 | { 20 | "type": 0, 21 | "lang": "en", 22 | "condition": "", 23 | "speech": "Could not request transactions check with Google payment" 24 | } 25 | ], 26 | "defaultResponsePlatforms": {}, 27 | "speech": [] 28 | } 29 | ], 30 | "priority": 500000, 31 | "webhookUsed": true, 32 | "webhookForSlotFilling": false, 33 | "fallbackIntent": false, 34 | "events": [], 35 | "conditionalResponses": [], 36 | "condition": "", 37 | "conditionalFollowupEvents": [] 38 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Transaction Check Google_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "0a4a0ce4-4026-4d9d-af47-fccea10501da", 4 | "data": [ 5 | { 6 | "text": "google payment", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "5e4bcc14-9bb7-49a8-b75e-84c7d1d1d31d", 16 | "data": [ 17 | { 18 | "text": "transaction with google payment", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | }, 26 | { 27 | "id": "54d22ba9-2e1d-4f0d-9faa-d6b005acd405", 28 | "data": [ 29 | { 30 | "text": "check transaction with google payment", 31 | "userDefined": false 32 | } 33 | ], 34 | "isTemplate": false, 35 | "count": 0, 36 | "updated": 0 37 | } 38 | ] -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Transaction Check Merchant.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "eaa64723-3e64-44d8-a346-1ae6ebe2d6d9", 3 | "name": "Transaction Check Merchant", 4 | "auto": true, 5 | "contexts": [ 6 | "merchant_payment" 7 | ], 8 | "responses": [ 9 | { 10 | "resetContexts": false, 11 | "action": "transaction.check.action", 12 | "affectedContexts": [ 13 | { 14 | "name": "merchant_payment", 15 | "parameters": {}, 16 | "lifespan": 2 17 | } 18 | ], 19 | "parameters": [], 20 | "messages": [ 21 | { 22 | "type": 0, 23 | "lang": "en", 24 | "condition": "", 25 | "speech": "Could not request transactions check with merchant payment" 26 | } 27 | ], 28 | "defaultResponsePlatforms": {}, 29 | "speech": [] 30 | } 31 | ], 32 | "priority": 500000, 33 | "webhookUsed": true, 34 | "webhookForSlotFilling": false, 35 | "fallbackIntent": false, 36 | "events": [], 37 | "conditionalResponses": [], 38 | "condition": "", 39 | "conditionalFollowupEvents": [] 40 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Transaction Check Merchant_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "b25c78d5-fd34-429e-a523-b22f53062ff8", 4 | "data": [ 5 | { 6 | "text": "transaction requirements", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | }, 14 | { 15 | "id": "b4024247-2f14-4fd5-b9d2-6f1cfacd8f4d", 16 | "data": [ 17 | { 18 | "text": "check transaction requirements", 19 | "userDefined": false 20 | } 21 | ], 22 | "isTemplate": false, 23 | "count": 0, 24 | "updated": 0 25 | } 26 | ] -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Transaction Decision Complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "4bfb5d42-1fb1-44cd-b2b8-804a0fdf4a94", 3 | "name": "Transaction Decision Complete", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "transaction.decision.complete", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "condition": "", 17 | "speech": "Failed to get transaction decision" 18 | } 19 | ], 20 | "defaultResponsePlatforms": {}, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": true, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [ 29 | { 30 | "name": "actions_intent_TRANSACTION_DECISION" 31 | } 32 | ], 33 | "conditionalResponses": [], 34 | "condition": "", 35 | "conditionalFollowupEvents": [] 36 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Transaction Decision.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b3e24235-436f-45d0-8b27-f5a11934ad75", 3 | "name": "Transaction Decision", 4 | "auto": true, 5 | "contexts": [], 6 | "responses": [ 7 | { 8 | "resetContexts": false, 9 | "action": "transaction.decision.action", 10 | "affectedContexts": [], 11 | "parameters": [], 12 | "messages": [ 13 | { 14 | "type": 0, 15 | "lang": "en", 16 | "condition": "", 17 | "speech": "Could not confirm transaction" 18 | } 19 | ], 20 | "defaultResponsePlatforms": {}, 21 | "speech": [] 22 | } 23 | ], 24 | "priority": 500000, 25 | "webhookUsed": true, 26 | "webhookForSlotFilling": false, 27 | "fallbackIntent": false, 28 | "events": [], 29 | "conditionalResponses": [], 30 | "condition": "", 31 | "conditionalFollowupEvents": [] 32 | } -------------------------------------------------------------------------------- /transactions/dialogflow/agent/intents/Transaction Decision_usersays_en.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "a848e89b-e3fc-44e9-b9a7-5e50af20de6c", 4 | "data": [ 5 | { 6 | "text": "confirm transaction", 7 | "userDefined": false 8 | } 9 | ], 10 | "isTemplate": false, 11 | "count": 0, 12 | "updated": 0 13 | } 14 | ] -------------------------------------------------------------------------------- /transactions/dialogflow/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0" 3 | } -------------------------------------------------------------------------------- /transactions/dialogflow/test/dftest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Keep track of PWD, before switching to script directory 4 | # All commands are run relative to script directory 5 | OLD_DIR=$PWD 6 | CURRENT_DIR=$(dirname "$BASH_SOURCE") 7 | cd $CURRENT_DIR 8 | 9 | # Unzip zipped agent to ensure same as unzipped 10 | echo "Checking zipped and unzipped agents are identical..." 11 | unzip ../agent.zip -d _test_unzipped > /dev/null 2>&1 12 | agent_diff=$(diff -r _test_unzipped ../agent) 13 | if [[ $? != 0 ]]; then 14 | echo "Error: Make sure the zipped and unzipped agents are identical" 15 | rm -rf _test_unzipped 16 | exit 1 17 | fi 18 | echo "Success: Agents are identical" 19 | rm -rf _test_unzipped 20 | 21 | # Check whether strings match intents as intended 22 | # Currently does a very naive grep for string inclusion 23 | dialog=dialog.csv 24 | all_intents_matched=true 25 | OLDIFS=$IFS 26 | IFS=, 27 | while read training_phrase intent 28 | do 29 | echo "Checking phrase $training_phrase matches $intent..." 30 | # Get matched filename as a string 31 | matched_path=$(grep $training_phrase ../agent/intents/$intent.json) 32 | if [[ $? != 0 ]]; then 33 | echo "Error: Intent not matched for $training_phrase" 34 | all_intents_matched=false 35 | fi 36 | done < $dialog 37 | 38 | if [[ $all_intents_matched = true ]]; then 39 | echo "Success: dialog.csv matched all intents" 40 | fi 41 | IFS=$OLDIFS 42 | 43 | cd $OLD_DIR -------------------------------------------------------------------------------- /transactions/dialogflow/test/dialog.csv: -------------------------------------------------------------------------------- 1 | check transaction with merchant payment,Sign In_usersays_en 2 | actions_intent_SIGN_IN,Sign In Complete 3 | check transaction requirements,Transaction Check Merchant_usersays_en 4 | check transaction with google payment,Transaction Check Google_usersays_en 5 | actions_intent_TRANSACTION_REQUIREMENTS_CHECK,Transaction Check Complete 6 | get delivery address,Delivery Address_usersays_en 7 | actions_intent_DELIVERY_ADDRESS,Delivery Address Complete 8 | confirm transaction,Transaction Decision_usersays_en 9 | actions_intent_TRANSACTION_DECISION,Transaction Decision Complete -------------------------------------------------------------------------------- /transactions/firebase.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /transactions/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 8, 4 | "sourceType": "script" 5 | }, 6 | "extends": ["google"], 7 | "env": { 8 | "node": true 9 | } 10 | } -------------------------------------------------------------------------------- /transactions/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "daily-updates", 3 | "description": "Sample of daily updates", 4 | "version": "0.0.1", 5 | "private": true, 6 | "license": "Apache Version 2.0", 7 | "author": "Google Inc.", 8 | "engines": { 9 | "node": "8" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --fix \"**/*.js\"", 13 | "start": "firebase serve --only functions", 14 | "deploy": "firebase deploy --only functions", 15 | "test": "npm run lint && ava" 16 | }, 17 | "dependencies": { 18 | "actions-on-google": "^2.9.1", 19 | "firebase-admin": "^8.2.0", 20 | "firebase-functions": "^3.1.0", 21 | "googleapis": "^43.0.0", 22 | "request": "^2.88.0", 23 | "request-promise": "^4.2.4" 24 | }, 25 | "devDependencies": { 26 | "ava": "^2.4.0", 27 | "eslint": "^6.0.1", 28 | "eslint-config-google": "^0.9.1" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /transactions/functions/test/Delivery_Address/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.DELIVERY_ADDRESS", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.DeliveryAddressValueSpec", 9 | "addressOptions": { 10 | "reason": "To know where to send the order" 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /transactions/functions/test/Delivery_Address_Complete/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Great, got your address! Now say \"confirm transaction\"." 10 | } 11 | } 12 | ], 13 | "suggestions": [ 14 | { 15 | "title": "confirm transaction" 16 | } 17 | ] 18 | } 19 | } 20 | }, 21 | "outputContexts": [ 22 | { 23 | "name": "projects/df-transactions/agent/sessions/ABwppHGYEP2Fj7tJBxoaKMevL6lZ2rs063lOEWhSW5etZWVOoJe7Dzm_bLejRTYIYXL3D78ER7YvA5aN9Wpy/contexts/_actions_on_google", 24 | "lifespanCount": 99, 25 | "parameters": { 26 | "data": "{\"location\":{\"coordinates\":{\"latitude\":37.432524,\"longitude\":-122.098545},\"zipCode\":\"94043-1351\",\"city\":\"MOUNTAIN VIEW\",\"postalAddress\":{\"regionCode\":\"US\",\"postalCode\":\"94043-1351\",\"administrativeArea\":\"CA\",\"locality\":\"MOUNTAIN VIEW\",\"addressLines\":[\"1600 AMPHITHEATRE PKWY\"],\"recipients\":[\"John Doe\"]},\"phoneNumber\":\"+1 123-456-7890\"}}" 27 | } 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /transactions/functions/test/Sign_In/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.SIGN_IN", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.v2.SignInValueSpec", 9 | "optContext": "To get your account details" 10 | } 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /transactions/functions/test/Sign_In_Complete/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "You must meet all the requirements necessary to make a transaction. Try saying \"check transaction requirements\"." 10 | } 11 | } 12 | ], 13 | "suggestions": [ 14 | { 15 | "title": "check requirements" 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /transactions/functions/test/Transaction_Check_Complete/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Looks like you're good to go! Next I'll need your delivery address.Try saying \"get delivery address\"." 10 | } 11 | } 12 | ], 13 | "suggestions": [ 14 | { 15 | "title": "get delivery address" 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /transactions/functions/test/Transaction_Check_Google/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "richResponse": { 6 | "items": [ 7 | { 8 | "simpleResponse": { 9 | "textToSpeech": "Looks like you're good to go! Next I'll need your delivery address.Try saying \"get delivery address\"." 10 | } 11 | } 12 | ], 13 | "suggestions": [ 14 | { 15 | "title": "get delivery address" 16 | } 17 | ] 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /transactions/functions/test/Transaction_Check_Merchant/res.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": { 3 | "google": { 4 | "expectUserResponse": true, 5 | "systemIntent": { 6 | "intent": "actions.intent.TRANSACTION_REQUIREMENTS_CHECK", 7 | "data": { 8 | "@type": "type.googleapis.com/google.actions.transactions.v3.TransactionRequirementsCheckSpec" 9 | } 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /transactions/functions/test/happy_path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2019 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const fs = require('fs'); 18 | const path = require('path'); 19 | const ava = require('ava'); 20 | const fulfillment = require('../index').dialogflowFirebaseFulfillment; 21 | 22 | fs.readdirSync(__dirname).forEach((fileName) => { 23 | if (fs.lstatSync(path.join(__dirname, fileName)).isDirectory()) { 24 | ava.cb(fileName, (t) => { 25 | const req = { 26 | get() {}, 27 | body: require(`./${fileName}/req.json`), 28 | headers: {}, 29 | }; 30 | const resBody = require(`./${fileName}/res.json`); 31 | 32 | const res = { 33 | setHeader: function() { 34 | return this; 35 | }, 36 | status: function(code) { 37 | return this; 38 | }, 39 | send: function(body) { 40 | t.deepEqual(JSON.parse(JSON.stringify(body)), resBody); 41 | t.end(); 42 | return this; 43 | }, 44 | }; 45 | 46 | fulfillment(req, res); 47 | }); 48 | } 49 | }); 50 | --------------------------------------------------------------------------------