botframework

Is there any possible way to apply luis after capturing user input from Adaptive text block?

[亡魂溺海] 提交于 2019-12-11 18:11:36
问题 Within a bot,we have an adaptive card where the user has a choice to select yes or no. On selecting YES, user is prompted to enter the keywords. After the user gives input in the textblock in adaptive card, the input has to be captured and sent as input parameter to web api. However, after the input is given, we will have to apply luis since there is a possibility of having synonyms for the input text. In the below code, keywords variable refers to the input text given by user and for which

ITurnContext Service collection missing in Microsoft bot builder 4.2.2

两盒软妹~` 提交于 2019-12-11 18:05:15
问题 I'm trying to add some middleware code to a bot I'm creating with microsoft bot framework v 4.2.2. I can see in previous versions of builder, you're able to add services to the service collection within the 'Services' property of ITurnContext, however it no longer is present, and I can't find any documentation to detail the removal. public async Task OnTurn(ITurnContext context, MiddlewareSet.NextDelegate next) { // some middleware method in bot builder 4.0 context.Services.Add(SOME_KEY,

ChoicePrompt clears UserState or StepContext

我怕爱的太早我们不能终老 提交于 2019-12-11 17:57:45
问题 I implemented a bot with the Microsoft BotFramework. For gathering user data, I use ChoicePrompts. When a user doesn't choose one of the proposed options, the ChoicePrompt repeats until the user enters a valid option (this is default behavior from the prompt method). Unfortunately, the stepContext seems to refresh, if the ChoicePrompt reprompts the user. I used this documentation to store user data. This means that I lose the data that has been prompted from the user until then. This is my

Botframework v4: Call parent dialog from child dialog without stackoverflow exception

浪子不回头ぞ 提交于 2019-12-11 17:38:40
问题 According to this i think it is possible now to call the parent dialog from a child dialog. Before i can't do that because it will cause a Stack overflow exception. I've already updated to SDK 4.3 does anyone know how to implement this changes? Main dialog calls dialog A. WaterfallStep[] waterfallSteps = new WaterfallStep[] { FirstStepAsync, SecondStepAsync, ThirdStepAsync, }; AddDialog(new WaterfallDialog(InitialId, waterfallSteps)); AddDialog(new DialogA(DialogAId)); return await

Botframework V4: Dialogs

匆匆过客 提交于 2019-12-11 17:22:16
问题 From what i read from the docs BeginDialogAsync is like pushing from the stack and EndDialogAsync is like popping from the stack. But its not behaving like that in my code. When i press back to End the dialog in Dialog 3 it goes back to Dialog 1 instead of Dialog 2. Should it go back to dialog 2 because EndDialogAsync popped Dialog 3? Can someone help me and explain too the function of BeginDialogAsync, EndDialogAsync, ContinueDialogAsync, ReplaceDialogAsync, NextAsync. Thank you Dialog 1

How to implement confirm prompt default locale in node bot v4

眉间皱痕 提交于 2019-12-11 17:14:10
问题 I am trying to do confirm prompt the user based on the user's prefered locale. but V4 bot prompting user in English as well eventhough Locale is spanish. Here is my code in v4 node: const { ConfirmPrompt } = require('botbuilder-dialogs'); const CONFIRM_PROMPT_ES = 'confirmPrompt_ES'; const CONFIRM_PROMPT_EN = 'confirmPrompt_EN'; // added dialogs to dialogSet this.addDialog(new ConfirmPrompt(CONFIRM_PROMPT_ES,false,**'es-mx'**)) .addDialog(new ConfirmPrompt(CONFIRM_PROMPT_EN)) if(constant.lang

Is the best practice alwayas to start a dialog in bot?

六月ゝ 毕业季﹏ 提交于 2019-12-11 17:14:08
问题 I am migrating a bot V3 to V4 and it is working well, but the bot has some rules and I am having some difficulties to implement these rules. One of these rules starts dialog after call Luis, in this Luis recognizes the need. My doubt is: what is the best practice to bot? Always starts a dialog or only starts if necessary? PS: in my mind, I have to start if necessary, but I am in doubt. if (Luis.CheckDialogNeed) { await Dialog.RunAsync(turnContext, ConversationState.CreateProperty<DialogState>

How to close TextPrompt after a certain time if the enduser doesn't reply

我的梦境 提交于 2019-12-11 17:01:49
问题 In Microsoft chatbot SDK v4 I want to know how to programmatically close the Prompt "any type of it TextPrompt, ConfirmPrompt ... etc" and end the dialog after period of time if the user didn't reply. I already tried to use settimeout and use sc.endDialog but it doesn't work and gave me private promptForNameStep = async (step: WaterfallStepContext<UserProfile>) => { setTimeout(async () => { console.log('I am here!'); await step.endDialog(); }, 5000); const userProfile = await this

Botframework v4: waterfall stepcontext result. How to simplify?

假装没事ソ 提交于 2019-12-11 16:58:58
问题 I have this dialog that either number prompt the user or confirm prompt the user depending on a property. It then check the type of waterfall stepcontext result if it is decimal or bool. It is working as intented but i think it is overcomplicated and prone to error. Is there a better way to do this? Here is the code: public class LoanCalculator : WaterfallDialog { public LoanCalculator(string dialogId, IEnumerable<WaterfallStep> steps = null) : base(dialogId, steps) { AddStep(async