Training
Module
Use text generation in AI Builder - Training
Try a template and write your own instructions with text generation in AI Builder.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
APPLIES TO: SDK v4
Language Generation (LG) allows developers to extract embedded strings from their code and resource files and manage them through a LG runtime and file format. With LG, developers can create a more natural conversation experience by defining multiple variations on a phrase, executing simple expressions based on context, and referring to conversational memory.
Note
LG is supported in Bot Framework Composer and isn't intended for use in SDK-first bots.
LG can be used by developers to:
At the core of LG lies template expansion and entity substitution. You can provide one-of variation for expansion as well as conditionally expand a template. The output from LG can be a simple text string, multi-line response, or a complex object payload that a layer above LG will use to construct an activity.
The following is a simple greeting LG template. Notice that all of the greetings reference the user's name in memory with the variable ${user.name}
.
# greetingTemplate
- Hello ${user.name}, how are you?
- Good morning ${user.name}.It's nice to see you again.
- Good day ${user.name}. What can I do for you today?
You can use LG in various ways when developing bots. To start, create one or more .lg file(s) to cover all possible scenarios where you would use the language generation sub-system with your bot's replies to a user.
Your bot might target more than one spoken or display languages. You can manage separate instances of the TemplateEngine, one per target language.
Training
Module
Use text generation in AI Builder - Training
Try a template and write your own instructions with text generation in AI Builder.