How to use Dialogflow’s Small Talk agent with Chatfuel

in dialogflow •  7 years ago 

This tutorial is intended to be a follow up to Andrew Demeter’s post on How to integrate API.AI with Chatfuel.
Once your bot is connected to Dialogflow, here are 6 things you can do to make it smarter.

  1. Delete ALL of Dialogflow’s Default Fallback Intent text responses

If your bot didn’t understand what the user said the first time, it’s not going to understand if the user repeats the query.
Change the Default Fallback response to something like “I didn’t understand that, I’m just a bot. 🤖”. You can also offer suggestions on words your bot will understand, like “say Menu for the main menu” or “say help to see what I can do”.

  1. Do not toggle the Small Talk Switch.
    If you enable Small Talk, you can customize answers to questions like “Who Are You” or “How Old Are You” etc. However, Dialogflow does not show you all the questions triggering the response, or what the default response is if you leave the answer blank.

You may find your bot returning a response which you did not program, and it can be challenging trying to figuring out which Small Talk intent is triggering that response.
If you’ve switched Small Talk on, you may see your bot responding to “ who is RANDOM NAME” like this:

Wrong!
How do we fix it? We need to figure out which intent is triggering the response. Unfortunately the Small Talk Customization Process does not allow us to do that very easily.

  1. Go to Prebuilt Agents and import the Small Talk Prebuilt Agent.
    A better option would be to go to Prebuilt Agents and import the Small Talk module (h/t Aravind Mohanoor from Mining Business Data for this tip!)

When you import the module, Dialogflow will create a new agent called Small-Talk with 86 different intents.

Within each intent, there are multiple prebuilt contexts. Note: some intents have have multiple pages of contexts, so be sure to toggle through all the pages.

Sadly, Dialogflow does not make it easy for you to search for contexts and responses within these intents.
Going back to our earlier example, if we wanted to figure out which intent was triggering the response to question “who is RANDOM NAME”, we would have to open up each intent and look for the response.
It’s not in smalltalk.agent.acquaintance (which houses the context “who are you”), it’s actually in smalltalk.agent.boss.

The context triggering the response is “who is your master”, and the default text response is “You are, of course”

Now that you’ve isolated the intent, you can either fix it or delete it.

  1. Copy GoogleSheet with Small Talk Agent responses
    To help bot builders navigate the contexts and responses in the Small Talk pre-built agent, I’ve created a searchable database mapping out all 86 intents, 1,041 contexts and corresponding text responses.

If your bot says something you don’t recognize, you can search this database to troubleshoot and isolate the intent triggering the response.
If you’re setting up your agent for the first time, use the spreadsheet to select which intents you need and customize the text responses accordingly. You can find the GoogleSheet here: deb.bi/Dialogflow-Smalltalk

  1. Select intents you want and copy to destination agent

Uncheck “Copy related entities” and select the agent you wish to copy the intents into.

  1. Set the answer to “Who is YOUR NAME”
    Bot builders for some bizarre reason like to ask other bots who their bot masters are. Why? Beats me!
    Set up an intent…

… and save your name / nicknames as an Entity.

Then train your bot not to respond to other names. You can use Dialogflow’s system entity for this.

And that’s how your bot can have better control over Dialogflow’s Small Talk agent!
If you’re using Chatfuel but have not hooked your bot to Dialogflow, you can use the spreadsheet as a reference and manually enter responses into Chatfuel’s AI Rules.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://chatbotslife.com/how-to-use-dialogflows-prebuilt-small-talk-agent-with-chatfuel-8054379e5848