Comprehensive Detailed Explanation
The scenario:
You are building an Azure WebJob to create knowledge bases from an array of URLs.
You already have a QnAMakerClient object instantiated with the relevant API keys.
You need to know what steps are required to create a knowledge base programmatically.
Step 1 – Create a CreateKbDTO object
CreateKbDTO is the request payload for creating a knowledge base.
It contains the name of the knowledge base and its sources, which may include:
A list of URLs.
A list of QnA pairs ( QnADTO ).
A list of files ( FileDTO ).
In this case, since the WebJob provides URLs, they will be passed inside the CreateKbDTO.Sources property.
Step 2 – Call client.Knowledgebase.CreateAsync
Once the CreateKbDTO object is defined, you use the QnAMakerClient to send the request:
var response = await client.Knowledgebase.CreateAsync(createKbDTO);
This triggers the asynchronous creation of a new knowledge base in the QnA Maker service.
Why not A or C?
A. Create a list of FileDTO objects: Not required here, because the question specifies URLs, not files.
C. Create a list of QnADTO objects: Also not needed, since you’re not directly supplying QnA pairs; the knowledge base will be built from URLs.
Correct Answer
B. Call the client.Knowledgebase.CreateAsync method.
D. Create a CreateKbDTO object.
Microsoft References
QnA Maker – Create Knowledge Base API
QnAMakerClient Class – Azure SDK for .NET
CreateKbDTO Class