Tutorial: Customize (typescript)
Edit your responses
Each dialog within your skill contains a set of responses stored in supporting Language Generation (
.lg) files. You can edit the responses directly in the file to modify how your skill responds. Adjust some of the responses to suit your Skill’s personality.
This approach supports multi-lingual responses by providing alternate
.lg files for different languages (e.g. MainResponses.de-de.lg). By expanding MainResponses.lg or SampleResponses.lg in Visual Studio you can see the accompany multi-lingual response files.
Add additional responses
If you wish to add additional responses, add an additional LG file to the directory and populate as required. See this reference for more information on Language Generation.
AllResponses.lg in your
Responses directory, add the newly created LG file.
Your LG file will be added automatically in the
templateFile variable of the
// Configure localized responses const localizedTemplates: Map<string, string> = new Map<string, string>(); const templateFile = 'AllResponses'; const supportedLocales: string = ['en-us', 'de-de', 'es-es', 'fr-fr', 'it-it', 'zh-cn'];
Language Generation enables multiple responses to be provided for each response type enabling the LG engine to randomly select a response at runtime. Providing multiple options enables a more natural experience for your users and the provided LG files provide a variety of options that you can customize.
For more information, refer to the Skill Responses reference.