Make Your Own Chatbot!
This short tutorial will guide you through making your very own text based game inside a chat bot. Google's Dialogflow is the chat bot technology of choice in this tutorial.
- Google Account
Add intents so that the chatbot user can exit the room.
- Go to Dialogflow.com
- Click sign up for free
- Log into your Google Account
- You should now see the welcome page to Dialogflow.
- Click create agent
- You should now see agent setup page
- Give the agent a name
- Use English as default langauge. (Note: Norwegian is also a selection, but since we have used English in the premade data this should be used)
- Click create
Guided tour around Dialogflow
- Assumption: you have a new and clean agent.
Import prebuilt agent
- Click prebuild agents
- Import the coffe shop agent
Creating new intent
An intent is a collection of phrases from the users mapped to responses.
- Click the intents menu point
- Click create intent
- Add a the name "definition of affogato"
A training phrase is an example of input that the user might want to write to hit this intent.
- Add training phrases
- what is the definition of affogato?
- what is the definition of an affogato?
- what is an affogato?
- what is affogato?
A response is the answer that the chat bot gives the user if he/she hits this intent.
- Scroll down and add responses
- An affogato (Italian for "drowned") is an Italian coffee-based dessert. It usually takes the form of a scoop of vanilla gelato or ice cream topped or "drowned" with a shot of hot espresso.
Context is used to remember things from earlier in the dialog.
- Scroll back up and add output context
- text should be definition_of_coffee
- click the number and set the timeout to 1
- click save
- when you see the button turn green the intent should be saved and the test chat is ready.
Testing the new intent
- To the far right of the site there is a try it now field.
- click field and type in "affogato"
- the output should then be the response added to the intent and a output context with a timeout of 1.
Adding a follow up intent
To follow up the previous affogato intent we can now create a new intent
- click the + button next to the intents menu point.
Add the name "definition of karsk"
Add input context
- text should be "definition_of_coffee"
- there should also be an output context with the same text.
Add training phrases
- how about karsk?
- "Karsk is a Norwegian cocktail from the Trøndelag region containing coffee together with moonshine and sometimes a spoon of sugar."
click save and test it in the chat.
Adding a entities
An entity is used to identify and pull out information from a phrase.
- Click the entities menu point.
- Click the @drink entity
- Add a new row to the bottom
- Name: Lemonade
- Values: Lemonade, Lemon juice, citrus juice
- save and try it out the chat by typing
- can i have a citrus juice.
Using pre built agents from Google
Collecting contact information
Purpose: Hand out t-shirts after collecting contact information.
- Create an intent that starts the dialog
- add training data with questions ex. "i want a free t-shirt!"
- Create an intent that collects contact information after the previous intent has triggered the dialog.
- create parameters for first and last name, e-mail and phone number (use system defined entities). All parameters are required.
- Add norwegian names and email in the phrases. Connect them to entities if they are not defined. Norwegian first names can be connected to @sys.given-name
- After the information have been collected, thank the user and say the t-shirt is sent.
Setup: Go to the prebuilt agent section and find the agent called support and click import
- Let the user report a bug
- Ask if the bug is serious
- ask if the user has a work around.
- fill out the answers on the other intents.
Setup: Go to the prebuilt agent section and find the agent called flights and click import Task: Expand the features of this chatbot by:
- adding a way to order parking
- It should be possible to order parking inside or outside
- if its inside there should be a way to order a car wash as well.
- order a rental car
- how many days?
- what type of car? (large, medium, small, sport)
- what color?
- with or without childrens seat.
Setup: Go to the prebuilt agent section and find the agent called jokes and click import Purpose: Create knock knock jokes!
- Create a knock knock joke where the bot asks knock knock
- Flip it around! Create a dialog where the user asks, knock knock and the bot joins in answering whos there... etc. (hint: can this be done with 1 intent?)
- Expand task 1. by adding a variation of knock knock jokes.
Setup: Go to the prebuilt agent section and find the agent called Tourism and click import
- Add answers on the intents that are added
- Expand the bot to handle Norwegian places
Setup: Go to the prebuilt agent section and find the agent called FAQ and click import
- create your own FAQ bot!
- You can use the prebuild agent for referance