The topic "Custom Skill with Knowledge Base" is not available in Version 1.1.0

The topic "Custom Skill with Knowledge Base" is not available in Version 1.0.0

Custom Skill with Knowledge Base

The Microsoft Bot Framework Composer includes the QnA Maker component. It allows you to create a conversational layer that provides answers for any input from your custom knowledge base (KB).

The example described below can be downloaded from GitHub at https://github.com/anthology-inc/renee-integration-samples/tree/main/skillbot/src/botFrameworkComposer/2.calling%20QnA%20maker

Please review the following Microsoft articles for more details about QnA Maker and its integration with Bot Framework Composer:

Once you have a good understanding of QnA Maker, proceed with creating the QnA Maker resources in Azure Portal.

Prerequisites:

Create QnA Maker Resources in Azure

  1. Log in to your subscription in the Azure Portal and select Cognitive Services on the home page.

  2. In the menu on the left, select All Cognitive Services, click Add, and select QnA Maker.  Closed

    Cognitive Services - QnA Maker

    — OR —

    Select Create a resource on the Home page and enter QnA Maker in the search field.

  3. Click Create to create a resource for QnA Maker.  Closed

    Create QnA Maker resources

  4. Populate the fields on the Create QnA Maker page and click Review + create.  Closed

    QnA maker resources created

  5. On successful creation of the QnA Maker resource, the following Azure services are made available:

    • App service
    • QnA Maker (Cognitive service)
    • Search service

    You can locate these services under the Resource group provided on the Create page above.  Closed

    QnA maker resources created

  6. Select the QnA Maker service type, select Keys and Endpoint under Resource Management in the left menu, and click Show Keys.  Closed

    Keys and Endpoint

Choose a Template

  1. Open Bot Framework Composer and click Create new.

  2. Select the Core Bot with QnA Maker template and click Next.  Closed

    Empty bot template

    The template is the starting point for your bot dialog; once created, you can customize and extend the dialog as needed. For more information, see https://docs.microsoft.com/en-us/composer/concept-templates.

  3. Assign a Name to the project.

    Note: The project name is the label for the conversation flow and will be displayed as a, activity (clickable option) in Anthology Digital Assistant. Choose a name that is meaningful to a bot user.

    Use Runtime type Azure Web App (default) and click Create.

    It takes a few minutes for Composer to download the template, create the project, build the runtime, and merge packages.

  4. When prompted, specify a Knowledge base name and click Next.

  5. The "Select a source for your knowledge base's content" modal provides options to create a new knowledge base or import an existing knowledge base from the QnA Maker portal. For a new knowledge base, you can specify the Source URL for content that is hosted online such as an FAQ or document link (.csv, .xls or .doc format). If you do not have online source content available, select Skip & Create blank knowledge base.  Closed

    Select source for KB

  6. The next screen prompts you to set up QnA Maker.  Closed

    Set up QnA Maker

Set Up QnA Maker

  1. Click the Set up QnA Maker link shown above (or click the hamburger icon to expand the navigation menu on the left and select Configure).

  2. In the Set up QnA Maker modal, select Use existing resources since you've already created the QnA Maker App Service and Cognitive Service in your subscription and click Next.  Closed

    Use existing resources

    If you did not create the QnA Maker App Service and Cognitive Service, select "Create and configure new Azure resources". Choose "Generate instructions for Azure administrator" if you need an administrator to create Azure resources for you.

  3. Sign in to your Azure subscription.  Closed

    Sign in email  Sign in password

  4. Select your Azure directory (if applicable), Azure subscription, and QnA Maker resource name and click Next.  Closed

    Subscription and Resources  Subscription and Resources

  5. The QnA Maker Key and your selected Region are displayed. Click Done.  Closed

    QnA Maker key

  6. On the configuration page, the QnA Maker Subscription key field is populated with the value displayed in the previous step. The Subscription key is automatically added to the appsettings.json file for the custom skill bot.

The QnA Maker setup is completed.  Closed

QnA Maker config done

Create a Knowledge Base

  1. Select Knowledge base in the navigation menu at the left.

  2. Click the Add QnA Pair link and enter a question and answer.

  3. Click the Add alternate phrasing link in a Question field to enter additional utterances that might be applicable for an answer. To remove a question and answer pair, click the delete icon on the right.  Closed

    Questions and Answers

