1

I am able to use strictFilter parameter with normal rest API call to QnA Maker

{
"question": "Campaign and AEM integration",
"top": 3,
"strictFilters": [{
    "name": "product",
    "value": "adobe"
}]

}

But when I am trying to do the same thing using botbuilder-ai nodejs sdk, it is not providing me the desired result, I am pretty sure it is ignoring the strictFilters parameter.

  • to clarify, when you send the request say directly to QnAMaker via Postman, do you get the correct result? And then when you try via the Bot Framework Node.js SDK, it does not behave as expected? -- trying to verify if there's a bug in the SDK or if it's something wrong with QnAMaker itself – Zeryth Mar 30 '21 at 15:53

1 Answers1

0

Honestly the request is so simple I would just use REST instead of the sdk. I'm still using request which has be deprecated, but would work fine with axios or your module of choice. Here's mine where I'm not sending filters but I do have context which I send. Regardless this will function exactly the same if you make the call via Postman or within nodejs.

        const qnaResult = await request({
            url: url,
            method: 'POST',
            headers: headers,
            timeout: process.env.DEFAULT_API_TIMOUT,
            json: {
                question: query,
                top: 3,
                context: qnAcontext
            }
        });
billoverton
  • 2,705
  • 2
  • 9
  • 32