示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RootDialog"/> class.
        /// </summary>
        /// <param name="services">Bot Services.</param>
        public RootDialog(IQnAMakerConfiguration services)
            : base("root")
        {
            AddDialog(new QnAMakerMultiturnDialog(services));

            AddDialog(new WaterfallDialog(InitialDialog)
                      .AddStep(InitialStepAsync));

            // The initial child Dialog to run.
            InitialDialogId = InitialDialog;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QnAMakerBaseDialog"/> class.
        /// Dialog helper to generate dialogs.
        /// </summary>
        /// <param name="configuration">QnA Maker configuration.</param>
        public QnAMakerMultiturnDialog(IQnAMakerConfiguration configuration) : base(nameof(QnAMakerMultiturnDialog))
        {
            AddDialog(new WaterfallDialog(QnAMakerDialogName)
                      .AddStep(CallGenerateAnswerAsync)
                      .AddStep(CheckForMultiTurnPrompt)
                      .AddStep(DisplayQnAResult));
            _qnaService = configuration?.QnAMakerService ?? throw new ArgumentNullException(nameof(configuration));

            // The initial child Dialog to run.
            InitialDialogId = QnAMakerDialogName;
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RootDialog"/> class.
        /// </summary>
        /// <param name="services">Bot Services.</param>
        public RootDialog(IQnAMakerConfiguration services, IBotTelemetryClient telemetryClient)
            : base("root")
        {
            AddDialog(new QnAMakerBaseDialog(services, telemetryClient));

            AddDialog(new WaterfallDialog(InitialDialog)
                      .AddStep(InitialStepAsync));

            // The initial child Dialog to run.
            InitialDialogId = InitialDialog;
            // Set the telemetry client for this and all child dialogs.
            this.TelemetryClient = telemetryClient;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QnAMakerBaseDialog"/> class.
        /// Dialog helper to generate dialogs.
        /// </summary>
        /// <param name="configuration">QnA Maker configuration.</param>
        public QnAMakerBaseDialog(IQnAMakerConfiguration configuration, IBotTelemetryClient telemetryClient) : base(nameof(QnAMakerBaseDialog))
        {
            AddDialog(new WaterfallDialog(QnAMakerDialogName)
                      .AddStep(CallGenerateAnswerAsync)
                      .AddStep(CheckForMultiTurnPrompt)
                      .AddStep(DisplayQnAResult));
            _qnaService = configuration?.QnAMakerService ?? throw new ArgumentNullException(nameof(configuration));

            // The initial child Dialog to run.
            InitialDialogId = QnAMakerDialogName;

            // Set the telemetry client for this and all child dialogs.
            this.TelemetryClient = telemetryClient;
        }