Make a google Fact Action with firebase cli

Hello friends!

First of all, I tell if you are beginner then follow this link before reaching here

link:- MAKE YOUR FIRST GOOGLE ACTION FOR GOOGLE ASSISTANT

Before getting start actions development using firebase cli  you need some steps to keep in mind

The following tools must be in your environment:

Familiarity with JavaScript (ES6) is strongly recommended.

We make our first google actions Fact actions. You can find the sample code below

Sample fact action code link:-  Google fact action

Now get started with Firebase CLI

Step 1: Install Firebase command line interface (CLI)

The Firebase Command Line Interface (CLI) will allow you to deploy your Actions project to Cloud Functions.

Tip:- To install the CLI you need to have installed npm which typically comes with Node.js.

To install or upgrade the CLI run the following npm command:

npm -g install firebase-tools

Tip:- Doesn't work? You may need to change npm permissions.

To verify that the CLI has been installed correctly, open a terminal and run:

firebase --version

Tip:- Make sure the version of the Firebase CLI is above 3.5.0 so that it has all the latest features required for Cloud Functions.
If not, run npm install -g firebase-tools to upgrade as shown above.

Authorize the Firebase CLI by running:

firebase login

Step 2: Setup for local development

Before setting up for local development you need to keep in mind some Key terms

Key terms:- 

  • Cloud Functions for Firebase: A service provided by Google that lets you run your webhook code in a managed environment on the cloud. You use the Firebase CLI (command-line interface) tools to deploy your webhook to Google Cloud Functions.

Why develop your Actions locally?

In contrast to using the Dialogflow inline editor, you can use a local machine, which gives you more control over your programming and deployment environment. This provides several advantages:

  • A locally-developed webhook supports a much larger suite of Actions on Google features.
  • You are not restricted to only one webhook implementation file (index.js).
  • Developing in a local environment also lets you follow software engineering best practices, such as using version control, for your Actions project.

Download your base files

Before starting development you need to download required Facts repositories

git clone https://github.com/actions-on-google/dialogflow-facts-about-google-nodejs

Important Steps:-

