Software Architect / Microsoft MVP (AI) and Pluralsight Author

Bot Framework, C#, Chatbots, Cognitive Services

Form Dialogs: Code Generation Comes to Bot Framework Composer

Building bots with Bot Framework Composer means creating dialogs to represent and serve the conversational experience. Dialogs typically involve accepting and processing user input then returning a response to the user.

Natural language understanding services such as LUIS are often used help identify the underlying intent behind utterances supplied by the human.  The existence of entities in utterances may also be identified.

Building Bots

This means that when creating bots, you must create several assets such as:

  • Natural language understanding model
  • multiple dialogs
  • .LU and .LG files

 

Wouldn’t it be good if you could just specify a schema with a datatype and description and get all of this autogenerated for you?

This is where Form Dialogs come into play. Form Dialog is a preview feature that’s currently available in the latest release of Composer.

The new capability lets you define a property name and type for fields that you want to capture as part of your conversation experience.  You can create as many as you want and use multiple data types.

Under the hood, Form Dialog will automatically create all the required assets (.DIALOG, .LG, LU) that would be needed in a typical dialog to handle the properties you define in your schema.  The LUIS language model to support each form dialog is also generated for you.

Form Dialog Demo

I’ve created a short demo on YouTube that shows you this in action. The video is nowhere near the quality of my Pluralsight work but will let you see Form Dialog in action.

In this demo you’ll see me create chatbot that takes a coffee order.  You’ll also see what happens when I try to force an error.  You can view the demo here.

How I Might Use Form Dialogs

I’m building bots 5 days a week and it’s unlikely those will be rewritten to use Form Dialog. The biggest win for me personally will be to use a Form Dialog in use cases where I need to literally perform data capture and quickly.

I can have my code first and/or Adaptive dialogs doing all the heavy lifting and quickly generate a Form Dialog when I need the typical CRUD operations in a conversation.  This is the immediate use case for me, and you’ll probably have your own.

You can access the generated JSON and LUIS model via the regular portal (or change it in Composer) but at this point I can’t see me messing around with the autogenerated code.

Summary

In this blog post we’ve introduced Form Dialog. We’ve also looked at some of the benefits and how you might use it.

You can check out the demo on YouTube.

JOIN MY EXCLUSIVE EMAIL LIST
Get the latest content and code from the blog posts!
I respect your privacy. No spam. Ever.

Leave a Reply