Add as many questions and answers as needed to build out your knowledge base. The completed knowledge base will be added to the bot project as QnA Intent recognized trigger. It contains the code that defines the actions to take when a QnA Maker intent is recognized.  Closed

QnA Intent Recognized flow

For more information about triggers, see https://docs.microsoft.com/en-us/composer/how-to-define-triggers?tabs=v2x.

Create a Conversation Flow

In the next steps, you will build the dialog flow for the knowledge base questions. The dialog will be initiated by an Event received trigger. You will then transfer the code from QnA Intent recognized trigger to the Event received trigger to provide the knowledge base answers.

  1. Click the ellipsis next to the project name and select Add new trigger.  Closed

    Composer project name

    • In the "What is the type of this trigger?" field, select Activities.  

    • In the "Which activity type?" field, select Event received (Event activity) and click Submit. This trigger is added to handle and manage the activity that the skill bot is going to consume. Closed

      Event received

    The "Create a trigger" modal is closed and the "Event received" activity is added to the project.

  2. Click the + icon on the canvas to add an activity to the flow.  

    • Select Send a response in the Add activity drop-down.  Closed

      Send a response

    • In the properties pane for the Send a response activity, specify the response Text that will be displayed when the custom skill selected in the Digital Assistant.  Closed

      Response text

  3. If your custom skill bot supports multiple activities, you need to route each activity to a separate dialog flow. You can do this using a branch component.

    Note: The activities supported by the custom skill bot are defined in the manifest.  Closed

    2 activities in manifest

    • Click the + icon on the canvas, select Create a condition > Branch: If/Else.

    • In the Properties pane, click the drop-down in the Condition field and select Write an expression.  Closed

    • In the Condition field, specify or select the following expression: =turn.activity.name  Closed

    • Append the name of the activity as defined in the manifest to the expression in the Condition field.

      Example:

      If your manifest includes an activity named "studentInformation", specify =="studentInformation" as the value for the turn.activity.name variable.

      Expression turn.activity.name

    • Click the + icon in the "true" branch, and select Dialog ManagementBegin a new dialog, and assign a name to the dialog.

    • Click the + icon in the "false" branch, and insert a Branch: If/Else flow for another activity as described above.

      In our example, the manifest includes a second activity named "campusInformation". So the value of the turn.activity.name variable is =="campusInformation". Another "Begin new dialog" section follows.  Closed

    • Continue building the new dialogs for each branch.

  4. Go to respective dialog to create a conversation flow. Click on the + icon.

    • Select Ask a questionMulti-choice in the Add activity drop-down. Placeholders for the "Prompt with multi-choice" and "User input (Choice)" activities are added to the canvas.

    • Select Prompt with multi-choice in the canvas.

    • In the properties pane on the Bot response tab, specify the prompt Text, e.g., "Please select ...".  Closed

      Multi-choice prompt

    • Select User input (Choice) in the canvas.

    • In the properties pane on the User input tab, scroll down to Array of choices.

    • Click Add new and specify the label for the first choice. Repeat this step for each choice. The bot will display the choices on clickable cards.  Closed

      Choices

    • On the User input tab, scroll up to Property and specify user.<variable>. Name the variable as appropriate for your multi-choice option. The user’s choice will be stored in user state variable. The variable will be re-used during the conversation flow.    Closed

      Choice property saved

    • Scroll down to List style and select heroCard. This list style enables users to click on a card that displays a question from the knowledge base.

  5. Click the + icon below the previous activity.

    • Select Send a response.

    • In the properties pane, specify some Text to echo the selected choice using the variable, e.g., You have selected $(user.<variable>).  Closed

    Choice response

  6. Click the + icon below the previous activity.

    • Select Create a conditionBranch: Switch (multiple options).  Closed

      Branch switch

    • Select the Branch activity on the canvas.

    • In the properties pane in the Condition field, specify user.<variable>.  Closed

      Branch switch condition

    • In the properties pane for the Branch activity, specify the values for the Cases.  Closed

      Choice values

  7. Click the + icon below the first case.

    • Select the Send a response activity.

    • Specify the response Text for the case, e.g., "The $(user.<variable>) is...."    Closed

    Repeat this step for all cases.

    Choice responses

  8. If you categorized your knowledge base questions and there are multiple questions in each category, create Multi-choice prompts in each category.

    Each Multi-choice prompt will be followed by User input with a variable that stores the category selection.

    In the Array of choices fields, copy and paste the questions and alternate phrasing from the knowledge base.

  9. Click the + icon below the User input (Choice) (i.e., the questions created in the previous step) and switch to the QnA Intent recognized trigger flow. You will need to add every single activity from the QnA Intent recognized flow to the main path of the Event received flow.  Closed

    Add KB flow to Event received

  10. In the QnA Intent recognized flow, select Branch: If/else activity and copy the Condition value to the clipboard.  Closed

    Copy QnA activity

  11. In the Event received flow, add a Branch: If/else activity.

    In the Condition field, select Write an expression and paste the value from the clipboard into the field. Delete the = sign at the beginning of the field.  Closed

    Add QnA activity and condition

  12. As illustrated in the previous two steps, one by one, re-create the activities and code from the QnA Intent recognized trigger in the Event received trigger flow.

  13. As the last step, click the + icon below the last activity and select Dialog management > End this dialog.  

  14. (Optional) After you have transferred all the activities and code from QnA Intent recognized to Event received, you can remove the QnA Intent recognized trigger. Click the ellipsis next to QnA Intent recognized and select Remove this trigger.  Closed

    Remove trigger

