Recently, on the Dialogflow Product forum, there was this question: There is also a reply by a Google employee, which you should go and read. There are two interesting things about this question: The asker is effectively trying to fit their entire chatbot into a single intent The asker thinks that everything should be an entity (which is probably a direct consequence of point 1) But I was more interested in why someone would think that the entire sentence is full of candidates for entities. In my opinion, you should actually try to use an entity only when you absolutely need to. So how can you decide what should and shouldn’t be an entity? Here are some ideas. Learn about […]
This is a post about where to host your webhook. However, this is not a post about cloud service providers. I am not going to talk about which one is better – Google Cloud or Heroku or AWS or Azure. Rather, I am going to ask you to consider the option of placing your webhook outside of your Dialogflow process. How the webhook works Generally speaking, the webhook works like this: End user sends a message to your Dialogflow agent via a messaging channel such as Twitter or Slack through Dialogflow’s test console an API call Your agent maps the message to an intent The agent sends some JSON to the webhook The webhook performs business logic after extracting relevant […]
The slot filling feature is hands down one of the coolest features in Dialogflow. Not only that, it is often the centerpiece of many demos given by the Dialogflow team. So why am I asking you to avoid slot filling? Because there are three common scenarios which the existing slot filling implementation cannot handle well. Do you need to ask user to confirm their input? As it happens, in real world chatbots, we need to ask the user to reconfirm their input. It becomes especially important in transactional scenarios where the reconfirmation is our last chance to implement a conversational “rollback”. With slot filling, you cannot ask for reconfirmation of an input right away. And if you do it outside […]
Did you know that Dialogflow will allow an intent to be mapped even if the entity you specify is missing? For example, suppose you create an agent with a single intent with exactly one userSays: “I want to book a ticket to @sys.geo-city” Even if you added the geo-city entity in template mode, there will be occasions when Dialogflow will map a phrase such as “I want to book a ticket to Kovai” As it happens, Kovai is a proper city in south India but it usually goes by the name Coimbatore. However, the name Kovai is very common in colloquial use. Notice what happens inside the Dialogflow console: You can notice three things: The intent did get mapped The […]
I recently got this question on my YouTube channel: Without knowing the full details of the question, I suppose this person has set a lifespan which is more than 1 (the default option in Dialogflow is 5). Ideally, you always set a context lifespan of 1 for all your contexts to avoid these kinds of issues. Also, if you would like an intent to be ignored, you need to set an input context for that intent. In theory, an intent is always a selection candidate if you have not added an input context. So an important step in creating intents which can be “ignored” is to add an input context to that intent.
Did you try to use the Dialogflow REST API v2 and found out that your webhook which used to work before stopped working? Here is what the two JSON formats look like when inspected side to side Given that the root object – “result” vs “queryResult” – is already named differently, your webhook will fail almost no matter what code it executes. Also note that there is a warning about this in Dialogflow’s console when you try to enable the v2 API. Takeaway As soon as you flip the switch, Dialogflow’s v2 API will start sending webhook requests in the new JSON format. Before you do that, make sure you understand the JSON structure and handle it appropriately in your […]
If you are building a commercial grade Dialogflow chatbot, you should definitely consider adding some regression testing to your chatbot. What is regression testing? The idea behind regression testing is that you will run a series of tests and verify if the performance of your chatbot is consistent over time. How to do regression testing in Dialogflow? You will make use of the /query endpoint in the REST API exposed by Dialogflow. By writing scripts which will send specific, pre-determined user phrases to the /query endpoint, you can verify if the phrases are getting mapped to the same intent (by using the intentID). Why do regression testing This brings us to the next question: why should you do regression testing […]
Last week, Dialogflow announced the availability of v2 of their API. It is still in beta, and there are some fairly significant changes coming up. [Also, a quick comment that I am very glad they changed their name from API.AI before this announcement. Otherwise people will be referring to API.AI API v2 vs API.AI API v1 etc. I am guessing even Google would have been so confused by this that it wouldn’t have even been possible to search for stuff. 🙂 ] Here are the changes that I could notice straight away Access via RPC You can also use RPC and not only REST for accessing the v2 API. The documentation for RPC based access can be found here. You […]
A few people have asked me if Dialogflow (then API.AI) had a paid tier with better support. Last week, they announced that an Enterprise version was now available. It still seems to be in BETA. Significant changes: A promise for much better support A paid tier with higher usage quota As I learn more, I will keep adding updates to this post.
You might be familiar with the concept of the fallback intent in Dialogflow. It can be tricky to handle. All the more so when you are getting user input. However, you can try the following idea if you are creating a mixed mode chatbot. Asking user for input So in the regular intent, you ask the user for input. At this point, they can just type or speak their choice. E.g. User:”I want to book a flight” Bot: “Which class of ticket would you like?” User:”Economy” Bot:”OK, where from?” …. Here is what a simple fallback might look like: User:”I want to book a flight” Bot: “Which class of ticket would you like?” User:”The best one” Bot:”I am sorry, I […]