Creating chatbot using google Dialogflow

Written By Chetan Iterate (Administrator)

Updated at January 5th, 2021

The google assistant has a very easy way to create chatbot flows which is 'Google Dialogflow', Deploying Dialogflow is intuitive and simple in interplay, so let's get started. for this example, we are creating a simple E-Commerce application on Dialogflow

Prerequisites:

1) Google environment configuration file(Select .json format )

To generate an Environmental configuration file, Please follow the steps:

  1. Proceed to Create Service Account Key Page.
  2. Select Your Dialogflow project by selecting 'Project' from the Drop-Down menu and choose your Dialogflow project name
  3. In-Service Account Name, enter Name and the 'Roll List' and select Project as 'Owner'
  4. Download the key file. While downloading the key, make sure it is in .json format 

Steps:

Part 1: Setting Google Environment

1) create a tab by clicking on 

Later by Double-Clicking on Tab name, you can change it as you like

1) Find and drop 'Inject' Node in editor(For this example, inject is used for initiating a flow).

2) Find and drop 'Set Google Environment'

Same as for 'console' Node:

3) connect these nodes as shown


4) Now we need to upload our downloaded file into managed storage. Click on

Then on 'Manage Storage' to reveal the storage option

remember to give a path to 'Set Google Environment' Node. It will be like

/interplay_v2/public/private/<Your_File_Name>

6) Edit Console Node properties


5) Deploy and Trigger the Inject Node and check the console output by clicking on 

and then clicking 

Environment Variable Saved.

 We are good to go.


Part 2: Creating Intents

1) Create a new flow in the same tab, except 'Set Google Environment' is replaced with 'Intent' node.

2) Double Click on Intent Node and set its property like:

You can use 'Add' for adding new intents.

Caution: Project ID Should be matched with ProjectID in Dialogflow

3) Switch to a new tab in the editor, it should be an empty one

4) Search and drop these two Instances:

This node works as an inlet and outlet respectively.

After Dropping 'VA In' node, set its properties

5) Next flow intents are exclusively made from these nodes:

6) Drop 'intent switch','Intent', 'Simple Response','Actions Serialize' node in Editor and connect as shown:7) Edit Intent node such as:

'Intent' node redirects it's to response, double-click 'Simple Response' to edit

8) Similarly create another flow and connect from 'Intent-switch' to initialize and 'Serialize' to end:

Edit SimpleResponce to send 'Bye!' Message Node as : Also edit 'actions-basic-card' as:

Yup! our Recipe is ready to deploy and see the magic!

Was this article helpful?