Creating chatbot using google Dialogflow

Written By Chetan Iterate ()

Updated at April 19th, 2022

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 a 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 the 'Manage Storage' button looks like this:

 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 the debug icon on the bottom. You should see something like the text below.

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 the '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 the' 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?