I enabled multi turn option for my QnA Maker Knowledgebase. I could not have the multi turn options displayed in test in webchat option. I am using qnAService Helper in my local bot framework.
I have the below error. [onTurnError]: StatusCodeError: 401 - {"error":{"code":"Unauthorized","message":"Authorization Failed"}}
I am using the below code from sample: class QnAServiceHelper {
static async queryQnAService(query, qnAcontext) {
const endpoint = process.env.QnAEndpointHostName;
const kbId = process.env.QnAKnowledgebaseId;
const key = process.env.QnAEndpointKey;
const url = `${ endpoint }/qnamaker/knowledgebases/${ kbId }/generateAnswer`;
const headers = {
"Content-Type": "application/json",
"Authorization": "EndpointKey " + key
};
I understood that the url call is returing the error. Can anyone give pointers how to resolve this authorization issue? I tried to bypass the authorization but it still didn't help.
Here is the sample I used: https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/qnamaker-prompting
console.log({endpoint, kbId, key})
? It looks like you are not using the right Id and/or password. – Mick