Author your first Health Bot scenario Quickstart
The Health Bot Service supports several built-in scenarios. For example, the bot can triage a medical condition, or find information about a disease.
In addition, partners have detailed configurability and control over the service functionality and behavior. Customers also have the ability to extend the functionality of the bot by authoring custom scenarios.
This Quickstart guide will walk you through creating your first custom Health Bot scenario.
You will learn how to:
- Author a new custom Health Bot scenario
- Chat with the bot instance to test your scenario
If you don't have an access to the Microsoft Health Bot, Apply for the Health Bot Evaluation Program before you begin.
Log in to the Health Bot Service Management Portal
Log in to the Microsoft Health Bot Service Portal once your evaluation request confirmed.
Author a new custom scenario
Customized scenarios can be added in the scenarios tab of the management portal. To begin creating scenarios for a new health bot instance, select the Add button at the top of the page.
The fields, visual editor, and elements provided in the Scenario Editor allow you to author, test, and debug scenarios.
We will start by defining the name and description of our scenario:
We will also set the scenario trigger as "start".
This will be used later on, once we define intents to be mapped to this scenario. Note: Scenario Trigger is case sensitive.
Each scenario appears as a graphical flow of controllers. Three types of controllers are available in the scenario editor:
Conversational elements that are visible to the end user, such as Prompts and Statements.
Flow control elements not visible to the end users but rather used to create the logic of the conversation.
Navigational elements such as Zoom, Trace, and Watch not used at runtime, but which help the scenario author to create and debug the scenario.
For the full list of elements and their meaning see Scenario Elements
Let's select a Statement element and place it in the editor window. A Statement triggers an output from the health bot instance with no expectation of a response.
You can open and edit the fields at any time by double-clicking on the object in the visual editor, or right-clicking and selecting Edit.
A JSON view is available as well for editing ease and allows easy access to the underlying code.
The text-based code is generated automatically when the author adds new objects to the visual
editor and is updated automatically after any changes.
The JSON format also allows scenarios to be exported and imported.
Move to the code tab to see the underlying JSON code.
Now let's make things more interesting and add other elements to the conversation flow. A Yes/No Prompt defines a two-way split in the flow based on user input. We will use it to ask the user if they are interested in scheduling a meeting with a doctor. The response to this question will be saved in a variable named "ShouldScheduleDoctor".
To learn more about Health bot variables see Health bot instance variables
Now let's connect the Greeting element with the Schedule prompt by dragging an arrow from one element to the other.
We can define what will happen further in the conversation based on the user response.
Let's write something to the user by adding two more statement elements and proceed to test the conversation we have just authored.
Chat with the bot instance to test your scenario
Note! Before you can test your scenario, make sure to first Save it. Then, press Run.
The Web Chat panel in the upper right of the Scenario editor allows you to run and test scenarios as you go. It will first display the 'Hello, World!' greeting element and will then continue to the scheduling condition.
At any time, you will be able to see the current step being executed in the conversation
For more debugging options please see Advanced Debugging
Once you have completed testing the flow, you can exit the scenario editor.
A new record will be added to the list of scenarios.
|Export your scenarios||Use the Export button to export all the selected scenarios as JSON files for safekeeping, sharing, and to move from staging to production.|
|Import||Use Import to import a JSON blob in to one or more scenarios.|
|Enable or Disable||You can enable and disable scenarios using the on / off toggle buttons next to the scenario|
Now that you have authord your first scenario, get yourself familiar with additional Bot Service capabilities.