Dialogflow Fulfillment: Importer Sample
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:
skilldirectory 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.
dialogflowdirectory 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.
Steps to deploy a Dialogflow Agent to Actions on Google
- Go to Add to Dialogflow button below to Create Agent:
- Upload the
dialogflow/DialogflowAgent.zipfile located in this repo.
Deploy the Fulfillment webhook provided in the
dialogflow/functionsfolder using Google Cloud Functions for Firebase:
Create a Firebase project in the Firebase Console.
- You can find the
PROJECT IDunder 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 URLfrom the previous step > Save.
Select Integrations from the left navigation menu and open the Settings menu for Actions on Google.
Select View to open the Actions on Google simulator.
Talk to my test appin the simulator or
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.
Steps to deploy the Alexa Skill to Alexa Skills Kit
Check out Build An Alexa Fact Skill for information on how to deploy an Alexa Skill.
How to make contributions?
Please read and follow the steps in the CONTRIBUTING.md.
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.