ChoicePrompt 类
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. prompts. Prompt<T> - com.
microsoft. bot. dialogs. prompts. ChoicePrompt
- com.
- com.
- com.
public class ChoicePrompt
extends Prompt<FoundChoice>
提示用户从选项列表中选择。
构造函数摘要
方法摘要
方法继承自 Dialog
方法继承自 Prompt
方法继承自 java.lang.Object
构造函数详细信息
ChoicePrompt
ChoicePrompt
public ChoicePrompt(String dialogId, PromptValidator
初始化 ChoicePrompt 类的新实例。
Parameters:
The value of <xref uid="" data-throw-if-not-resolved="false" data-raw-source="dialogId"></xref> must be unique within the
<xref uid="com.microsoft.bot.dialogs.DialogSet" data-throw-if-not-resolved="false" data-raw-source="DialogSet"></xref> or <xref uid="com.microsoft.bot.dialogs.ComponentDialog" data-throw-if-not-resolved="false" data-raw-source="ComponentDialog"></xref> to which
the prompt is added. If the <xref uid="com.microsoft.bot.schema.Activity.locale" data-throw-if-not-resolved="false" data-raw-source="Activity#locale"></xref> of
the <xref uid="com.microsoft.bot.dialogs.DialogContext" data-throw-if-not-resolved="false" data-raw-source="DialogContext"></xref> .<xref uid="com.microsoft.bot.dialogs.DialogContext.context" data-throw-if-not-resolved="false" data-raw-source="DialogContext#context"></xref>
.<xref uid="" data-throw-if-not-resolved="false" data-raw-source="ITurnContext#activity"></xref> is specified, then that
local is used to determine language specific behavior;
otherwise the <xref uid="" data-throw-if-not-resolved="false" data-raw-source="defaultLocale"></xref> is used. US-English
is the used if no language or default locale is
available, or if the language or locale is not otherwise
supported.
ChoicePrompt
public ChoicePrompt(String dialogId, Map
初始化 ChoicePrompt 类的新实例。
Parameters:
方法详细信息
getChoiceOptions
public ChoiceFactoryOptions getChoiceOptions()
获取传递给 的其他选项, ChoiceFactory 并用于调整呈现给用户的选项样式。
Returns:
getDefaultLocale
public String getDefaultLocale()
设置或设置用于确定提示语言特定行为的默认区域设置。
Returns:
getRecognizerOptions
public FindChoicesOptions getRecognizerOptions()
获取或设置传递给基础 {@link ChoiceRecognizers#recognizeChoices (String、IList{Choice}、FindChoicesOptions) } 方法的其他选项。
Returns:
getStyle
public ListStyle getStyle()
获取向用户显示提示时要使用的样式。
Returns:
onPrompt
protected CompletableFuture
提示用户输入。
Overrides:
ChoicePrompt.onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)Parameters:
Returns:
onRecognize
protected CompletableFuture<>
尝试识别用户的输入。
Overrides:
ChoicePrompt.onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)Parameters:
Returns:
setChoiceOptions
public void setChoiceOptions(ChoiceFactoryOptions choiceOptions)
设置传递给 ChoiceFactory 的其他选项,并用于调整呈现给用户的选项样式。
Parameters:
setDefaultLocale
public void setDefaultLocale(String defaultLocale)
设置用于确定提示语言特定行为的默认区域设置。
Parameters:
setRecognizerOptions
public void setRecognizerOptions(FindChoicesOptions recognizerOptions)
获取或设置传递给基础 {@link ChoiceRecognizers#recognizeChoices (String、IList{Choice}、FindChoicesOptions) } 方法的其他选项。
Parameters:
setStyle
public void setStyle(ListStyle style)
设置向用户显示提示时要使用的样式。
Parameters: