DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Make Smarter Chatbot Conversations by Handling Interruptions in Teneo

See how to make smarter chatbot conversations by handling interruptions in Teneo.

Gareth Walters user avatar by
Gareth Walters
·
Oct. 24, 19 · Tutorial
Like (1)
Save
Tweet
Share
3.51K Views

Join the DZone community and get the full member experience.

Join For Free

Image title

Smarter chatbot conversations.

When you build a flow that prompts the user for information you need to decide what should happen if the user does not respond to the question as expected. Here you'll learn how to slightly change the coffee order flow so that it may be interrupted and then resumed if the user does not immediately respond to which coffee she wants.

You may also like:  A Beginner’s Guide to Creating an Interactive Chatbot Flow in Teneo

Let's look at an example:

User: I'd like to order a coffee.
Bot: Ok, what coffee would you like?

User: Which coffees do you have? (the coffee order flow is interrupted)
Bot: We offer a variety of handcrafted coffee drinks, from espressos to macchiatos to flat whites and more.
Bot: Let's continue with your order. Which coffee would you like? (the coffee order flow is resumed)

User: A large flat white, please.
Bot: Ok, a large flat white will be ready for pick up in 5 minutes.

In the conversation above there are two flows at play. First the coffee order flow, and then, in the middle of that flow, the flow about available coffee types. These flows are designed independently of each other, and there is nothing in the flows that link them to each other. In fact, once we've adjusted the coffee order flow to survive interruptions, it may be interrupted by any other flow and still be resumed at the point it was interrupted.

To cater to the conversation above you only need to do two things:

  • Allow the output node in the coffee order flow to survive interruptions (set it to re-visitable).
  • Add a resume prompt (optional).

Set the Output Node to Revisitable

To allow the output node to survive interruptions you need to make it re-visitable. This is how you do that:

  1. Open the 'User wants to order a coffee' flow in edit mode
  2. Select the output node 'Ask for coffee type'
  3. Open the 'Answers' panel
  4. Use the toggle at the bottom that initially says 'Not re-visitable'. Change it to 'Limiting revisits to' and leave the limit to the default value 2. This limits how many interruptions in a row the output node should survive. Note that the border around the node in the graph disappears! This signals that the node is now re-visitable.
  5. Hit 'Save'


Interrupt Your Bot in Try Out!

Now, go ahead and try the adjusted flow in tryout! When the bot asks which coffee you want, test what happens if you say: 'Which coffees do you have?'.

User: I'd like to order a coffee.
Bot: Ok, what coffee would you like?
User: Which coffees do you have?

Add a Resume Prompt

If you want your bot to say something slightly different when the output is resumed, you can add a resume prompt. This is how you go about it:

  1. Select the output node 'Ask for coffee type'.
  2. Open the 'Resume prompts' panel.
  3. Click 'Add' and enter an answer text. For example Let's continue with your order. Which coffee would you like?
  4. Hit 'Save'!


Interrupt Your Bot Again!

Have another play in tryout. What happens now if you say 'What coffees do you have' instead of replying to the prompt for type of coffee?

User: I'd like to order a coffee.
Bot: Ok, what coffee would you like?
User: Which coffees do you have?

There are no clear-cut rules which flows (or outputs) you should make re-visitable. Rather it's an act of balance. On the one hand, you don't want your bot to be annoyingly stubborn. On the other hand, if the interruption happens in the middle of a complex flow, you don't want to drop that flow and force the user to start all-over once the interruption is dealt with. Regardless of your design skills, re-visitability is something that you are likely to fine-tune once you've gathered some log data with real interactions.

Extra Challenge for the Brave!

We have shown you how to make the "Ask for coffee type" node re-visitable. However, the user may just as well interrupt the current conversation after being prompted for the coffee size. Can you make the "Ask for size" node re-visitable to enable a conversation like the following:

User: I'd like to order a coffee.
Bot: Ok, what coffee would you like?
User: A flat white, please.
Bot: What size would you like?

User: Is your store in London? (the coffee order flow is interrupted)
Bot: We have recently opened a brand new store in London! We're looking forward to seeing you there!

Bot: Let's continue with your order. What size would you like for your flat white? (the coffee order flow is resumed)
User: A large one, please.
Bot: Ok, a large flat white will be ready for pick up in 5 minutes.

Further Reading

How to Develop a Chatbot From Scratch

Conversations (software) Flow (web browser) Chatbot

Published at DZone with permission of Gareth Walters. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Memory Debugging: A Deep Level of Insight
  • A Simple Union Between .NET Core and Python
  • Data Mesh vs. Data Fabric: A Tale of Two New Data Paradigms
  • PHP vs React

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: