# Dialogflow

With Dialogflow, you can pre-set some frequently asked questions, and your bot can deal with the simple queries on behalf of you and transfer the difficult. Besides, you can train your bot to understand more human language including greeting, gratitude, basic interaction, etc.

# Setup Dialogflow

dialogflow

Follow steps 1 to 4 to connect to your Google account.

TIP

If there is a prompt saying that "Google hasn't verified this app", try click "Advanced" and then click "Go to uchat.com.au". Don't worry, it's safe to do so.

Click the blue "Allow" button to allow UChat to get access to your Dialogflow account.

Visit Dialogflow Website, login to your Google account, then you will see your Dialogflow dashboard like this:

dialogflow

  1. Click "Create Agent" on the left sidebar
  2. name this agent
  3. pick a default language for the bot
  4. choose a default time zone
  5. once finish, click "CREATE"

"Google Cloud Platform service has been disabled"

If you fail to create an agent with an error saying "Google Cloud Platform service has been disabled. Please contact your administrator to restore service", it is possible that because the google account is from your organisation like [email protected]. You can solve this problem by either contacting the administrator in your company for Google cloud platform authorization or using your own Google account instead.

After creating a new agent, come back to UChat, click "Sync Agents" as below. All your agents will be listed here.

dialogflow

# Use Dialogflow

Choose one of your flows that you would like your Dialogflow agent to manage.

dialogflow

In the workspace of the flow,

  1. click "Automation" on the left sidebar
  2. activate the "default Reply"
  3. select frequency, usually "Every Time".
  4. click "Choose Sub Flow"

dialogflow

Select your agent and you are then able to manage your FAQs. Enter FAQ interface by clicking the "Manage Faqs" button as below:

dialogflow

This is how the FAQ interface looks like:

dialogflow

The "Sync Product Entity" button is for Ecommerce usage. By synchronizing product information in your Ecommerce system with Dialogflow, you can then recognize and reply to related products when users ask about them. To quote a product name, type "{{"to see the picture below

dialogflow

Click "+ New Faq" to start building your smart dialog:

dialogflow

For each frequently asked question, put as many synonymous sentences as you can in the question area and Dialogflow will help with the rest.

You don't need to worry about too many details because Dialogflow is using fuzzy matching. For example, you have already put "When is your office hour?" and "When do you open?". The bot can recognize it is asking about opening hours whatever user send "office hour?", "when u open?", etc even there is any abbreviation or grammar mistake.

The answer area is telling the bot what to reply when a question matched. The bot will randomly pick one answer from the answer list to send.

In "Send sub flow" area, choose a sub flow if needed. The sub flow will be sent just after the answer.

Finally, click "Save" and here you go, 🎉 your first FAQ has done. The bot is now understanding more human language! Keep testing and improving it.

# Improve Dialogflow

Back to Dialogflow Website (opens new window), you will see UChat created many FAQ intents on behalf of you:

dialogflow

  1. choose your agent
  2. click "Intents"
  3. these are the intents synchronized from UChat
  4. Test your bot here, see whether it understand which FAQ you are asking about.

Check and adjust "Default Fallback Intent" or "Default Welcome Intent" if needed. "Default Fallback Intent" is matched when none of the FAQ is matched.

Select any intent, give it some more editing to help the bot understand more:

dialogflow

For example, in this case, double click to select "Melbourne", then enter the keyword "city", click on "@sys-geo-city". This is telling the bot that the word "Melbourne" is a city. So next time when users asking "Can you deliver to Sydney?" or other cities, the bot can file the question to this FAQ.

There are various practical built-in lexicon includes color, time, post-code, country, street name, language, etc. You can even create your own!

# Dynamic Content Response

Response answer is not limited to just text. Try custom payload!

To begin with, create a FAQ in UChat with only questions, no answer or sub flow.

dialogflow

Wait a moment and refresh your Dialogflow intents until the new intent shows.

dialogflow

In the new intent, click area 4, "ADD RESPONSES", then "Custom Payload". Copy and paste any needed response format here, such as text/media/files, buttons, actions, quick replies and so on so forth.

dialogflow

In this case, a call button will be sent. So copy the following code to Dialogflow:

dialogflow

Adjust text, button title, number, etc as needed and click "Save":

dialogflow

Let's test it from the testing area on the right:

dialogflow

Well done! the bot recognizes that "can I call" is asking faq3.20.

dialogflow

The user side looks perfect as well. Feel free to explore other response types!

Last Updated: 1/20/2022, 11:33:49 PM