Autogenerated Bots | DialogFlow

Dissecting the Dialogflow agent ZIP file

I recently built an app which lets you do full text search across all your Dialogflow intents, as well as filter on input and output contexts. In the process, I needed to get a good understanding of what the Dialogflow agent ZIP files contain. Here is a summary of things I learnt. This could be useful if you wish to use the agent ZIP file to build out your own Dialogflow tooling. ZIP file structure First, I unzipped the ZIP file and loaded it into WebStorm, which is an excellent IDE for working with JavaScript. The folder structure looks like this: The agent.json file has metadata about the agent itself, while package.json has versioning information. UserSays and Response JSON files On…

Conversation Design | DialogFlow

What if the exact text in the user phrase does not fire the intent?

I got a comment recently on my post about intents which don’t match like you might expect. This is an extremely unlikely scenario. But here are some troubleshooting tips. Make sure the input context matches In a previous article, I shared an example of an intent in my SupportBot where people express interest in coaching. The intent definition for the “Coaching” intent looks like this: For this intent to fire, the context must already be set to awaiting_service_choice. If you have a wrong context set, the intent will not fire even if the words are an exact match. Make sure the previous intent was mapped correctly When you set contexts in this fashion, in fact, usually it is quite likely…

DialogFlow

Why you need to add an input context to (nearly) all your intents

On my website there is a SupportBot. Since I have hooked it up to Chatbase, I can create funnels for different conversation paths. Coaching Funnel Here is a possible path that the user could take. In this case, the funnel tells me how many people (out of those who start chatting) are interested in coaching services. For the purposes of this discussion, the last step in the funnel could be any action that you might want the user to take. Here is my question: How can you be confident that the percentage (here 3.6%) is a reasonably accurate representation for the number of people who reach the end of the funnel? False positives First, we should consider false positives. This…

DialogFlow

Why Dialogflow webhook documentation is so sparse

In the Dialogflow forums, you will see that people are constantly asking for help with webhooks. And if someone were to create a good webhook course, supply-demand economics suggests that they could make a tidy profit. So why isn’t there such a course? The Exponential equation I have mentioned it in forums before, but the challenge is with the number of variables involved. As you create a moderately complex webhook, you need to choose three things: the programming language the database the hosting platform/service Since webhooks are intentionally designed to be extremely flexible, you can choose any suitable technology for any of these three choices. Naturally, people are most likely to stick to what they already know. Let us suppose…

DialogFlow | REST API

Quick tips for Dialogflow REST API users

If you are using Dialogflow’s REST API, these tips can help speed up your development. Use the Postman app If you hadn’t used it already, Postman calls itself “the complete toolchain of API developers”. For our case, Postman allows you to take the various API calls you see in the Dialogflow documentation and test these requests. For example, here is a request I created as I was working on the Chatfuel integration tutorial. But here is the best part. Once you confirm that the request is constructed properly, you can simply use the Code link at the top right and get auto-generated code for the request you just made. And the Postman app supports many programming languages: Understand what a…

DialogFlow

Chatbase review

I have been receiving a few enquiries about Chatbase recently. Since you can see the benefits of using Chatbase a lot better after integrating it with your chatbot, I thought I will do a review of Chatbase based on my recent experiences. Note: This is not intended to be a comprehensive review. This is what I have seen till now, sort of a “first looks” review. For context, I integrated the SupportBot on my website with Chatbase about 2 weeks back. However, the SupportBot is being constantly updated and improved and you might notice a few differences between its behavior and what you see in the Chatbase output. SupportBot The support bot is a chatbot which helps guide visitors to…

DialogFlow

Using the text responses from Dialogflow console in your webhook code

This is another question which came to me from a client, and I think the answer might be helpful for a lot of folks. Here is the challenge: You want to use the text response you write in your Dialogflow console to be available to the webhook code. Here are three reasons for doing this (there may be others too): maintain the WYSIWYG (what you see is what you get) for your copy editors, who are usually not programmers. They write the copy inside the Dialogflow console, and you just use it from your webhook code implement some kind of templating system where you write the copy in the text response and populate the dynamic stuff in the webhook let…

DialogFlow

What is a good value for the ML Classification Threshold in Dialogflow?

This was the question I received from multiple clients recently, and I have been thinking about this question for a while. Recently, I got some time to do some research on this problem and here are my findings. The quick and dirty answer If you don’t have time to read the post and just need a quick and dirty answer: just use the Default value you get when you create an agent. It is very likely optimized for the other recommendations provided by the Dialogflow team. But remember that when you choose this option, you also have to follow the other recommendations. Here are the defaults when you create an agent: Notice that you are already presented with some default…

DialogFlow

Can you use Dialogflow without writing code?

I have a survey bot on my site on each post, and recently, I got this question: Can I use Dialogflow without writing code? And the answer, as in many things, is “it depends”. The FAQ bot One of the first bots I created for this site was an FAQ bot which simply gives links to popular articles on some famous blogs. As it turns out, creating this FAQ bot needs no coding whatsoever. And unlike the typical chatbot you would create, it needs no entities or contexts either. In other words, it is just a whole bunch of intents. So much so, you can use Notepad or your favorite text editor, list some answer links, and a bunch of question…

DialogFlow

Some tips for choosing the correct entities in Dialogflow

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…

DialogFlow

Dialogflow webhook for website chatbots

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…