Dialogflow - stops!

The Italian city that STOPs Google Dialogflow

Want to quit from a conversation with a bot provided through Dialogflow? You can use an Italian city, too.

Imagine that you go to the registry office.

The employee has to ask different questions, like your name, birthday, and so on.

He just asked the first one, you expect a lot more questions.

Second one 

BOT: “What’s your first name?”

USER: “John”

BOT: “Sorry to hear that. Bye. Next, please!”

This is what I am going to tell you in this story, where our main character is not the employee but Google Dialogflow.

BOT: Where are you from?

USER: New York City

BOT: Sorry to hear this, bye!

Wait, what?

Imagine that a bot is asking a simple question “where are you from?”. You insert the correct value and BOOOM. The bot suddenly closes the conversation!

Overview

TIP: familiar with Dialogflow? Start from Conversation exits!

We use Google Dialogflow to provide a rich conversation experience to our customers, driving them through different Intents according to some data that we need them to submit and/or modify.

google.com – Intents

To give context to someone not used to Dialogflow, an Intent categorizes an end-user’s intention for one conversation turn. For each agent, you define many intents, where your combined Intents can handle a complete conversation. When an end-user writes or says something, referred to as an end-user expression, Dialogflow matches the end-user expression to the best intent in your agent. 

When an intent is matched at runtime, Dialogflow provides the extracted values from the end-user expression as parameters. 

Each parameter is described by different attributes, forming a parameter configuration. For this article, let’s say that we are interested at some point in the conversation in a parameter called city that has an Entity type @sys.geo-city.

That’s it. We ask for a parameter called city and we expect our user to write a city in his response:

“Los Angeles”

“I live in Los Angeles”

“I was in Los Angeles”

are all valid sentences for usLos Angeles is extracted from the sentence and assigned to the parameter city.

Let’s finish this paragraph with the definition of Context: Dialogflow contexts are similar to natural language context. If a person says to you “they are orange”, you need context in order to understand what the person is referring to.

Conversation exits

Dialogflow has different features automatically provided that help you to create a rich conversation without having to reinvent the wheel.

System entities are one of these features.

Another important one is something called Conversation exits.

Some magic words will stop the conversation:

  • “exit”
  • “cancel”
  • “stop”

It’s impossible to avoid that this behavior happens, you can just apply some custom logic and reply one last time with a custom response.

Intent, parameters, conversation exits: a recap.

So, we are in a specific Intent, asking the user to give us a city name for our city parameter. At the same time, we know that some magic words will stop the conversation.

The Italian city that stops the conversation

Now we have all the elements to introduce the problem described in the article title. Our clients are from Italy, so the chat is in Italian, and 99.99% of the time the user is going to indicate an Italian city to our question.

One day, we had a support request from one of our clients: “When I insert the city where I live, the system replies with “OK, canceled. Goodbye.”.

-.-‘.

Open the logs.

Open the Dialogflow console.

Check the history.

Oh, wait, here it is! The city is called Fermoand “Fermo!” means “Stop!”.

BOT: Can you please tell me where XYZ happened?

USER: Fermo

BOT: Sure, goodbye.

The user would be something like -.-‘ .

What the Dialogflow Support team told us about it

We tried to reach out to the Dialogflow support team.

This is the most important part of the email:

Conversational exits for Actions on Google(AoG) are implemented on the AoG app’s side and cannot be overridden by Dialogflow.

Unfortunately, our team is unable to assist as your question is more closely related to Actions on Google

What the Actions on Google Support Team told us about it

We can understand that the word “Fermo” is in reference to a city. However, it is also a system level hotword. Unfortunately there is no solution to bypass the system limitation. Please consider maybe using Fermo city / town or something along those lines, however that may not be guaranteed since it is a system hotword. 

Read it again:

there is no solution to bypass the system limitation

Whaaaaat?? What we did

We provide the Dialogflow experience through the PHP Client library.

We created a list, that right now has only Fermo in it, of potentially dangerous cities.

When the user provides a single word response and we are in an Intent where we are asking for a city to extract a value for our @sys.geo-city parameter, we check if this word is in the list.

If so, we wrap the city in a context: “I live in <word>” before sending the response to Dialogflow.

There is no guarantee that this works, according to AoG support team response, but currently, it seems to work just fine.

Leave a Comment

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