diff --git a/Composer/packages/lib/code-editor/src/LgEditor.tsx b/Composer/packages/lib/code-editor/src/LgEditor.tsx index fdf3382667..cb9d284e2c 100644 --- a/Composer/packages/lib/code-editor/src/LgEditor.tsx +++ b/Composer/packages/lib/code-editor/src/LgEditor.tsx @@ -11,9 +11,8 @@ import { registerLGLanguage } from './languages'; import { createUrl, createWebSocket, createLanguageClient, SendRequestWithRetry } from './utils/lspUtil'; import { BaseEditor, BaseEditorProps, OnInit } from './BaseEditor'; import { LGOption } from './utils'; +import { LG_HELP } from './constants'; -const LG_HELP = - 'https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md'; const placeholder = `> To learn more about the LG file format, read the documentation at > ${LG_HELP}`; diff --git a/Composer/packages/lib/code-editor/src/constants.ts b/Composer/packages/lib/code-editor/src/constants.ts index ed8155e3d1..691e3e4bda 100644 --- a/Composer/packages/lib/code-editor/src/constants.ts +++ b/Composer/packages/lib/code-editor/src/constants.ts @@ -16,3 +16,5 @@ export const defaultPlaceholder = formatMessage( > {LU_HELP}`, { LU_HELP } ); + +export const LG_HELP = 'https://aka.ms/lg-file-format'; diff --git a/docs/concept-language-generation.md b/docs/concept-language-generation.md index bc4c578d9e..7d84ac2e93 100644 --- a/docs/concept-language-generation.md +++ b/docs/concept-language-generation.md @@ -9,7 +9,7 @@ You can use Language Generation to: - Construct cards, suggested actions and attachments using a [structured response template](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/structured-response-template.md). Language Generation is achieved through: -- A markdown based [.lg file](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) that contains the templates and their composition. +- A markdown based [.lg file](https://aka.ms/lg-file-format) that contains the templates and their composition. - Full access to the current [bot's memory](concept-memory.md) so you can data bind language to the state of memory. - Parser and runtime libraries that help achieve runtime resolution. @@ -19,7 +19,7 @@ You can read more about Language Generation [here](https://github.com/microsoft/ Templates are functions which return one of the variations of the text and fully resolve any other references to template for composition. You can define one or more text responses in a template. When multiple responses are defined in the template, a single response will be selected by random. -You can also define one or more expressions using the [common expression language](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language), so when it is a conditional template, those expressions control which particular collection of variations get picked. Templates can be parameterized meaning that different callers to the template can pass in different values for use in expansion resolution. For additional information see [.lg file format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md). +You can also define one or more expressions using the [common expression language](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language), so when it is a conditional template, those expressions control which particular collection of variations get picked. Templates can be parameterized meaning that different callers to the template can pass in different values for use in expansion resolution. For additional information see [.lg file format](https://aka.ms/lg-file-format). Composer currently supports three types of templates: [simple response template](#simple-response-template), [conditional response template](#conditional-response-template), and [structured response template](#structured-response-template). You can read [this section](#define-lg-templates) and learn how to define each of them. @@ -50,7 +50,7 @@ When you want to determine how your bots should respond to user input, you can d To define LG templates in Composer, you will need to know - Supported concepts of LG mentioned above. - - [.lg file format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) + - [.lg file format](https://aka.ms/lg-file-format) - [Common Expression Language](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language#readme) You can define LG templates in two places: The inline LG editor and **Bot Responses** that lists all templates. Below is a screenshot of LG inline editor. @@ -87,7 +87,7 @@ Here is an example of a multi-line response. It includes multiple lines of text ``` ### Conditional response template -For all conditional templates, all conditions are expressed in the [common expression language](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language#readme) and condition expressions are enclosed in curly brackets. Here are two [conditional template examples](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md#conditional-response-template) examples of a conditional response. +For all conditional templates, all conditions are expressed in the [common expression language](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language#readme) and condition expressions are enclosed in curly brackets. Here are two [conditional template examples](https://aka.ms/lg-file-format#conditional-response-template) examples of a conditional response. IF...ELSE @@ -154,7 +154,7 @@ For more examples of structured response templates, see [StructuredTemplate.lg]( ## References - [Language generation preview](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/language-generation) -- [.lg file format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) +- [.lg file format](https://aka.ms/lg-file-format) - [.lg API reference](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/api-reference.md) - [Common expression language](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language#readme) - [Structured response template](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/structured-response-template.md) diff --git a/docs/concept-memory.md b/docs/concept-memory.md index a47f99bae9..678ba7a2ed 100644 --- a/docs/concept-memory.md +++ b/docs/concept-memory.md @@ -170,7 +170,7 @@ One of the most powerful features of the Bot Framework system is Language Genera You can refer to properties in the text of any message, including prompts. -You can also refer to properties in [LG templates](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md). See the Language Generation [readme](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/language-generation) to learn more the Language Generation system. +You can also refer to properties in [LG templates](https://aka.ms/lg-file-format). See the Language Generation [readme](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/language-generation) to learn more the Language Generation system. To use the value of a property from memory inside a message, wrap the property reference in curly brackets: `{user.profile.name}` diff --git a/docs/how-to-define-triggers.md b/docs/how-to-define-triggers.md index 508284c4d2..31c19efe03 100644 --- a/docs/how-to-define-triggers.md +++ b/docs/how-to-define-triggers.md @@ -148,7 +148,7 @@ The following steps demonstrate hot to create a **Greeting (ConversationUpdate a 3) Select the **+** sign under the _ConversationUpdate Activity_ node and then select **Send a response**. -4) Author your response in the **Language Generation** editor in the **properties panel** on the right side of the Composer window, by entering a message following [.lg file format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) as demonstrated in the image below. +4) Author your response in the **Language Generation** editor in the **properties panel** on the right side of the Composer window, by entering a message following [.lg file format](https://aka.ms/lg-file-format) as demonstrated in the image below. ![Welcome](./media/events-triggers/welcome.gif) diff --git a/docs/how-to-send-messages.md b/docs/how-to-send-messages.md index 8d2d442d47..e4d64f4daa 100644 --- a/docs/how-to-send-messages.md +++ b/docs/how-to-send-messages.md @@ -13,7 +13,7 @@ Below is a screenshot of the **Send a response** action in Composer. How to get ## What to know -In Composer, all messages that are sent back to the user are composed in the Language Generation (LG) editor and follow the [.lg file format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md). If you are not familiar with language generation in Composer, please read the [language generation](./concept-language-generation.md) article. +In Composer, all messages that are sent back to the user are composed in the Language Generation (LG) editor and follow the [.lg file format](https://aka.ms/lg-file-format). If you are not familiar with language generation in Composer, please read the [language generation](./concept-language-generation.md) article. The table below lists the different types of text messages provided in Composer and their respective descriptions. @@ -29,7 +29,7 @@ The table below lists the different types of text messages provided in Composer | [Switch](how-to-send-messages.md#switch-condition) | A Switch conditional template defined to generate text responses based on user's input. | ## Define different text messages -To send a message, you need to specify **Send a response** action and then in the the Language Generation editor author your response message in [.lg format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md). You can also define an lg template in **Bot Responses** (the lg all-up view) and reference the template in lg inline editor using the syntax `@{templateName()}`. +To send a message, you need to specify **Send a response** action and then in the the Language Generation editor author your response message in [.lg format](https://aka.ms/lg-file-format). You can also define an lg template in **Bot Responses** (the lg all-up view) and reference the template in lg inline editor using the syntax `@{templateName()}`. ### Simple text To define a simple text message, use a "-" before the text that you want your bot to respond to users. @@ -129,7 +129,7 @@ In this Switch conditional template, bot will respond in text message `Happy Sun ## References - [Send and receive text message](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-send-messages) - [Language generation](./concept-language-generation.md) -- [.lg file format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) +- [.lg file format](https://aka.ms/lg-file-format) - [Common language expression](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language#readme) ## Next diff --git a/docs/how-to-use-LUIS.md b/docs/how-to-use-LUIS.md index 7c547d0c23..65417add05 100644 --- a/docs/how-to-use-LUIS.md +++ b/docs/how-to-use-LUIS.md @@ -51,7 +51,7 @@ After you define your trigger and configure it to specific intent, you can add a ![send_response_message](./media/add_luis/send_response_message.png) -4. Define the response message in the language generation editor and follow the [.lg file format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md). The screenshot below shows how to author a response message "This is a Greeting intent!" in the Language Generation editor. +4. Define the response message in the language generation editor and follow the [.lg file format](https://aka.ms/lg-file-format). The screenshot below shows how to author a response message "This is a Greeting intent!" in the Language Generation editor. ![greeting_message](./media/add_luis/greeting_message.png) diff --git a/docs/how-to-use-validation.md b/docs/how-to-use-validation.md index 7a5053c079..2cb38d4e51 100644 --- a/docs/how-to-use-validation.md +++ b/docs/how-to-use-validation.md @@ -1,6 +1,6 @@ # Linting and validation -As an integrated development tool, Bot Framework Composer supports validation of data when you author an [.lg](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) template, an [.lu](https://aka.ms/lu-file-format) template, and [expressions](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language) to fill in property fields. Error indicators will show in both inline editors and corresponding all-up views (**Bot Responses** and **User Input**). The **Notifications** page (click **Notifications** icon on the left navigation pane) displays an aggregation of all errors and warnings. With the help of linting and validation, your bot-authoring experience will be improved and you can easily build a functional bot that can "run". +As an integrated development tool, Bot Framework Composer supports validation of data when you author an [.lg](https://aka.ms/lg-file-format) template, an [.lu](https://aka.ms/lu-file-format) template, and [expressions](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language) to fill in property fields. Error indicators will show in both inline editors and corresponding all-up views (**Bot Responses** and **User Input**). The **Notifications** page (click **Notifications** icon on the left navigation pane) displays an aggregation of all errors and warnings. With the help of linting and validation, your bot-authoring experience will be improved and you can easily build a functional bot that can "run". > [!NOTE] > We are still working to improve the implementation of linting and validation in Composer. More user scenarios will be updated. @@ -17,7 +17,7 @@ Click any of the errors on the **Notifications** page will navigate you to the m ## .lg files -When you author an [.lg template](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) that has syntax errors, an indicator will show in the inline editor with a red wiggling line. +When you author an [.lg template](https://aka.ms/lg-file-format) that has syntax errors, an indicator will show in the inline editor with a red wiggling line. ![inline-error-lg](./media/validation/inline-error-lg.png) diff --git a/docs/olddocs/testing_debugging.md b/docs/olddocs/testing_debugging.md index 105836107b..be175b5186 100644 --- a/docs/olddocs/testing_debugging.md +++ b/docs/olddocs/testing_debugging.md @@ -86,7 +86,7 @@ When you are using the _Send an Activity_ action, the Language Generation syntax ![LG format error](./Assets/testing-debugging-lgformaterror.png) -Refer to the [LG syntax](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) for troubleshooting. +Refer to the [LG syntax](https://aka.ms/lg-file-format) for troubleshooting. ##### Error publishing to LUIS diff --git a/toc.md b/toc.md index 5071868fb7..ce4444042e 100644 --- a/toc.md +++ b/toc.md @@ -65,7 +65,7 @@ - [Language generation](https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/language-generation) - [Common expression language](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/common-expression-language) - [.lu file format](https://aka.ms/lu-file-format) -- [.lg file format](https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/lg-file-format.md) +- [.lg file format](https://aka.ms/lg-file-format) ## Related projects