Skip to content

.net wrapper around Microsofts QnaMaker REST api for managing knowledge bases.

License

Notifications You must be signed in to change notification settings

Mossharbor/AzureWorkArounds.QnaMaker

Repository files navigation

Mossharbor.AzureWorkArounds.QnaMaker

.net wrapper around Microsofts QnaMaker REST api for managing knowledge bases.

Install the nuget package: Install-Package Mossharbor.AzureWorkArounds.QnaMaker -Version 1.0.1

Example:

using Mossharbor.AzureWorkArounds.QnaMaker;

// Ask a question from an existing KB
QnAKnowledgebase kb =new QnAKnowledgebase(<qna service name>, <knowledge base name>, <ocp-apim-subscription-key>); // TODO enter your credentials in here!!
var answers = kb.GenerateAnswer("hi");

// Modifying existing Knowledgebase
QnaKnowledgebaseBuilder builder = new QnaKnowledgebaseBuilder();

builder
    .Modify(maker)
    .AddAnswerToQuestions("Hello", new string[] {"Hello", "There"})
    .Update();

kb.Publish();

// Creating a new Knowledgebase
builder  
    .Create(<qna service name>, <knowledge base name>, <ocp-apim-subscription-key>)
    .AddAnswerToQuestions("Hello", new string[] {"Hello", "There"})
    .UpdateKnowledgebase();
    
// or 
QnAKnowledgebase kb =new QnAKnowledgebase(<qna service name>, <knowledge base name>, <ocp-apim-subscription-key>); // TODO enter your credentials in here!!
kb.CreateIfDoesntExist()


// and more quick options for modifying the knowledgebase
List<string> answers = maker.GetAnswerStrings();
List<string> questions = maker.GetQuestionsFor("Hello");
maker.DeleteQuestion("Hello", "There");

About

.net wrapper around Microsofts QnaMaker REST api for managing knowledge bases.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published