Closed hlavacek closed 2 years ago
Thank you for the report. I will investigate.
@hlavacek,
When you say "reference to question 2", are you referring to the "Follow-up prompts" option in the CQA portal? I'm not quite sure what it is that you're doing.
yes correct, in the Language studio UI it is set up via "Add Follow-up prompts" button, if you export the bot as Excel, then this is stored in the column Prompts as JSON, with an ID reference to the target question.
You select the reference question there, but you can also have the text of the prompt set to something else
I am able to reproduce this issue. The follow-up prompt is correctly triggered, but the answer to the second question is not returned, and instead the default "No answer found" message is given. I can also confirm that the C# version functions correctly.
Further investigation of the CQA JS feature in the libraries is required.
Hi, I was able to repro this issue. Thanks for the clear steps. You are correct, qnaId was not being passed in payload body. I have created a PR that will fix this issue. Thanks.
Versions
What package version of the SDK are you using: 4.1.6 What nodejs version are you using: v14.17.3 What browser version are you using: N/A What os are you using: N/A
Describe the bug
In the source code in botbuilder-ai, languageServiceUtils.ts, function queryKnowledgebaseRaw, the code does not pass properly queryOptions.qnaId to the custom question answering REST call. This gives a wrong behaviour, when using prompts in the knowledge base.
It is this source code part: https://github.com/microsoft/botbuilder-js/blob/main/libraries/botbuilder-ai/src/qnamaker-utils/languageServiceUtils.ts#L88
There the code is missing the following within the JSON.stringify call:
The "Test" functionality in the custom question answering is passing QnaId to the REST endpoint, so there the behaviour is correct, the bug applies only when running a custom bot with botbuilder-ai (e.g. using one of the samples).
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Correct behaviour would be to show "Question 2 answer", as we have direct reference to "question 2" using its ID. But in local bot (or bot deployed to Azure), it will give "question 2 wrong answer", because the framework is not passing Qna ID to the REST endpoint. Custom Question Answering service will then match the response just based on the text, which will result in Qna ID = 3.
Screenshots
N/A
Additional context
N/A