QnAMakerDialog Class

Definition

A dialog that supports multi-step and adaptive-learning QnA Maker services.

public class QnAMakerDialog : Microsoft.Bot.Builder.Dialogs.WaterfallDialog
type QnAMakerDialog = class
    inherit WaterfallDialog
Public Class QnAMakerDialog
Inherits WaterfallDialog
Inheritance
QnAMakerDialog

Remarks

An instance of this class targets a specific QnA Maker knowledge base. It supports knowledge bases that include follow-up prompt and active learning features.

Constructors

QnAMakerDialog(String, Int32)

Initializes a new instance of the QnAMakerDialog class. The JSON serializer uses this constructor to deserialize objects of this class.

QnAMakerDialog(String, String, String, Activity, Single, String, String, Int32, Activity, Metadata[], Filters, ServiceType, HttpClient, String, Int32, Boolean)

Initializes a new instance of the QnAMakerDialog class.

QnAMakerDialog(String, String, String, String, Activity, Single, String, String, Int32, Activity, Metadata[], Filters, ServiceType, HttpClient, String, Int32, Boolean)

Initializes a new instance of the QnAMakerDialog class.

Fields

DefaultThreshold

The default threshold for answers returned, based on score.

DefaultTopN

The default maximum number of answers to be returned for the question.

Kind

The declarative name for this type.

Options

The path for storing and retrieving the options for this instance of the dialog.

PreviousQnAId

The path for storing and retrieving the previous question ID.

QnAContextData

The path for storing and retrieving QnA Maker context data.

Properties

ActiveLearningCardTitle

Gets or sets the card title to use when showing active learning options to the user, if active learning is enabled.

CardNoMatchResponse

Gets or sets the template to send the user if they select the no match option on an active learning card.

CardNoMatchText

Gets or sets the button text to use with active learning options, allowing a user to indicate none of the options are applicable.

DisplayPreciseAnswerOnly

Gets or sets a value indicating whether the dialog response should display only precise answers.

EnablePreciseAnswer

Gets or sets a value indicating whether to include precise answer in response.

EndpointKey

Gets or sets the QnA Maker endpoint key to use to query the knowledge base.

Filters

Gets or sets the metadata and sources used to filter QnA Maker results.

HostName

Gets or sets the QnA Maker host URL for the knowledge base.

HttpClient

Gets or sets the HttpClient instance to use for requests to the QnA Maker service.

Id

Gets or sets id for the dialog.

(Inherited from Dialog)
IncludeUnstructuredSources

Gets or sets a value indicating whether to include unstructured sources in search for answers.

IsTest

Gets or sets a value indicating whether gets or sets environment of knowledgebase to be called.

KnowledgeBaseId

Gets or sets the QnA Maker knowledge base ID to query.

LogPersonalInformation

Gets or sets the flag to determine if personal information should be logged in telemetry.

NoAnswer

Gets or sets the template to send the user when QnA Maker does not find an answer.

QnAServiceType

Gets or sets QnA Service type to query either QnAMaker or Custom Question Answering Knowledge Base.

RankerType

Gets or sets the QnA Maker ranker type to use.

Source

Gets the information of the cref="SourceRange"/>.

(Inherited from Dialog)
StrictFilters

Gets or sets the QnA Maker metadata with which to filter or boost queries to the knowledge base; or null to apply none.

TelemetryClient

Gets or sets the IBotTelemetryClient to use for logging.

(Inherited from Dialog)
Threshold

Gets or sets the threshold for answers returned, based on score.

Top

Gets or sets the maximum number of answers to return from the knowledge base.

UseTeamsAdaptiveCard

Gets or sets a value indicating whether the dialog response should use a MS Teams formatted Adaptive Card instead of a Hero Card.

Methods

AddStep(WaterfallStep)

Adds a new step to the waterfall.

(Inherited from WaterfallDialog)
BeginDialogAsync(DialogContext, Object, CancellationToken)

Called when the dialog is started and pushed onto the dialog stack.

ContinueDialogAsync(DialogContext, CancellationToken)

Called when the waterfall dialog is continued, where it is the active dialog and the user replies with a new activity.

DisplayQnAResultAsync(WaterfallStepContext, CancellationToken)

Displays QnA Result from stepContext through Activity - with first answer from QnA Maker response.

EndDialogAsync(ITurnContext, DialogInstance, DialogReason, CancellationToken)

Called when the dialog is ending.

(Inherited from WaterfallDialog)
GetQnAMakerClientAsync(DialogContext)

Gets an IQnAMakerClient to use to access the QnA Maker knowledge base.

GetQnAMakerOptionsAsync(DialogContext)

Gets the options for the QnA Maker client that the dialog will use to query the knowledge base.

GetQnAResponseOptionsAsync(DialogContext)

Gets the options the dialog will use to display query results to the user.

GetVersion()

Gets a unique string which represents the version of this dialog. If the version changes between turns the dialog system will emit a DialogChanged event.

(Inherited from WaterfallDialog)
OnComputeId()

Builds the compute Id for the dialog.

(Inherited from Dialog)
OnDialogEventAsync(DialogContext, DialogEvent, CancellationToken)

Called when an event has been raised, using DialogContext.emitEvent(), by either the current dialog or a dialog that the current dialog started.

(Inherited from Dialog)
OnPostBubbleEventAsync(DialogContext, DialogEvent, CancellationToken)

Called after an event was bubbled to all parents and wasn't handled.

(Inherited from Dialog)
OnPreBubbleEventAsync(DialogContext, DialogEvent, CancellationToken)

Called before an event is bubbled to its parent.

OnStepAsync(WaterfallStepContext, CancellationToken)

Called when an individual waterfall step is being executed.

(Inherited from WaterfallDialog)
RegisterSourceLocation(String, Int32)

Registers a cref="SourceRange"/> in the provided location.

(Inherited from Dialog)
RepromptDialogAsync(ITurnContext, DialogInstance, CancellationToken)

Called when the dialog should re-prompt the user for input.

(Inherited from Dialog)
ResumeDialogAsync(DialogContext, DialogReason, Object, CancellationToken)

Called when a child waterfall dialog completed its turn, returning control to this dialog.

(Inherited from WaterfallDialog)
RunStepAsync(DialogContext, Int32, DialogReason, Object, CancellationToken)

Excutes a step of the waterfall dialog.

(Inherited from WaterfallDialog)

Extension Methods

RunAsync(Dialog, ITurnContext, IStatePropertyAccessor<DialogState>, CancellationToken)

Creates a dialog stack and starts a dialog, pushing it onto the stack.

Applies to