Set "Default answer when no result found" for Cog Services/Language Studio/Proj Settings

Kringle Claus 106 Reputation points
2021-11-22T21:12:33.597+00:00

The "Default answer when no result found" as set in the Cog Services/Language Studio/Proj Settings field [See img 1] is not what is appearing for the user in the chat. Instead, the user sees "No QnAMaker answers found."

I had the same problem with the recently deprecated QnAbot. However, there was a work-around there to manually insert the desired default reply. (i.e. access the code, change the values and then do a "build.cmd" from the console.) This doesn't work for the new Cog Services/Language Studio as the build.cmd command isn't available under the console icon.

There is some urgency to this as ~>20% of user inputs return a "Default Answer", so it's killing trust in the app.
151611-santacogserv-settings.png

![151548-santachattercom.png][2]

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,341 questions
{count} votes

Accepted answer
  1. Kringle Claus 106 Reputation points
    2021-11-30T07:34:39.15+00:00

    Feel like I've been thru a real meat grinder on this one.

    There appears to be a bug that prevents code changes in Language Services built and/or deployed from sources other than Visual Studio (VS) from working (Builds/Deployments from Visual Studio Code, the Console & App Editor (preview) within the App Service Blade and other approaches were unsuccessful).

    Code changes made in Visual Studio (VS) which are then built and deployed from within VS will work! (I had not used VS before but am able to confirm this.)

    Note: This applies to any source code change builds, not just the NoDefaultAnswer referenced at the start of this thread. (e.g. I successfully made changes to Threshold and the default welcome message, which are both in different files than the NoDefaultAnswer variable).

    Many thanks to @romungi-MSFT for their help and patience.

    Hope this can help someone else.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. romungi-MSFT 41,841 Reputation points Microsoft Employee
    2021-11-23T18:20:36.677+00:00

    @Kringle Claus Thanks for details. I think i am able to replicate your issue here when i create a bot from the studio the bot that is created is using the default answer used in the solution rather than the one set in the studio. You can verify this by navigating to your bot from Azure portal and downloading the source code.

    Click on overview tab of your bot to see this option:

    151963-image.png

    Once you click the download option you will get an option to include your configuration files and when the source code zip is ready you can download the file. Do not hit refresh or back button when this is in progress.
    Once your bot source code is downloaded open the solution in VS 2019 and open the file QnAMakerBaseDialog.cs and update your DefaultAnswer string to the one required. Publish your solution to Azure app service by right clicking on your project from solution explorer and connecting it to your Azure subscription and select the app service used by your bot.

    Once the solution is published you can verify your bot response in the webchat window on Azure portal or your website. I would suggest to try this by using a dummy project in the studio with a different bot before updating your website.

    151981-image.png

    On test chat window after publish:
    151953-image.png

    I think this is probably a bug where the option to create a bot from studio is not utilizing the settings of the project before publishing the same to Azure.
    I hope this workaround works for you!!

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.