ActivityPrompt.OnRecognizeAsync 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.
When overridden in a derived class, attempts to recognize the incoming activity.
protected virtual System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.PromptRecognizerResult<Microsoft.Bot.Schema.Activity>> OnRecognizeAsync (Microsoft.Bot.Builder.ITurnContext turnContext, System.Collections.Generic.IDictionary<string,object> state, Microsoft.Bot.Builder.Dialogs.PromptOptions options, System.Threading.CancellationToken cancellationToken = default);
abstract member OnRecognizeAsync : Microsoft.Bot.Builder.ITurnContext * System.Collections.Generic.IDictionary<string, obj> * Microsoft.Bot.Builder.Dialogs.PromptOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.PromptRecognizerResult<Microsoft.Bot.Schema.Activity>>
override this.OnRecognizeAsync : Microsoft.Bot.Builder.ITurnContext * System.Collections.Generic.IDictionary<string, obj> * Microsoft.Bot.Builder.Dialogs.PromptOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.PromptRecognizerResult<Microsoft.Bot.Schema.Activity>>
Protected Overridable Function OnRecognizeAsync (turnContext As ITurnContext, state As IDictionary(Of String, Object), options As PromptOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PromptRecognizerResult(Of Activity))
Parameters
- turnContext
- ITurnContext
Context for the current turn of conversation with the user.
- state
- IDictionary<String,Object>
Contains state for the current instance of the prompt on the dialog stack.
- options
- PromptOptions
A prompt options object constructed from the options initially provided in the call to PromptAsync(String, PromptOptions, CancellationToken).
- cancellationToken
- CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
A Task representing the asynchronous operation.
Remarks
If the task is successful, the result describes the result of the recognition attempt.