WaterfallDialog needed for a simple prompt?C# Bot Framework V4 Get UserInputGetting value stored in a variable in botframework suggested actionsRun Command Prompt CommandsCurious null-coalescing operator custom implicit conversion behaviourWCF vs ASP.NET Web APIDo HttpClient and HttpClientHandler have to be disposed?How is Autofac's IComponentContext being resolved in a BotBuilder sample?Prompting a user for a string C# botframe workDoes the Bot Framework allow defining logic to run when returning to a dialog from a Scorable?Bot Framework: Loop through PromptsCorrect approach with follow-up questions in a LUIS appMicrosoft Bot Framework - Authentication in Teams
What's the meaning of "Sollensaussagen"?
Was the old ablative pronoun "med" or "mēd"?
Could the museum Saturn V's be refitted for one more flight?
How do conventional missiles fly?
Night of Shab e Meraj
Venezuelan girlfriend wants to travel the USA to be with me. What is the process?
Can a virus destroy the BIOS of a modern computer?
Placement of More Information/Help Icon button for Radio Buttons
How obscure is the use of 令 in 令和?
Is this draw by repetition?
One verb to replace 'be a member of' a club
Why do I get negative height?
What is required to make GPS signals available indoors?
In Bayesian inference, why are some terms dropped from the posterior predictive?
What are the G forces leaving Earth orbit?
How seriously should I take size and weight limits of hand luggage?
My ex-girlfriend uses my Apple ID to log in to her iPad. Do I have to give her my Apple ID password to reset it?
How do I exit BASH while loop using modulus operator?
Are British MPs missing the point, with these 'Indicative Votes'?
Does Dispel Magic work on Tiny Hut?
Does int main() need a declaration on C++?
What do you call someone who asks many questions?
Car headlights in a world without electricity
Finitely generated matrix groups whose eigenvalues are all algebraic
WaterfallDialog needed for a simple prompt?
C# Bot Framework V4 Get UserInputGetting value stored in a variable in botframework suggested actionsRun Command Prompt CommandsCurious null-coalescing operator custom implicit conversion behaviourWCF vs ASP.NET Web APIDo HttpClient and HttpClientHandler have to be disposed?How is Autofac's IComponentContext being resolved in a BotBuilder sample?Prompting a user for a string C# botframe workDoes the Bot Framework allow defining logic to run when returning to a dialog from a Scorable?Bot Framework: Loop through PromptsCorrect approach with follow-up questions in a LUIS appMicrosoft Bot Framework - Authentication in Teams
I am new to the BotFramework v4 coming from v3, having a hard time understanding the dialog concept of v4
I am trying to ask the user for example his age and then I want to end the conversation I tried to dynamically add the dialog to the DialogSet
but both ContinueDialogAsync
and ResumeDialogAsync
will not get called. The conversations ends right after the prompt and the answer will not be awaited.
Here is the call of the TextPrompt:
dialogContext.Dialogs.Add(new TextPrompt("age"));
return await dialogContext.PromptAsync("age", new PromptOptions
Prompt = MessageFactory.Text("How old are you?")
);
Do I really need to implement a WaterfallDialog with a single step to achieve this?
c# asp.net-core botframework
add a comment |
I am new to the BotFramework v4 coming from v3, having a hard time understanding the dialog concept of v4
I am trying to ask the user for example his age and then I want to end the conversation I tried to dynamically add the dialog to the DialogSet
but both ContinueDialogAsync
and ResumeDialogAsync
will not get called. The conversations ends right after the prompt and the answer will not be awaited.
Here is the call of the TextPrompt:
dialogContext.Dialogs.Add(new TextPrompt("age"));
return await dialogContext.PromptAsync("age", new PromptOptions
Prompt = MessageFactory.Text("How old are you?")
);
Do I really need to implement a WaterfallDialog with a single step to achieve this?
c# asp.net-core botframework
This doc explains some differences and similarities between V3 and V4: docs.microsoft.com/en-us/azure/bot-service/migration/…
– Eric Dahlvang
Mar 8 at 0:12
add a comment |
I am new to the BotFramework v4 coming from v3, having a hard time understanding the dialog concept of v4
I am trying to ask the user for example his age and then I want to end the conversation I tried to dynamically add the dialog to the DialogSet
but both ContinueDialogAsync
and ResumeDialogAsync
will not get called. The conversations ends right after the prompt and the answer will not be awaited.
Here is the call of the TextPrompt:
dialogContext.Dialogs.Add(new TextPrompt("age"));
return await dialogContext.PromptAsync("age", new PromptOptions
Prompt = MessageFactory.Text("How old are you?")
);
Do I really need to implement a WaterfallDialog with a single step to achieve this?
c# asp.net-core botframework
I am new to the BotFramework v4 coming from v3, having a hard time understanding the dialog concept of v4
I am trying to ask the user for example his age and then I want to end the conversation I tried to dynamically add the dialog to the DialogSet
but both ContinueDialogAsync
and ResumeDialogAsync
will not get called. The conversations ends right after the prompt and the answer will not be awaited.
Here is the call of the TextPrompt:
dialogContext.Dialogs.Add(new TextPrompt("age"));
return await dialogContext.PromptAsync("age", new PromptOptions
Prompt = MessageFactory.Text("How old are you?")
);
Do I really need to implement a WaterfallDialog with a single step to achieve this?
c# asp.net-core botframework
c# asp.net-core botframework
asked Mar 7 at 21:31
sk2andysk2andy
2041413
2041413
This doc explains some differences and similarities between V3 and V4: docs.microsoft.com/en-us/azure/bot-service/migration/…
– Eric Dahlvang
Mar 8 at 0:12
add a comment |
This doc explains some differences and similarities between V3 and V4: docs.microsoft.com/en-us/azure/bot-service/migration/…
– Eric Dahlvang
Mar 8 at 0:12
This doc explains some differences and similarities between V3 and V4: docs.microsoft.com/en-us/azure/bot-service/migration/…
– Eric Dahlvang
Mar 8 at 0:12
This doc explains some differences and similarities between V3 and V4: docs.microsoft.com/en-us/azure/bot-service/migration/…
– Eric Dahlvang
Mar 8 at 0:12
add a comment |
2 Answers
2
active
oldest
votes
You don't need to use Waterfall Dialogs. The Simple Prompt Bot Sample should get you started.
Relevant code snippet:
if (results.Status == DialogTurnStatus.Empty)
// A prompt dialog can be started directly on the DialogContext. The prompt text is given in the PromptOptions.
await dialogContext.PromptAsync(
"name",
new PromptOptions Prompt = MessageFactory.Text("Please enter your name.") ,
cancellationToken);
// We had a dialog run (it was the prompt). Now it is Complete.
else if (results.Status == DialogTurnStatus.Complete)
// Check for a result.
if (results.Result != null)
// Finish by sending a message to the user. Next time ContinueAsync is called it will return DialogTurnStatus.Empty.
await turnContext.SendActivityAsync(MessageFactory.Text($"Thank you, I have your name as 'results.Result'."));
}
For additional info, I posted a similar answer to this question and I had a coworker with a similar answer here.
add a comment |
okay, I want to answer that question by myself:
The botframework v4 has an IBot
interface and every message got routed through your singleton instance of the implemented interface. So my thought was that started dialogs will get the responses of an user directly. Instead your implementation of IBot
needs to create a dialogContext and also needs to continue the active dialog in the OnTurnAsync
method:
var dialogContext = await _dialogs.CreateContextAsync(context, cancellationToken);
if (dialogContext.ActiveDialog is null)
await dialogContext.BeginDialogAsync(nameof(AgeDialog),
cancellationToken: cancellationToken);
else
await dialogContext.ContinueDialogAsync(cancellationToken);
await _accessor.ConversationState.SaveChangesAsync(context, false, cancellationToken);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55053104%2fwaterfalldialog-needed-for-a-simple-prompt%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You don't need to use Waterfall Dialogs. The Simple Prompt Bot Sample should get you started.
Relevant code snippet:
if (results.Status == DialogTurnStatus.Empty)
// A prompt dialog can be started directly on the DialogContext. The prompt text is given in the PromptOptions.
await dialogContext.PromptAsync(
"name",
new PromptOptions Prompt = MessageFactory.Text("Please enter your name.") ,
cancellationToken);
// We had a dialog run (it was the prompt). Now it is Complete.
else if (results.Status == DialogTurnStatus.Complete)
// Check for a result.
if (results.Result != null)
// Finish by sending a message to the user. Next time ContinueAsync is called it will return DialogTurnStatus.Empty.
await turnContext.SendActivityAsync(MessageFactory.Text($"Thank you, I have your name as 'results.Result'."));
}
For additional info, I posted a similar answer to this question and I had a coworker with a similar answer here.
add a comment |
You don't need to use Waterfall Dialogs. The Simple Prompt Bot Sample should get you started.
Relevant code snippet:
if (results.Status == DialogTurnStatus.Empty)
// A prompt dialog can be started directly on the DialogContext. The prompt text is given in the PromptOptions.
await dialogContext.PromptAsync(
"name",
new PromptOptions Prompt = MessageFactory.Text("Please enter your name.") ,
cancellationToken);
// We had a dialog run (it was the prompt). Now it is Complete.
else if (results.Status == DialogTurnStatus.Complete)
// Check for a result.
if (results.Result != null)
// Finish by sending a message to the user. Next time ContinueAsync is called it will return DialogTurnStatus.Empty.
await turnContext.SendActivityAsync(MessageFactory.Text($"Thank you, I have your name as 'results.Result'."));
}
For additional info, I posted a similar answer to this question and I had a coworker with a similar answer here.
add a comment |
You don't need to use Waterfall Dialogs. The Simple Prompt Bot Sample should get you started.
Relevant code snippet:
if (results.Status == DialogTurnStatus.Empty)
// A prompt dialog can be started directly on the DialogContext. The prompt text is given in the PromptOptions.
await dialogContext.PromptAsync(
"name",
new PromptOptions Prompt = MessageFactory.Text("Please enter your name.") ,
cancellationToken);
// We had a dialog run (it was the prompt). Now it is Complete.
else if (results.Status == DialogTurnStatus.Complete)
// Check for a result.
if (results.Result != null)
// Finish by sending a message to the user. Next time ContinueAsync is called it will return DialogTurnStatus.Empty.
await turnContext.SendActivityAsync(MessageFactory.Text($"Thank you, I have your name as 'results.Result'."));
}
For additional info, I posted a similar answer to this question and I had a coworker with a similar answer here.
You don't need to use Waterfall Dialogs. The Simple Prompt Bot Sample should get you started.
Relevant code snippet:
if (results.Status == DialogTurnStatus.Empty)
// A prompt dialog can be started directly on the DialogContext. The prompt text is given in the PromptOptions.
await dialogContext.PromptAsync(
"name",
new PromptOptions Prompt = MessageFactory.Text("Please enter your name.") ,
cancellationToken);
// We had a dialog run (it was the prompt). Now it is Complete.
else if (results.Status == DialogTurnStatus.Complete)
// Check for a result.
if (results.Result != null)
// Finish by sending a message to the user. Next time ContinueAsync is called it will return DialogTurnStatus.Empty.
await turnContext.SendActivityAsync(MessageFactory.Text($"Thank you, I have your name as 'results.Result'."));
}
For additional info, I posted a similar answer to this question and I had a coworker with a similar answer here.
answered Mar 8 at 0:04
mdrichardsonmdrichardson
1,0661111
1,0661111
add a comment |
add a comment |
okay, I want to answer that question by myself:
The botframework v4 has an IBot
interface and every message got routed through your singleton instance of the implemented interface. So my thought was that started dialogs will get the responses of an user directly. Instead your implementation of IBot
needs to create a dialogContext and also needs to continue the active dialog in the OnTurnAsync
method:
var dialogContext = await _dialogs.CreateContextAsync(context, cancellationToken);
if (dialogContext.ActiveDialog is null)
await dialogContext.BeginDialogAsync(nameof(AgeDialog),
cancellationToken: cancellationToken);
else
await dialogContext.ContinueDialogAsync(cancellationToken);
await _accessor.ConversationState.SaveChangesAsync(context, false, cancellationToken);
add a comment |
okay, I want to answer that question by myself:
The botframework v4 has an IBot
interface and every message got routed through your singleton instance of the implemented interface. So my thought was that started dialogs will get the responses of an user directly. Instead your implementation of IBot
needs to create a dialogContext and also needs to continue the active dialog in the OnTurnAsync
method:
var dialogContext = await _dialogs.CreateContextAsync(context, cancellationToken);
if (dialogContext.ActiveDialog is null)
await dialogContext.BeginDialogAsync(nameof(AgeDialog),
cancellationToken: cancellationToken);
else
await dialogContext.ContinueDialogAsync(cancellationToken);
await _accessor.ConversationState.SaveChangesAsync(context, false, cancellationToken);
add a comment |
okay, I want to answer that question by myself:
The botframework v4 has an IBot
interface and every message got routed through your singleton instance of the implemented interface. So my thought was that started dialogs will get the responses of an user directly. Instead your implementation of IBot
needs to create a dialogContext and also needs to continue the active dialog in the OnTurnAsync
method:
var dialogContext = await _dialogs.CreateContextAsync(context, cancellationToken);
if (dialogContext.ActiveDialog is null)
await dialogContext.BeginDialogAsync(nameof(AgeDialog),
cancellationToken: cancellationToken);
else
await dialogContext.ContinueDialogAsync(cancellationToken);
await _accessor.ConversationState.SaveChangesAsync(context, false, cancellationToken);
okay, I want to answer that question by myself:
The botframework v4 has an IBot
interface and every message got routed through your singleton instance of the implemented interface. So my thought was that started dialogs will get the responses of an user directly. Instead your implementation of IBot
needs to create a dialogContext and also needs to continue the active dialog in the OnTurnAsync
method:
var dialogContext = await _dialogs.CreateContextAsync(context, cancellationToken);
if (dialogContext.ActiveDialog is null)
await dialogContext.BeginDialogAsync(nameof(AgeDialog),
cancellationToken: cancellationToken);
else
await dialogContext.ContinueDialogAsync(cancellationToken);
await _accessor.ConversationState.SaveChangesAsync(context, false, cancellationToken);
answered Mar 8 at 14:41
sk2andysk2andy
2041413
2041413
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55053104%2fwaterfalldialog-needed-for-a-simple-prompt%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
This doc explains some differences and similarities between V3 and V4: docs.microsoft.com/en-us/azure/bot-service/migration/…
– Eric Dahlvang
Mar 8 at 0:12