Пример #1
0
 public ChatBot(ILogger <ChatBot> logger, SalesDialogBotAccessors accessors, IOrderDialogSet salesDialogSet,
                INaturalLanguageEngine naturalLanguageEngine, IChatter chatter, ILanguageDialogSet languageDialogSet,
                IViewOrdersDialogSet viewOrdersDialogSet, ISpeechRecognizer speechRecognizer)
 {
     SpeechRecognizer      = speechRecognizer;
     ViewOrdersDialogSet   = viewOrdersDialogSet;
     LanguageDialogSet     = languageDialogSet;
     Chatter               = chatter;
     NaturalLanguageEngine = naturalLanguageEngine;
     Logger         = logger;
     Accessors      = accessors;
     SalesDialogSet = salesDialogSet;
 }
Пример #2
0
 public AnotherProductDialog(SalesDialogBotAccessors accessors, IChatter chatter)
 {
     Chatter        = chatter;
     Accessors      = accessors;
     WaterfallSteps = new WaterfallStep[]
     {
         AnotherProductOrNotStepAsync,
         ThankYouStepAsync
     };
     Prompts = new List <Dialog>
     {
         new ConfirmPrompt(AnotherProductPrompt),
         new ConfirmPrompt(ConfirmOrderPrompt)
     };
 }
Пример #3
0
 public LanguageDialog(SalesDialogBotAccessors accessors, ITextTranslator translator, IChatter chatter)
 {
     Chatter        = chatter;
     Translator     = translator;
     Accessors      = accessors;
     WaterfallSteps = new WaterfallStep[]
     {
         LanguageChooseStepAsync,
         ToCustomerDialogStepAsync
     };
     Prompts = new List <Dialog>
     {
         new ChoicePrompt(LanguagePrompt, LanguageValidatorAsync)
     };
 }
Пример #4
0
 public SalesOrderPostDialog(SalesDialogBotAccessors accessors, INavClient client, IChatter chatter)
 {
     Chatter        = chatter;
     Client         = client;
     Accessors      = accessors;
     WaterfallSteps = new WaterfallStep[]
     {
         ConfirmSalesOrderStepAsync,
         PostSalesOrderAndViewStepAsync
     };
     Prompts = new List <Dialog>
     {
         new ConfirmPrompt(ConfirmSalesOrderPrompt)
     };
 }
Пример #5
0
        public LanguageDialogSet(SalesDialogBotAccessors accessors, ILanguageDialog languageDialog,
                                 IChatter chatter)
        {
            Chatter     = chatter;
            Accessors   = accessors;
            languageSet = new DialogSet(accessors.LanguageDialogState);

            var prompts = new List <Dialog>();

            prompts.AddRange(languageDialog.GetPrompts());

            languageSet.Add(new WaterfallDialog(languageDialog.GetName(), languageDialog.GetWaterfallSteps()));
            foreach (var dialog in prompts)
            {
                languageSet.Add(dialog);
            }
        }
Пример #6
0
        public VoiceVerificationDialog(SalesDialogBotAccessors accessors, IVoiceVerifier verifier,
                                       IChatter chatter)
        {
            VoiceVerifier  = verifier;
            Chatter        = chatter;
            Accessors      = accessors;
            WaterfallSteps = new WaterfallStep[]
            {
                PhraseStepAsync,
                EndVoiceAsync
            };

            Prompts = new List <Dialog>
            {
                new AttachmentPrompt(PhrasePrompt, VoiceValidatorAsync),
                new AttachmentPrompt(VoicePrompt, VoiceAuthenticatorAsync)
            };
        }
Пример #7
0
 public ViewOrdersDialog(SalesDialogBotAccessors accessors, INavClient client, IChatter chatter)
 {
     Chatter        = chatter;
     Client         = client;
     Accessors      = accessors;
     WaterfallSteps = new WaterfallStep[]
     {
         ChooseOrderStepAsync,
         ChooseActionStepAsync,
         ToActionStepAsync,
         AnotherActionStepAsync
     };
     Prompts = new List <Dialog>
     {
         new TextPrompt(OrdersPrompt, OrderNumberValidatorAsync),
         new ChoicePrompt(ActionPrompt),
         new ConfirmPrompt(OtherActionPrompt)
     };
 }
