Releases: microsoft/ConversationLearner-Samples
June 3rd - 2019
Breaking Changes
None
New Features
SET_ENTITY actions and ENUM entities
We now have a new type of entity called ENUM (short for enumeration) and a new type of action called SET_ENTITY, which can set the entity to one of these enum values.
These new features allow you to handle close-ended prompts with ease. You can use these features to set entities when detection or setting of the entity is context-dependent and the number of possible values for the entity is fixed. Previously, this could have been achieved using programmatic entities and API callbacks, but it was tedious, leading many to opt for lesser flexible solutions. We now have first-class support for these scenarios.
For more information see our new tutorial: When to use ENUM entities and SET ENTITY actions
Action Deletion - Placeholder Removal
The existing action deletion process left missing action placeholders in the train dialogs. This forced the dialogs to become invalid, which meant you had to individually correct each dialog. Now, if you're confident the action can be removed safely from all or a large subset of the dialogs, you can choose to remove these placeholders. This can save additional work needed to clean up the train dialogs.
Upgrading
April 25th - 2019
Breaking Changes
None
New Features
Experimental Feature: Tree View for visualizing Dialog Flows in Train Dialogs
- Added a new "Tree View" for train dialogs so dialog authors can visualize the dialog flows and paths in a consolidated view.
- Simply click on the "Tree View" button in the train dialogs page for a consolidate view of your train dialogs in a tree structure.
- We are looking for feedback on how we can improve this view and what details would help you better manage your train dialogs. Please write to us at [email protected] with your suggestions/ideas/feedback.
Ability to merge semantically equivalent train dialogs
- Another much requested feature was for ability to consolidate the number of train dialogs by merging semantically equivalent dialogs.
- In this update, when you try to save a new train dialog, an edited train dialog or a log dialog converted to a train dialog, we check if it matches an existing train dialog semantically (i.e. dialog flow, changes to dialog memory, sequence of actions, etc.) and prompt the dialog authors to merge the equivalent dialogs if found.
- If there are multiple equivalent dialogs, the merge option selects the first train dialog that matches.
- Dialog authors have the ability to review the merged dialog and skip the merge and save the new train dialog as is if necessary.
Upgrading
April 8th Release
Release Notes
Breaking Changes
None
New Features
Train dialog management using Tags and Descriptions
-
You can now add free form text descriptions to each train dialog to capture related information like the scenarios each dialog covers.
-
Ability to add multiple tags to each train dialog to allow easy categorization and filtering.
New UI to review and avoid entity labeling conflicts
- There are additional checks now in place to avoid entity conflicts when you try to save an edited log dialog as a train dialog. Previously, entity conflicts were surfaced after you saved a train dialog and you had to manually figure out the conflicts in entity labels. Now, when you try to save a log dialog as a new train dialog, you are prompted to review the conflicting entity labels, so you can make corrections and save a valid train dialog.
See Upgrade Notes
January 29th Release
Release Notes
This release contains two breaking changes and other minor bug fixes. Now you can start the UI and Bot with a single command.
Breaking Changes
-
Changes to how the interface is served.
Previously you needed to run a separate command:npm run ui
to serve / start the interface.
Now, the UI is now included with your Bot at the path/ui
! This reduces and extra setup step and aligns us more closely with normal BotFramework bots that only have 1 command to start and have everything under a single URL.CONVERSATION_LEARNER_UI_PORT
is no longer used. You may remove it from your.env
file if you used it.- We added an example
index.html
to serve as homepage for the sample bot.
-
Changes to API callbacks.
API callbacks only required you do define one of the functions. Eitherlogic
orrender
or both.
Previously if you didn't provide arender
function internally we used a default which simply rendered the result of the logic function.
Now if yourlogic
function returns a result you MUST define arender
function.
This helps educate users on how to write API callbacks and helps prevent a bug with returning activity-like objects and having them rendered by default.
January 14th Release
Release Notes
This consists primarily of small bug fixes for the December release as well as a few UI improvements, in particular improvements to Entity labeling
Breaking API Changes
Card Templates
The template for card buttons has changed slightly. The data field is now simply a string
New Template:
"data": "{{button2}}"
Old Template:
"data": { "submit": "{{button2}}" }
December 2018 Release
Release Notes
Entity Resolvers
Custom Entities now take an optional Resolver in the form of a Pre-Trained Entity. When the Pre-Trained resolver is identified in a user utterance, it will supplement your Custom Entity with additional detail. Resolvers are also helpful when a single Entity type can take on multiple roles within your bot.
Train Dialog Editing
Train Dialogs are now fully editable, meaning that you can insert and delete turns, change Entity labelling and continue any Dialog.
Clicking on any turn in a conversation provides and affordance for deleting the turn or inserting new user utterances or system responses.
As you edit, Conversation learner will highlight any inconsistencies created by your edits
Entity / Action Editing
Actions and Entities are now editable (and deletable), even when in use by Train Dialogs - meaning you can change whether and Entity is Mutli-valued and Negatable or an Action’s Required / Disqualifying Entities or Wait For Response flag.
Making changes (such as switching from Wait to Non-Wait) may invalidate some of your Train Dialogs. When this happens, Conversation Learner will exclude them from training and the user interface will indicate which Train dialogs need editing. This gives you the opportunity to update the Train Dialog. When the errors are fixed, the Train Dialogs will be once again included in training.
Other Train Dialogs will require the Conversation Learner Replay your API calls to update the conversation.
API calls can be replayed at any time for a Training Dialog by clicking the “Replay” button.
Bot Builder
Conversation Learner is no longer on the preview version of Bot Builder and has been updated to the version 4.1.7
Breaking API Changes
API Callbacks
To facilitate rich editing required separating API Callbacks into two parts, a “logic” function and a “render” function.
The Logic function is where you implement your bot’s business logic and manipulate the Bot’s memory, either setting or removing items from Memory. The Render function receives a read-only copy of the Memory and is where you generate output for the bot (in the form or text or Adaptive Cards). The Logic function can pass arbitrary data to the Render function.
cl.AddCallback({
name: “#YOU API NAME#”,
logic: async (memoryManager: ClientMemoryManager) => {
// Save / Clear Memory
// Optionally return date (“logic result”) to Render callback// Optionally return date (“logic result”) to Render callback
},
render: async (logicResult: any, memoryManager: ReadOnlyClientMemoryManager, …args: string[]) => {
return #STRING OR CARD TO RENDER#
}
})
When you open a Train or Log Dialog in the Conversation Learner user interface, only the Render portion of the API Callback will be invoked. When you edit a Dialog (or explicitly click the “Replay” button), both the Logic and Render callbacks will be invoked.
Memory Manager API
We’ve simplified the API for the Memory Manager, decreasing the number of API calls with Get, GetPrevious, Set and Delete. The Get functions take a resolution function that specifies the type of data you’d like return. The SDK provides a set of default functions for common data types (i.e. AS_STRING, AS_NUMBER_LIST), but you are free to write your own for custom data types
let outOfStock = memoryManager.Get("OutOfStock", ClientMemoryManager.AS_STRING_LIST)
July Update
Breaking Changes
Renamed "app" to "model"
For better clarity we renamed "app" to "model" as a single Bot (an app) can have multiple Conversation Learner models. As a result the environment variable CONVERSATION_LEARNER_APP_ID was also renamed to CONVERSATION_LEARNER_MODEL_ID
Use of NODE_ENV
When you are developing your bot, you must set NODE_ENV=development in your .env file, to indicate that the SDK should expose APIs required to support the user interface. You should remove this in your production bot
Change Highlights
Added support for import/export Models
You can now import and export your Models in the UI. There's a new "Import Model" button on the Model list page. And an "Export" button in each Model's Setting page
Added ability to copy Models
You can now make a copy of a Model from the Model's Settings page
Simplify SDK setup by using a single port for bot, sdk, and directline
We've simplified the SDK, by consolidating down to a single server for all the endpoints. This reduce potential conflicts with ports and settings
Improved Editing
You have more flexibility around deleting Entities and Actions and can now edit Entities and Actions if they are not in use. This is just the start. There much more to come here in the next release.
New End_Session Action
You can now explicitly train your bot to know when a task has been completed with the End_Session Action type. Triggering the End_Session action will result in a call to your OnSessionEndCallback and end the current Session
Support for hybrid bots
Added richer support for Bots that support multiple bot building technologies (e.g. LUIS, QnA Maker) and even multiple instances of Conversation Learner
-
OnSessionStart & OnSessionEnd callbacks take turnContext for access to global bot state
-
ConversationLearner.StartSession(context) used to initiate call to OnSessionStart callback
-
For more information see new tutorial and video
Setting Initial State
Added ability to set Entity values before the start of a new training session. See "Set Initial State" button
UI - New look and feel
The user interface is substantially more consistent and matches the Microsoft brand
Publishing Documentation
Added step-by-step instructions to deploy your bot to Azure in two different ways:
-
ZipDeploy using KuduEngine
-
Deploy from local git repository
Upgrading
The easiest way to try the latest samples is to simply go through the setup process from the README again and re-clone the repo. This will be a fresh start and avoid the need to deal with merge conflicts.
However, if you have have changes to your bot that you would like to preserve such as implemented EntityDetection, API, or Session callbacks you can follow these instructions.
The intention here is to update the master
branch to the latest on the remote. There are many ways to do this with git
but this is likely the easiest and most flexible.
-
If you have uncommitted changes, commit them, otherwise skip this step.
git add . git commit -m "commit message"
-
Create a new branch pointing to the current branch which has your changes
git checkout -b my-changes
-
Update the tracking branch
git fetch origin master
-
Set local
master
to the trackingmaster
git branch master origin/master -f
At this point
master
branch is updated and you can switch over to it and test it as is without your changes if you like. Meanwhile you're changes are still preserved for you to review and merge in later. You can stop here if you like.
-
Merge
master
into current branch which has your changesgit merge master
-
Resolve the merge conflicts if any
You likely want to preserve your callbacks or any custom dependencies you added, but mostly accept the remote changes as is.
-
Install the new dependencies
npm install
-
Update your .env file
This file is not tracked by
git
so it would not have been fixed by the merge8.1 Add
NODE_ENV=development
8.2 If you had previously specified
CONVERSATION_LEARNER_APP_ID
rename it toCONVERSATION_LEARNER_MODEL_ID
If you have deployed your bot you would also need to make sure to update this variable in that environment on the next deployment.
-
Done!
Now your branch is updated with all the latest features and still has your changes. You should be able to run npm start
to see your bot working!
Initial prototype
Used old single threaded BLIS service