A simple sample showing how to use Dialogflow's Importer for Alexa Skills to import a Alexa Skill to Dialogflow, deploy it to the Google Assistant developer platform, Actions on Google, and export the Dialogflow agent back to Amazon's Alexa Skill Kit platform.
Check out this for a comprehensive walkthrough.
This sample is divided into two parts: skill
and dialogflow
directories.
- The
skill
directory has all the files for deployment and fulfillment of a simple Alexa Skill that responds to a single query for the most popular videos on YouTube. When deployed properly to Lambda and Alexa, the Alexa Skill responds with the 5 most popular YouTube videos in the United States at the time. - The
dialogflow
directory contains all the Alexa Skill's files imported into Dialogflow. These include the Dialogflow agent exported to a zip file and fulfillment designed to be hosted on Cloud Functions for Firebase.
- Go to Add to Dialogflow button below to Create Agent:
2. Go to the settings ⚙ > Export and Import tab > Restore from Zip.
- Upload the
dialogflow/DialogflowAgent.zip
file located in this repo.
-
Deploy the Fulfillment webhook provided in the
dialogflow/functions
folder using Google Cloud Functions for Firebase:-
Create a Firebase project in the Firebase Console.
- You can find the
PROJECT ID
under settings ⚙ in the Firebase Console > Project Settings > General tab
- You can find the
-
Setup/Initialize Firebase SDK for Cloud Functions. For further info a.
- Run the following
$ npm install -g firebase-tools $ firebase login Allow Firebase to collect anonymous CLI usage and error reporting information? Y/n.
+ Press either Y/N and then you will automatically be brought to the browser to login and authenticate. When successfully authenticated you will see a success message in terminal.
$ cd dialogflow/functions $ npm install $ firebase use <PROJECT_ID> $ firebase deploy --only functions:popularVideos
+ The deploy command will output the project console link and visit in browser + More generally: `$ firebase deploy --only functions:FUNCTION_NAME`
-
-
Once in Firebase Console, from the left menu, go to > Functions > Dashboard > copy link listed under Event column // EX: https://us-central1-<PROJECT_ID>.cloudfunctions.net/<FUNCTION_NAME>
-
Back in the Dialogflow console, from the left menu, select Fulfillment > Enable Webhook > set the value of URL to the
Function URL
from the previous step > Save. -
Select Integrations from the left navigation menu and open the Settings menu for Actions on Google.
-
Select Test.
-
Select View to open the Actions on Google simulator.
- Type
Talk to my test app
in the simulator or - Say
OK Google, talk to my test app
a.Further info on initializing Firebase SDK for Cloud Functions. Make sure to reply "N" when asked to overwrite existing files by the Firebase CLI.
Check out Build An Alexa Fact Skill for information on how to deploy an Alexa Skill.
Please read and follow the steps in the CONTRIBUTING.md.
See LICENSE.
Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service.