Пример #8
0
        public CustomerIdDialogWithVoiceRecognition(INavClient client, SalesDialogBotAccessors accessors,
                                                    IChatter chatter)
        {
            Chatter        = chatter;
            Client         = client;
            Accessors      = accessors;
            WaterfallSteps = new WaterfallStep[]
            {
                CustomerIdStepAsync,
                CustomerAuthenticationStepAsync,
                ConfirmProfileStepAsync,
                ToIntentionStepAsync
            };

            Prompts = new List <Dialog>
            {
                new TextPrompt(CustomerIdPrompt, CustomerIdValidatorAsync),
                new ConfirmPrompt(ConfirmIdPrompt)
            };
        }
Пример #9
0
 public ProductDialog(SalesDialogBotAccessors accessors, INavClient client, IChatter chatter)
 {
     Chatter        = chatter;
     Client         = client;
     Accessors      = accessors;
     WaterfallSteps = new WaterfallStep[]
     {
         ChooseItemCategoryStepAsync,
         ChooseItemStepAsync,
         ChooseQuantityStepAsync,
         ConfirmQuantityStepAsync,
         ToAnotherProductStepAsync
     };
     Prompts = new List <Dialog>
     {
         new ChoicePrompt(ItemCategoryPrompt, ItemCategoryChoiceValidatorAsync),
         new ChoicePrompt(ProductPrompt, ProductChoiceValidatorAsync),
         new ConfirmPrompt(ConfirmQuantityPrompt),
         new NumberPrompt <int>(QuantityPrompt, QuantityChoiceValidatorAsync)
     };
 }
Пример #10
0
        public ViewOrdersDialogSet(SalesDialogBotAccessors accessors, IViewOrdersDialog viewOrdersDialog,
                                   ICustomerIdDialog customerIdDialog, IVoiceVerificationDialog voiceVerificationDialog, IChatter chatter)
        {
            Chatter       = chatter;
            Accessors     = accessors;
            viewOrdersSet = new DialogSet(accessors.ViewOrdersDialogState);

            var prompts = new List <Dialog>();

            prompts.AddRange(viewOrdersDialog.GetPrompts());
            prompts.AddRange(customerIdDialog.GetPrompts());
            prompts.AddRange(voiceVerificationDialog.GetPrompts());

            viewOrdersSet.Add(new WaterfallDialog(viewOrdersDialog.GetName(), viewOrdersDialog.GetWaterfallSteps()));
            viewOrdersSet.Add(new WaterfallDialog(voiceVerificationDialog.GetName(), voiceVerificationDialog.GetWaterfallSteps()));
            viewOrdersSet.Add(new WaterfallDialog(customerIdDialog.GetName(), customerIdDialog.GetWaterfallSteps()));
            foreach (var dialog in prompts)
            {
                viewOrdersSet.Add(dialog);
            }
        }
Пример #11
0
        public CustomerIdDialog(INavClient client, SalesDialogBotAccessors accessors, IFaceRecognizer faceRecognizer,
                                IChatter chatter)
        {
            Chatter        = chatter;
            Client         = client;
            Accessors      = accessors;
            FaceRecognizer = faceRecognizer;
            WaterfallSteps = new WaterfallStep[]
            {
                CustomerIdStepAsync,
                CustomerAuthenticationStepAsync,
                ConfirmProfileStepAsync,
                ToIntentionStepAsync
            };

            Prompts = new List <Dialog>
            {
                new TextPrompt(CustomerIdPrompt, CustomerIdValidatorAsync),
                new ConfirmPrompt(ConfirmIdPrompt),
                new AttachmentPrompt(VerifyByPicturePromt, AuthenticationValidatorAsync)
            };
        }