question

RajasekharV-5356 avatar image
0 Votes"
RajasekharV-5356 asked RajasekharV-5356 answered

Multiple answers not visible using QNA api

This question is regarding QnA maker.
When I post a question in chatbot and inspect the answer, I can see the best answer as well as other answers(Observed 3 answeres). But when I request for the same using api
listSearchResults = client.knowledgebase.generate_answer(kb_id, QueryDTO(question = question))

I received only one answer, for my applications I need multiple answers (closest ones too).
How do I get it using api?

azure-qna-maker
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, it seems there's no way to specify how many answers to return but you can specify max number of answers to return by adding top in request body, have you tried that?




0 Votes 0 ·

listSearchResults = client.knowledgebase.generate_answer(kb_id, QueryDTO(question = question,top=3))

It's working. My mistake I tried with Top as I find it some document. I corrected now its working.

Thanks, GiftA-MSFT for your help

0 Votes 0 ·

1 Answer

RajasekharV-5356 avatar image
0 Votes"
RajasekharV-5356 answered

listSearchResults = client.knowledgebase.generate_answer(kb_id, QueryDTO(question = question,top=3))

Need to add top parameter.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.