Publish a Skill Bot with Knowledge Base

When you have completed building the custom skill bot with knowledge base, publish it to your Azure subscription.

  1. In the left menu of Bot Framework Composer, select Publish.

  2. If you have previously created a publishing profile and want to republish your project after some edits, select your project on the Publish tab and select your Publish target.  Closed

    Republish

    If you are publishing the first time, select the Publishing profile tab and click the Add new link. Continue with the steps below.  Closed

    Publishing profile

  3. Specify a Name for your profile. In the Publishing target field, select Publish bot to Azure, and click Next.   Closed

    Publish step2

  4. Select Create new resources and click Next.  Closed

    Publishing profile - Create new resources

  5. You will be prompted to sign into your Azure account.

    On the Configure resources modal, specify your subscription, resource group, operating system, and resource details. Click Next to continue.  Closed

    Config resources

  1. On the Add resources modal, the Required resources are automatically selected. The QnA Maker resources will be created. Closed

    Add resources - Required

  2. Select from the Optional resources as applicable and click Next.   Closed

    Add resources - Optional

  3. Select Next and review the list of resources to be created. To proceed, click Create. The resources will be provisioned and deployed in Azure. This may take a few minutes.  Closed

    Review resources to be created

  4. The following services are created for QnA Maker:

    • App Service
    • Cognitive Service
    • Search Service

    The AppServiceRegistration is created implicitly.

    You can locate the QnA Maker services under Resource groups.  Closed

    QnA maker resources created

  5. You need to get the MicrosoftAppIds/Keys for the resources you intend to use.

    For QnA Maker, select the Cognitive Service, select Keys and Endpoint under Resource Management in the left menu, and click Show Keys.  Closed

    Keys and Endpoint

  6. Copy and save the MicrosoftAppId and/or Key so that you have it available later to paste it into the AppSettings.json file.

    The MicrosoftAppId also needs to be specified in the Customer Administration Portal > Skills > Custom Skills.

Add a Manifest.json

