PromptDialog.Choice Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Choice<T>(IDialogContext, ResumeAfter<T>, IPromptOptions<T>, Boolean, Boolean, Boolean, Double) |
Prompt for one of a set of choices. |
Choice<T>(IDialogContext, ResumeAfter<T>, IEnumerable<T>, String, String, Int32, PromptStyle, IEnumerable<String>) |
Prompt for one of a set of choices. |
Choice<T>(IDialogContext, ResumeAfter<T>, IDictionary<T,IEnumerable<T>>, String, String, Int32, PromptStyle, IEnumerable<String>, Boolean, Boolean, Boolean, Double) |
Prompt for one of a set of choices. |
Choice<T>(IDialogContext, ResumeAfter<T>, IPromptOptions<T>, Boolean, Boolean, Boolean, Double)
- Source:
- PromptDialog.cs
Prompt for one of a set of choices.
public static void Choice<T> (Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.ResumeAfter<T> resume, Microsoft.Bot.Builder.Dialogs.IPromptOptions<T> promptOptions, bool recognizeChoices = true, bool recognizeNumbers = true, bool recognizeOrdinals = true, double minScore = 0.4);
static member Choice : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.ResumeAfter<'T> * Microsoft.Bot.Builder.Dialogs.IPromptOptions<'T> * bool * bool * bool * double -> unit
Public Shared Sub Choice(Of T) (context As IDialogContext, resume As ResumeAfter(Of T), promptOptions As IPromptOptions(Of T), Optional recognizeChoices As Boolean = true, Optional recognizeNumbers As Boolean = true, Optional recognizeOrdinals As Boolean = true, Optional minScore As Double = 0.4)
Type Parameters
- T
The type of the options.
Parameters
- context
- IDialogContext
The dialog context.
- resume
- ResumeAfter<T>
Resume handler.
- promptOptions
- IPromptOptions<T>
The prompt options.
- recognizeChoices
- Boolean
(Optional) if true, the prompt will attempt to recognize the selected value using the choices themselves. The default value is "true".
- recognizeNumbers
- Boolean
(Optional) if true, the prompt will attempt to recognize numbers in the users utterance as the index of the choice to return. The default value is "true".
- recognizeOrdinals
- Boolean
(Optional) if true, the prompt will attempt to recognize ordinals like "the first one" or "the second one" as the index of the choice to return. The default value is "true".
- minScore
- Double
(Optional) minimum score from 0.0 - 1.0 needed for a recognized choice to be considered a match. The default value is "0.4".
Remarks
T
should implement ToString()
Applies to
Choice<T>(IDialogContext, ResumeAfter<T>, IEnumerable<T>, String, String, Int32, PromptStyle, IEnumerable<String>)
- Source:
- PromptDialog.cs
Prompt for one of a set of choices.
public static void Choice<T> (Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.ResumeAfter<T> resume, System.Collections.Generic.IEnumerable<T> options, string prompt, string retry = default, int attempts = 3, Microsoft.Bot.Builder.Dialogs.PromptStyle promptStyle = Microsoft.Bot.Builder.Dialogs.PromptStyle.Auto, System.Collections.Generic.IEnumerable<string> descriptions = default);
static member Choice : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.ResumeAfter<'T> * seq<'T> * string * string * int * Microsoft.Bot.Builder.Dialogs.PromptStyle * seq<string> -> unit
Public Shared Sub Choice(Of T) (context As IDialogContext, resume As ResumeAfter(Of T), options As IEnumerable(Of T), prompt As String, Optional retry As String = Nothing, Optional attempts As Integer = 3, Optional promptStyle As PromptStyle = Microsoft.Bot.Builder.Dialogs.PromptStyle.Auto, Optional descriptions As IEnumerable(Of String) = Nothing)
Type Parameters
- T
Parameters
- context
- IDialogContext
The context.
- resume
- ResumeAfter<T>
Resume handler.
- options
- IEnumerable<T>
The possible options all of which must be convertible to a string.
- prompt
- String
The prompt to show to the user.
- retry
- String
What to show on retry.
- attempts
- Int32
The number of times to retry.
- promptStyle
- PromptStyle
Style of the prompt PromptStyle
- descriptions
- IEnumerable<String>
Descriptions to display for choices.
Applies to
Choice<T>(IDialogContext, ResumeAfter<T>, IDictionary<T,IEnumerable<T>>, String, String, Int32, PromptStyle, IEnumerable<String>, Boolean, Boolean, Boolean, Double)
- Source:
- PromptDialog.cs
Prompt for one of a set of choices.
public static void Choice<T> (Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.ResumeAfter<T> resume, System.Collections.Generic.IDictionary<T,System.Collections.Generic.IEnumerable<T>> choices, string prompt, string retry = default, int attempts = 3, Microsoft.Bot.Builder.Dialogs.PromptStyle promptStyle = Microsoft.Bot.Builder.Dialogs.PromptStyle.Auto, System.Collections.Generic.IEnumerable<string> descriptions = default, bool recognizeChoices = true, bool recognizeNumbers = true, bool recognizeOrdinals = true, double minScore = 0.4);
static member Choice : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.ResumeAfter<'T> * System.Collections.Generic.IDictionary<'T, seq<'T>> * string * string * int * Microsoft.Bot.Builder.Dialogs.PromptStyle * seq<string> * bool * bool * bool * double -> unit
Public Shared Sub Choice(Of T) (context As IDialogContext, resume As ResumeAfter(Of T), choices As IDictionary(Of T, IEnumerable(Of T)), prompt As String, Optional retry As String = Nothing, Optional attempts As Integer = 3, Optional promptStyle As PromptStyle = Microsoft.Bot.Builder.Dialogs.PromptStyle.Auto, Optional descriptions As IEnumerable(Of String) = Nothing, Optional recognizeChoices As Boolean = true, Optional recognizeNumbers As Boolean = true, Optional recognizeOrdinals As Boolean = true, Optional minScore As Double = 0.4)
Type Parameters
- T
Parameters
- context
- IDialogContext
The context.
- resume
- ResumeAfter<T>
Resume handler.
- choices
- IDictionary<T,IEnumerable<T>>
Dictionary with the options to choose from as a key and their synonyms as a value.
- prompt
- String
The prompt to show to the user.
- retry
- String
What to show on retry.
- attempts
- Int32
The number of times to retry.
- promptStyle
- PromptStyle
Style of the prompt PromptStyle
- descriptions
- IEnumerable<String>
Descriptions to display for choices.
- recognizeChoices
- Boolean
(Optional) if true, the prompt will attempt to recognize the selected value using the choices themselves. The default value is "true".
- recognizeNumbers
- Boolean
(Optional) if true, the prompt will attempt to recognize numbers in the users utterance as the index of the choice to return. The default value is "true".
- recognizeOrdinals
- Boolean
(Optional) if true, the prompt will attempt to recognize ordinals like "the first one" or "the second one" as the index of the choice to return. The default value is "true".
- minScore
- Double
(Optional) minimum score from 0.0 - 1.0 needed for a recognized choice to be considered a match. The default value is "0.4".