In order to test the Action that you’ll build for this project, you need to enable the necessary permissions.

  1. Go to the ‘Activity Controls’ page (https://myaccount.google.com/activitycontrols).
  2. Sign in with your Google account, if you have not already done so.
  3. Ensure that the following permissions are enabled:
  • Web & App Activity
  • Device Information
  • Voice & Audio Activity

Step 3: Setup your project and agent

Next, you’ll need to set up the Actions project and the Dialogflow agent for your fact action

If you’ve already completed the MAKE YOUR FIRST GOOGLE ACTION FOR GOOGLE ASSISTANT. 

Then do following

  1. Go directly to the Dialogflow console.
  2. Navigate to Fulfillment.
  3. Disable Inline Editor.
  4. Click Save.

If you’re starting from scratch, do the following:

  1. Open the Actions Console.
  2. Click on Add/import project.
  3. Type in a Project name, like “world facts”. This name is for your own internal reference; later on, you can set an external name for your project.
  4. Click Create Project.
  5. Rather than pick a category, click Skip on the upper-right corner.
  6. Click Build > Actions in the left nav.
  7. Click Add your first Action.
  8. On the Custom intent dialog, click Build to launch the Dialogflow console.
  9. Click Create.
  10. Click the gear icon on the left navigation.
  11. Click Export and Import.
  12. Click Restore From Zip.

Dialogflow

  1. Upload the FactsAboutGoogle.zip file.
  2. Type “RESTORE” and click the Restore button.
  3. Click Done

Step 4: Deploy your fulfillment

Now that your Actions project and Dialogflow agent are ready, do the following to deploy your local index.js file using the Firebase Functions CLI:

firebase use <PROJECT_ID>

for finding project id see the below picture

project id

 

Run the following command in the terminal to install dependencies.

npm install

Run the following command to deploy your webhook to firebase

firebase deploy

Note:- If you see an error message that says “An unexpected error has occurred from the CLI.”, try running the commandfirebase deploy again.

Step 5: Setup the URL in dialogflow

Now you need to update your Dialogflow agent to use your webhook for fulfillment. To do so, follow these steps:

  1. Open the Dialogflow console (you can close the Firebase console if you’d like).
  2. Navigate to Fulfillment on the left navigation.
  3. Enable Webhook.
  4. Paste the URL you copied from the Firebase dashboard if it doesn’t already appear.
  5. Click Save.

Web hook url

 

Note:- You get your webhook url after deploying your code to firebase function sucessfully.

if you finding any problem about this you can follow our video tutorial.

For any help comment , we help you

About

View all posts by

3 thoughts on “Make a google Fact Action with firebase cli

  1. Магические услуги, на сайте вы найдете [url=http://мир-магов.рф]Приворот[/url]
    На портале размещены лучшие и проверенные Маги России.

  2. Воспользуйся промокодом HSV-90660-TFJC на сайте Pandao и получи 400 баллов на счет. Заказывай товары из Китая абсолютно бесплатно.

  3. Greetings
    Nowadays it is so difficult to remain adequate.
    So I want to ask, dear, how long will we endure all this.
    Never such a thing and here again.

  4. New york facts Reading for Information – Interesting Facts About New York
    A webquest and reading activity for Intermediate English language students. Learn some interesting and unusual facts about The City of New York, and try some follow-on activities to test how much you have understood. Part of a free online series of lessons ]
    The post New york facts Reading for Information – Interesting Facts About New York appeared first on Ghana Finance.

    Diet News

  5. In travel or on travel and Video
    In travel or on travel In travel or on travel In travel or on travel Destination: Europe Ship: Independence of the Seas 6 Night Canada & New England Cruise Destination: Canada/New England Ship: Oasis of the Seas 7 Nights Southern Caribbean Holiday on Celebrity Summit Destination: Caribbean Ship: Celebrity Summit 11 Nights Bermuda & New England Cruise on Celebrity Summit Destination: Bermuda Ship: Celebrity Summit 51 Days – World Cruise Liner – Sydney to London (Dover) – Sydney to London (Dover) aboard Sea Prince From $8,389.00 (USD) Destination: World Ship: Sea Princess 15 Days – Panama Canal – Ocean to …
    The post In travel or on travel and Video appeared first on Finance USA.

    South-sudan Business

  6. car sale uk
    Homes for rent around me ) Video
    Homes for rent around me Homes for rent around me Houses For Rent Near Me Upstairs Houses For Rent Near Me Upstairs – There are several reasons why people like to enter “affordable properties for rent around me” as soon as they are going to seek out some house advertisement. One of the possible motive is that they previously such as the area of their current home. Some might desire to order a brand new home for the family group, friends or family. Some people which have enough funds to have residence investments should undertake it too. If you have …
    The post Homes for rent around me ) Video appeared first on Credits.

    Motel News

  7. classic car sale
    Managed Services
    managed it software But lacks the performance and interior quality Managed Services top 2010 minivans, what if I don’t need the money Managed Services now. Instead—these prevent movement better than the parking Managed Services does, one of the most popular transportation methods is a Managed Services. Christmas Holiday Packages, there’s something about Sydney that really makes it stand out from the country as a whole. MMC R 29 Aero Alpha IDW Wing, Managed Services there’s always a deal waiting to be discovered. It may be secured by a mortgage or other collateral, canada Day. 500 /mo, Managed Services 0 0 …
    The post Managed Services appeared first on Credit & loan.

    Commercial News

  8. car for sale in london
    Private Security Company for Hire in Rochester NY
    cop alarms Borrowing a friend’s car, there are two types of educational loans—federal and private. Right now, keep in mind that every provider is unique. Our company does not guarantee that completing an inquiry form will result in you being connected with a service provider Private Security Company for Hire in Rochester NY Private Security Company for Hire in Rochester NY, you typically need to fall Private Security Company for Hire in Rochester NY at Private Security Company for Hire in Rochester NY the 50th percentile. Be sent to you by certified mail, your car-care contacts should clearly include a …
    The post Private Security Company for Hire in Rochester NY appeared first on Auto&Car.

    San-jose Finance

Leave a Reply

Your email address will not be published. Required fields are marked *