After you have published the custom skill bot (with or without knowledge base), you need to create a manifest.json file and upload it to wwwroot under the AppService for the skill bot.

  1. Log in to your Azure subscription, select the App Service that was created for the skill bot, and open the App Service Editor under Development Tools.

  2. Create a new manifest file in the wwwroot folder of your subscription. Refer to the instructions provided at https://docs.microsoft.com/en-us/azure/bot-service/skills-write-manifest?view=azure-bot-service-4.0&tabs=v2-2.

    — OR —

    Retrieve a manifest.json sample file from https://github.com/anthology-inc/renee-integration-samples/tree/main/skillbot/src/botFrameworkSdkV4_C%23/wwwroot/manifest, copy it to wwwroot in your subscription, and modify its content.

    For ease of reference, use a naming convention that indicates the language and locale, e.g.,

    • dialogchildbot-manifest-1.0.en-us.json
    • dialogchildbot-manifest-1.0.en-gb.json
    • dialogchildbot-manifest-1.0.es-es.json
    • dialogchildbot-manifest-1.0.fr-fr.json

    Make sure the json syntax is valid in your customized manifest.json.

  3. In your manifest.json file, locate the endpoints section and provide the msAppId and endpointUrl values.  Closed

    QnA manifest

    • Populate the msAppId field with the Microsoft AppId of your custom skill bot. At least one endpoint must be defined. Each endpoint must be unique.

    • Populate the endpointUrl field with the URL of your skill bot followed by /api/messages. Anthology Digital Assistant uses the endpoint Url to communicate with the skill bot.

      To get the endpoint Url, go to the App Service details page of your custom skill bot in Azure and copy the URL value. Closed

      Manifest URL

      Provide the endpoint URL value to Anthology. Anthology staff will configure the URL in the Customer App Portal (see Custom Skill with Knowledge Base

  4. In the activities section of the manifest, specify appropriate name and type values for the activities in your custom skill bot. All other properties are optional and depend on the purpose of the activity. Closed

    Activities in manifest

  5. Save your manifest.json file(s).

Edit the AppSettings.json

The appsettings.json file supports the overall configuration for the skill bot. For example, it can be used to configure logging, any external connection details the skill bot requires, etc.

A sample appsettings.json file is available at https://github.com/anthology-inc/renee-integration-samples/blob/main/skillbot/src/botFrameworkSdkV4_C%23/appsettings.json.

  1. In your Azure subscription, navigate to the appsettings.json file in the wwwroot folder and edit it using the App Service Editor.

  2. In the allowedCallers field, specify the MicrosoftAppId of Anthology Digital Assistant. This is required to ensure that only the Digital Assistant (and no other bot) can invoke your custom skill bot. The MicrosoftAppId of Anthology Digital Assistant is displayed in the About window of the Customer Admin Portal.  Closed

    AppSettings.json - MS AppId for Renee

  3. The appsettings.json is automatically populated with the MicrosoftAppId for the custom skill bot. Copy and paste this key into the manifest.json.  Closed

    AppId for custom skill with QnA

Configure Skills in the Customer Administration Portal

  1. Log in to the Customer Administration Portal and select the Skills tile (see Configure Skills).

  2. In the Settings pane, select Custom Skills and click the Add Skill button.

  3. In the Add Skill dialog, specify the following values:

    • Skill Name

    • Microsoft AppId

    • Manifest Url

    If your custom skill is available in multiple languages, click the Add Locale button, select the Locale value and specify the Locale Name.

  4. Click the Save button.

Test

  1. Go to your Azure portal.

  2. Test the published bot by selecting Test in Web Chat.

 

The Microsoft Bot Framework Composer includes the QnA Maker component. It allows you to create a conversational layer that provides answers for any input from your custom knowledge base (KB).

The example described below can be downloaded from GitHub at https://github.com/anthology-inc/renee-integration-samples/tree/main/skillbot/src/botFrameworkComposer/2.calling%20QnA%20maker

Please review the following Microsoft articles for more details about QnA Maker and its integration with Bot Framework Composer:

Once you have a good understanding of QnA Maker, proceed with creating the QnA Maker resources in Azure Portal.

Prerequisites:

Create QnA Maker Resources in Azure

  1. Log in to your subscription in the Azure Portal and select Cognitive Services on the home page.

  2. In the menu on the left, select All Cognitive Services, click Add, and select QnA Maker.  Closed

    Cognitive Services - QnA Maker

    — OR —

    Select Create a resource on the Home page and enter QnA Maker in the search field.

  3. Click Create to create a resource for QnA Maker.  Closed

    Create QnA Maker resources

  4. Populate the fields on the Create QnA Maker page and click Review + create.  Closed

    QnA maker resources created

  5. On successful creation of the QnA Maker resource, the following Azure services are made available:

    • App service
    • QnA Maker (Cognitive service)
    • Search service

    You can locate these services under the Resource group provided on the Create page above.  Closed

    QnA maker resources created

  6. Select the QnA Maker service type, select Keys and Endpoint under Resource Management in the left menu, and click Show Keys.  Closed

    Keys and Endpoint

Choose a Template

  1. Open Bot Framework Composer and click Create new.

  2. Select the Core Bot with QnA Maker template and click Next.  Closed

    Empty bot template

    The template is the starting point for your bot dialog; once created, you can customize and extend the dialog as needed. For more information, see https://docs.microsoft.com/en-us/composer/concept-templates.

  3. Assign a Name to the project.

    Note: The project name is the label for the conversation flow and will be displayed as a, activity (clickable option) in Anthology Digital Assistant. Choose a name that is meaningful to a bot user.

    Use Runtime type Azure Web App (default) and click Create.

    It takes a few minutes for Composer to download the template, create the project, build the runtime, and merge packages.

  4. When prompted, specify a Knowledge base name and click Next.

  5. The "Select a source for your knowledge base's content" modal provides options to create a new knowledge base or import an existing knowledge base from the QnA Maker portal. For a new knowledge base, you can specify the Source URL for content that is hosted online such as an FAQ or document link (.csv, .xls or .doc format). If you do not have online source content available, select Skip & Create blank knowledge base.  Closed

    Select source for KB

  6. The next screen prompts you to set up QnA Maker.  Closed

    Set up QnA Maker

Set Up QnA Maker

  1. Click the Set up QnA Maker link shown above (or click the hamburger icon to expand the navigation menu on the left and select Configure).

  2. In the Set up QnA Maker modal, select Use existing resources since you've already created the QnA Maker App Service and Cognitive Service in your subscription and click Next.  Closed

    Use existing resources

    If you did not create the QnA Maker App Service and Cognitive Service, select "Create and configure new Azure resources". Choose "Generate instructions for Azure administrator" if you need an administrator to create Azure resources for you.

  3. Sign in to your Azure subscription.  Closed

    Sign in email  Sign in password

  4. Select your Azure directory (if applicable), Azure subscription, and QnA Maker resource name and click Next.  Closed

    Subscription and Resources  Subscription and Resources

  5. The QnA Maker Key and your selected Region are displayed. Click Done.  Closed

    QnA Maker key

  6. On the configuration page, the QnA Maker Subscription key field is populated with the value displayed in the previous step. The Subscription key is automatically added to the appsettings.json file for the custom skill bot.

The QnA Maker setup is completed.  Closed

QnA Maker config done

Create a Knowledge Base

  1. Select Knowledge base in the navigation menu at the left.

  2. Click the Add QnA Pair link and enter a question and answer.

  3. Click the Add alternate phrasing link in a Question field to enter additional utterances that might be applicable for an answer. To remove a question and answer pair, click the delete icon on the right.  Closed

    Questions and Answers

Add as many questions and answers as needed to build out your knowledge base. The completed knowledge base will be added to the bot project as QnA Intent recognized trigger. It contains the code that defines the actions to take when a QnA Maker intent is recognized.  Closed

QnA Intent Recognized flow

For more information about triggers, see https://docs.microsoft.com/en-us/composer/how-to-define-triggers?tabs=v2x.

Create a Conversation Flow

In the next steps, you will build the dialog flow for the knowledge base questions. The dialog will be initiated by an Event received trigger. You will then transfer the code from QnA Intent recognized trigger to the Event received trigger to provide the knowledge base answers.

  1. Click the ellipsis next to the project name and select Add new trigger.  Closed

    Composer project name

    • In the "What is the type of this trigger?" field, select Activities.  

    • In the "Which activity type?" field, select Event received (Event activity) and click Submit. This trigger is added to handle and manage the activity that the skill bot is going to consume. Closed

      Event received

    The "Create a trigger" modal is closed and the "Event received" activity is added to the project.

  2. If your custom skill bot supports multiple activities, you need to route each activity to a separate dialog flow. You can do this using a branch component.

    Note: The activities supported by the custom skill bot are defined in the manifest.  Closed

    2 activities in manifest

    • Click the + icon on the canvas, select Create a condition > Branch: If/Else.

    • In the Properties pane, click the drop-down in the Condition field and select Write an expression.  Closed

    • In the Condition field, specify or select the following expression: =turn.activity.name  Closed

    • Append the name of the activity as defined in the manifest to the expression in the Condition field.

      Example:

      If your manifest includes an activity named "studentInformation", specify =="studentInformation" as the value for the turn.activity.name variable.

      Expression turn.activity.name

    • Click the + icon in the "true" branch, and select Dialog ManagementBegin a new dialog, and assign a name to the dialog.

    • Click the + icon in the "false" branch, and insert a Branch: If/Else flow for another activity as described above.

      In our example, the manifest includes a second activity named "campusInformation". So the value of the turn.activity.name variable is =="campusInformation". Another "Begin new dialog" section follows.  Closed

    • Continue building the new dialogs for each branch.

  3. Click the + icon on the canvas to add an activity to the flow.  

    • Select Send a response in the Add activity drop-down.  Closed

      Send a response

    • In the properties pane for the Send a response activity, specify the response Text that will be displayed when the custom skill selected in the Digital Assistant.  Closed

      Response text

  4. Go to respective dialog to create a conversation flow. Click on the + icon.

    • Select Ask a questionMulti-choice in the Add activity drop-down. Placeholders for the "Prompt with multi-choice" and "User input (Choice)" activities are added to the canvas.

    • Select Prompt with multi-choice in the canvas.

    • In the properties pane on the Bot response tab, specify the prompt Text, e.g., "Please select ...".  Closed

      Multi-choice prompt

    • Select User input (Choice) in the canvas.

    • In the properties pane on the User input tab, scroll down to Array of choices.

    • Click Add new and specify the label for the first choice. Repeat this step for each choice. The bot will display the choices on clickable cards.  Closed

      Choices

    • On the User input tab, scroll up to Property and specify user.<variable>. Name the variable as appropriate for your multi-choice option. The user’s choice will be stored in user state variable. The variable will be re-used during the conversation flow.    Closed

      Choice property saved

    • Scroll down to List style and select heroCard. This list style enables users to click on a card that displays a question from the knowledge base.

  5. Click the + icon below the previous activity.

    • Select Send a response.

    • In the properties pane, specify some Text to echo the selected choice using the variable, e.g., You have selected $(user.<variable>).  Closed

    Choice response

  6. Click the + icon below the previous activity.

    • Select Create a conditionBranch: Switch (multiple options).  Closed

      Branch switch

    • Select the Branch activity on the canvas.

    • In the properties pane in the Condition field, specify user.<variable>.  Closed

      Branch switch condition

    • In the properties pane for the Branch activity, specify the values for the Cases.  Closed

      Choice values

  7. Click the + icon below the first case.

    • Select the Send a response activity.

    • Specify the response Text for the case, e.g., "The $(user.<variable>) is...."    Closed

    Repeat this step for all cases.

    Choice responses

  8. If you categorized your knowledge base questions and there are multiple questions in each category, create Multi-choice prompts in each category.

    Each Multi-choice prompt will be followed by User input with a variable that stores the category selection.

    In the Array of choices fields, copy and paste the questions and alternate phrasing from the knowledge base.

  9. Click the + icon below the User input (Choice) (i.e., the questions created in the previous step) and switch to the QnA Intent recognized trigger flow. You will need to add every single activity from the QnA Intent recognized flow to the main path of the Event received flow.  Closed

    Add KB flow to Event received

  10. In the QnA Intent recognized flow, select Branch: If/else activity and copy the Condition value to the clipboard.  Closed

    Copy QnA activity

  11. In the Event received flow, add a Branch: If/else activity.

    In the Condition field, select Write an expression and paste the value from the clipboard into the field. Delete the = sign at the beginning of the field.  Closed

    Add QnA activity and condition

  12. As illustrated in the previous two steps, one by one, re-create the activities and code from the QnA Intent recognized trigger in the Event received trigger flow.

  13. As the last step, click the + icon below the last activity and select Dialog management > End this dialog.  

  14. (Optional) After you have transferred all the activities and code from QnA Intent recognized to Event received, you can remove the QnA Intent recognized trigger. Click the ellipsis next to QnA Intent recognized and select Remove this trigger.  Closed

    Remove trigger

Publish a Skill Bot with Knowledge Base

When you have completed building the custom skill bot with knowledge base, publish it to your Azure subscription.

  1. In the left menu of Bot Framework Composer, select Publish.

  2. If you have previously created a publishing profile and want to republish your project after some edits, select your project on the Publish tab and select your Publish target.  Closed

    Republish

    If you are publishing the first time, select the Publishing profile tab and click the Add new link. Continue with the steps below.  Closed

    Publishing profile

  3. Specify a Name for your profile. In the Publishing target field, select Publish bot to Azure, and click Next.   Closed

    Publish step2

  4. Select Create new resources and click Next.  Closed

    Publishing profile - Create new resources

  5. You will be prompted to sign into your Azure account.

    On the Configure resources modal, specify your subscription, resource group, operating system, and resource details. Click Next to continue.  Closed

    Config resources

  1. On the Add resources modal, the Required resources are automatically selected. The QnA Maker resources will be created. Closed

    Add resources - Required

  2. Select from the Optional resources as applicable and click Next.   Closed

    Add resources - Optional

  3. Select Next and review the list of resources to be created. To proceed, click Create. The resources will be provisioned and deployed in Azure. This may take a few minutes.  Closed

    Review resources to be created

  4. The following services are created for QnA Maker:

    • App Service
    • Cognitive Service
    • Search Service

    The AppServiceRegistration is created implicitly.

    You can locate the QnA Maker services under Resource groups.  Closed

    QnA maker resources created

  5. You need to get the MicrosoftAppIds/Keys for the resources you intend to use.

    For QnA Maker, select the Cognitive Service, select Keys and Endpoint under Resource Management in the left menu, and click Show Keys.  Closed

    Keys and Endpoint

  6. Copy and save the MicrosoftAppId and/or Key so that you have it available later to paste it into the AppSettings.json file.

    The MicrosoftAppId also needs to be specified in the Customer Administration Portal > Skills > Custom Skills.

Add a Manifest.json

After you have published the custom skill bot (with or without knowledge base), you need to create a manifest.json file and upload it to wwwroot under the AppService for the skill bot.

  1. Log in to your Azure subscription, select the App Service that was created for the skill bot, and open the App Service Editor under Development Tools.

  2. Create a new manifest file in the wwwroot folder of your subscription. Refer to the instructions provided at https://docs.microsoft.com/en-us/azure/bot-service/skills-write-manifest?view=azure-bot-service-4.0&tabs=v2-2.

    — OR —

    Retrieve a manifest.json sample file from https://github.com/anthology-inc/renee-integration-samples/tree/main/skillbot/src/botFrameworkSdkV4_C%23/wwwroot/manifest, copy it to wwwroot in your subscription, and modify its content.

    For ease of reference, use a naming convention that indicates the language and locale, e.g.,

    • dialogchildbot-manifest-1.0.en-us.json
    • dialogchildbot-manifest-1.0.en-gb.json
    • dialogchildbot-manifest-1.0.es-es.json
    • dialogchildbot-manifest-1.0.fr-fr.json

    Make sure the json syntax is valid in your customized manifest.json.

  3. In your manifest.json file, locate the endpoints section and provide the msAppId and endpointUrl values.  Closed

    QnA manifest

    • Populate the msAppId field with the Microsoft AppId of your custom skill bot. At least one endpoint must be defined. Each endpoint must be unique.

    • Populate the endpointUrl field with the URL of your skill bot followed by /api/messages. Anthology Digital Assistant uses the endpoint Url to communicate with the skill bot.

      To get the endpoint Url, go to the App Service details page of your custom skill bot in Azure and copy the URL value. Closed

      Manifest URL

      Provide the endpoint URL value to Anthology. Anthology staff will configure the URL in the Customer App Portal (see Custom Skill with Knowledge Base

  4. In the activities section of the manifest, specify appropriate name and type values for the activities in your custom skill bot. All other properties are optional and depend on the purpose of the activity. Closed

    Activities in manifest

  5. Save your manifest.json file(s).

Edit the AppSettings.json

The appsettings.json file supports the overall configuration for the skill bot. For example, it can be used to configure logging, any external connection details the skill bot requires, etc.

A sample appsettings.json file is available at https://github.com/anthology-inc/renee-integration-samples/blob/main/skillbot/src/botFrameworkSdkV4_C%23/appsettings.json.

  1. In your Azure subscription, navigate to the appsettings.json file in the wwwroot folder and edit it using the App Service Editor.

  2. In the allowedCallers field, specify the MicrosoftAppId of Anthology Digital Assistant. This is required to ensure that only the Digital Assistant (and no other bot) can invoke your custom skill bot. The MicrosoftAppId of Anthology Digital Assistant is displayed in the About window of the Customer Admin Portal.  Closed

    AppSettings.json - MS AppId for Renee

  3. The appsettings.json is automatically populated with the MicrosoftAppId for the custom skill bot. Copy and paste this key into the manifest.json.  Closed

    AppId for custom skill with QnA

Configure Skills in the Customer Administration Portal

  1. Log in to the Customer Administration Portal and select the Skills tile (see Configure Skills).

  2. In the Settings pane, select Custom Skills and click the Add Skill button.

  3. In the Add Skill dialog, specify the following values:

    • Skill Name

    • Microsoft AppId

    • Manifest Url

    If your custom skill is available in multiple languages, click the Add Locale button, select the Locale value and specify the Locale Name.

  4. Click the Save button.

Test

  1. Go to your Azure portal.

  2. Test the published bot by selecting Test in Web Chat.