question

Thomas-4898 avatar image
0 Votes"
Thomas-4898 asked Thomas-4898 commented

Get a list of the last 10 FAQ added to QnAMaker

We are freqently adding FAQs to our database and allow users to search the FAQ through an application.
It would be handy to dynamically show a list of the last 10 FAQ added. Is this something that can be queried through the API? How?

azure-qna-maker
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.

1 Answer

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered Thomas-4898 commented

@Thomas-4898 If you are looking to display the last 10 FAQs displayed when a user queries through the GenerateAnswer API then you can achieve this by using the metadata tags to your Q&A pairs.

For example if you add a Q&A pair with the following tags:

117084-image.png

You could query the metadata tags with strictFilters in the generateAnswer API.

 curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'top':30, 'question':'size','strictFilters': [{'name':'service','value':'qna_maker'}]}"

You could possibly add a tag called added:latest to your last 10 Q&A FAQs and then use these in the query to fetch results only from the latest Q&A answers.



image.png (19.1 KiB)
· 1
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.

Thanks, this is something that could work.
However, I will need to fire an empty question, as I would like to show the list on a portal prior to user input.

0 Votes 0 ·