LuisDialog<TResult> LuisDialog<TResult> LuisDialog<TResult> Class

Definition

A dialog specialized to handle intents and entities from LUIS.

public class LuisDialog<TResult> : Microsoft.Bot.Builder.Dialogs.IDialog<TResult>
type LuisDialog<'Result> = class
    interface IDialog<'Result>
Public Class LuisDialog(Of TResult)
Implements IDialog(Of TResult)
Type Parameters
TResult

The result type.

Inheritance
LuisDialog<TResult>LuisDialog<TResult>LuisDialog<TResult>
Implements

Constructors

LuisDialog(ILuisService[]) LuisDialog(ILuisService[]) LuisDialog(ILuisService[])

Construct the LUIS dialog.

public LuisDialog (params Microsoft.Bot.Builder.Luis.ILuisService[] services);
new Microsoft.Bot.Builder.Dialogs.LuisDialog<'Result> : Microsoft.Bot.Builder.Luis.ILuisService[] -> Microsoft.Bot.Builder.Dialogs.LuisDialog<'Result>
Public Sub New (ParamArray services As ILuisService())
Parameters
services
ILuisService[]

The LUIS service.

Fields

handlerByIntent handlerByIntent handlerByIntent

Mapping from intent string to the appropriate handler.

protected System.Collections.Generic.Dictionary<string,Microsoft.Bot.Builder.Dialogs.IntentActivityHandler> handlerByIntent;
val mutable handlerByIntent : System.Collections.Generic.Dictionary<string, Microsoft.Bot.Builder.Dialogs.IntentActivityHandler>
Protected handlerByIntent As Dictionary(Of String, IntentActivityHandler) 

services services services

protected readonly System.Collections.Generic.IReadOnlyList<Microsoft.Bot.Builder.Luis.ILuisService> services;
val mutable services : System.Collections.Generic.IReadOnlyList<Microsoft.Bot.Builder.Luis.ILuisService>
Protected ReadOnly services As IReadOnlyList(Of ILuisService) 

Methods

BestIntentFrom(LuisResult) BestIntentFrom(LuisResult) BestIntentFrom(LuisResult)

Calculates the best scored IntentRecommendation from a LuisResult.

protected virtual Microsoft.Bot.Builder.Luis.Models.IntentRecommendation BestIntentFrom (Microsoft.Bot.Builder.Luis.Models.LuisResult result);
abstract member BestIntentFrom : Microsoft.Bot.Builder.Luis.Models.LuisResult -> Microsoft.Bot.Builder.Luis.Models.IntentRecommendation
override this.BestIntentFrom : Microsoft.Bot.Builder.Luis.Models.LuisResult -> Microsoft.Bot.Builder.Luis.Models.IntentRecommendation
Protected Overridable Function BestIntentFrom (result As LuisResult) As IntentRecommendation
Parameters
result
LuisResult LuisResult LuisResult

A result of a LUIS service call.

Returns

The best scored IntentRecommendation, or null if result doesn't contain any intents.

BestResultFrom(IEnumerable) BestResultFrom(IEnumerable) BestResultFrom(IEnumerable)

Calculates the best scored LuisServiceResult across multiple LuisServiceResult returned by different ILuisService.

protected virtual Microsoft.Bot.Builder.Dialogs.LuisServiceResult BestResultFrom (System.Collections.Generic.IEnumerable<Microsoft.Bot.Builder.Dialogs.LuisServiceResult> results);
abstract member BestResultFrom : seq<Microsoft.Bot.Builder.Dialogs.LuisServiceResult> -> Microsoft.Bot.Builder.Dialogs.LuisServiceResult
override this.BestResultFrom : seq<Microsoft.Bot.Builder.Dialogs.LuisServiceResult> -> Microsoft.Bot.Builder.Dialogs.LuisServiceResult
Protected Overridable Function BestResultFrom (results As IEnumerable(Of LuisServiceResult)) As LuisServiceResult
Parameters
results
IEnumerable<LuisServiceResult>

Results of multiple LUIS services calls.

Returns

A LuisServiceResult with the best scored IntentRecommendation and related LuisResult, or null if no one of results contains any intents.

DispatchToIntentHandler(IDialogContext, IAwaitable, IntentRecommendation, LuisResult) DispatchToIntentHandler(IDialogContext, IAwaitable, IntentRecommendation, LuisResult) DispatchToIntentHandler(IDialogContext, IAwaitable, IntentRecommendation, LuisResult)

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(Microsoft.Bot.Builder.Dialogs.LuisDialog`1/<DispatchToIntentHandler>d__9))]
protected virtual System.Threading.Tasks.Task DispatchToIntentHandler (Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Connector.IMessageActivity> item, Microsoft.Bot.Builder.Luis.Models.IntentRecommendation bestIntent, Microsoft.Bot.Builder.Luis.Models.LuisResult result);
abstract member DispatchToIntentHandler : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Connector.IMessageActivity> * Microsoft.Bot.Builder.Luis.Models.IntentRecommendation * Microsoft.Bot.Builder.Luis.Models.LuisResult -> System.Threading.Tasks.Task
override this.DispatchToIntentHandler : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Connector.IMessageActivity> * Microsoft.Bot.Builder.Luis.Models.IntentRecommendation * Microsoft.Bot.Builder.Luis.Models.LuisResult -> System.Threading.Tasks.Task
Protected Overridable Function DispatchToIntentHandler (context As IDialogContext, item As IAwaitable(Of IMessageActivity), bestIntent As IntentRecommendation, result As LuisResult) As Task
Parameters
item
IAwaitable<Microsoft.Bot.Connector.IMessageActivity>
Returns

GetHandlersByIntent() GetHandlersByIntent() GetHandlersByIntent()

protected virtual System.Collections.Generic.IDictionary<string,Microsoft.Bot.Builder.Dialogs.IntentActivityHandler> GetHandlersByIntent ();
abstract member GetHandlersByIntent : unit -> System.Collections.Generic.IDictionary<string, Microsoft.Bot.Builder.Dialogs.IntentActivityHandler>
override this.GetHandlersByIntent : unit -> System.Collections.Generic.IDictionary<string, Microsoft.Bot.Builder.Dialogs.IntentActivityHandler>
Protected Overridable Function GetHandlersByIntent () As IDictionary(Of String, IntentActivityHandler)
Returns

GetLuisQueryTextAsync(IDialogContext, IMessageActivity) GetLuisQueryTextAsync(IDialogContext, IMessageActivity) GetLuisQueryTextAsync(IDialogContext, IMessageActivity)

protected virtual System.Threading.Tasks.Task<string> GetLuisQueryTextAsync (Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Connector.IMessageActivity message);
abstract member GetLuisQueryTextAsync : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Connector.IMessageActivity -> System.Threading.Tasks.Task<string>
override this.GetLuisQueryTextAsync : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Connector.IMessageActivity -> System.Threading.Tasks.Task<string>
Protected Overridable Function GetLuisQueryTextAsync (context As IDialogContext, message As IMessageActivity) As Task(Of String)
Parameters
message
Microsoft.Bot.Connector.IMessageActivity Microsoft.Bot.Connector.IMessageActivity Microsoft.Bot.Connector.IMessageActivity
Returns

LuisActionDialogFinished(IDialogContext, IAwaitable) LuisActionDialogFinished(IDialogContext, IAwaitable) LuisActionDialogFinished(IDialogContext, IAwaitable)

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(Microsoft.Bot.Builder.Dialogs.LuisDialog`1/<LuisActionDialogFinished>d__13))]
protected virtual System.Threading.Tasks.Task LuisActionDialogFinished (Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Builder.Luis.Models.LuisResult> item);
abstract member LuisActionDialogFinished : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Builder.Luis.Models.LuisResult> -> System.Threading.Tasks.Task
override this.LuisActionDialogFinished : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Builder.Luis.Models.LuisResult> -> System.Threading.Tasks.Task
Protected Overridable Function LuisActionDialogFinished (context As IDialogContext, item As IAwaitable(Of LuisResult)) As Task
Parameters
Returns

MakeLuisActionDialog(ILuisService, String, String) MakeLuisActionDialog(ILuisService, String, String) MakeLuisActionDialog(ILuisService, String, String)

[System.Obsolete("Action binding in LUIS should be replaced with code.")]
[System.Runtime.CompilerServices.AsyncStateMachine(typeof(Microsoft.Bot.Builder.Dialogs.LuisDialog`1/<MakeLuisActionDialog>d__12))]
protected virtual System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Builder.Luis.Models.LuisResult>> MakeLuisActionDialog (Microsoft.Bot.Builder.Luis.ILuisService luisService, string contextId, string prompt);
abstract member MakeLuisActionDialog : Microsoft.Bot.Builder.Luis.ILuisService * string * string -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Builder.Luis.Models.LuisResult>>
override this.MakeLuisActionDialog : Microsoft.Bot.Builder.Luis.ILuisService * string * string -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Builder.Luis.Models.LuisResult>>
Protected Overridable Function MakeLuisActionDialog (luisService As ILuisService, contextId As String, prompt As String) As Task(Of IDialog(Of LuisResult))
Parameters
contextId
String String String
Returns

MakeServicesFromAttributes() MakeServicesFromAttributes() MakeServicesFromAttributes()

public Microsoft.Bot.Builder.Luis.ILuisService[] MakeServicesFromAttributes ();
member this.MakeServicesFromAttributes : unit -> Microsoft.Bot.Builder.Luis.ILuisService[]
Public Function MakeServicesFromAttributes () As ILuisService()
Returns

MessageReceived(IDialogContext, IAwaitable) MessageReceived(IDialogContext, IAwaitable) MessageReceived(IDialogContext, IAwaitable)

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(Microsoft.Bot.Builder.Dialogs.LuisDialog`1/<MessageReceived>d__8))]
protected virtual System.Threading.Tasks.Task MessageReceived (Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Connector.IMessageActivity> item);
abstract member MessageReceived : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Connector.IMessageActivity> -> System.Threading.Tasks.Task
override this.MessageReceived : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.IAwaitable<Microsoft.Bot.Connector.IMessageActivity> -> System.Threading.Tasks.Task
Protected Overridable Function MessageReceived (context As IDialogContext, item As IAwaitable(Of IMessageActivity)) As Task
Parameters
item
IAwaitable<Microsoft.Bot.Connector.IMessageActivity>
Returns

ModifyLuisRequest(LuisRequest) ModifyLuisRequest(LuisRequest) ModifyLuisRequest(LuisRequest)

Modify LUIS request before it is sent.

protected virtual Microsoft.Bot.Builder.Luis.LuisRequest ModifyLuisRequest (Microsoft.Bot.Builder.Luis.LuisRequest request);
abstract member ModifyLuisRequest : Microsoft.Bot.Builder.Luis.LuisRequest -> Microsoft.Bot.Builder.Luis.LuisRequest
override this.ModifyLuisRequest : Microsoft.Bot.Builder.Luis.LuisRequest -> Microsoft.Bot.Builder.Luis.LuisRequest
Protected Overridable Function ModifyLuisRequest (request As LuisRequest) As LuisRequest
Parameters
request
LuisRequest LuisRequest LuisRequest

Request so far.

Returns

Modified request.

StartAsync(IDialogContext) StartAsync(IDialogContext) StartAsync(IDialogContext)

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(Microsoft.Bot.Builder.Dialogs.LuisDialog`1/<StartAsync>d__4))]
public virtual System.Threading.Tasks.Task StartAsync (Microsoft.Bot.Builder.Dialogs.IDialogContext context);
abstract member StartAsync : Microsoft.Bot.Builder.Dialogs.IDialogContext -> System.Threading.Tasks.Task
override this.StartAsync : Microsoft.Bot.Builder.Dialogs.IDialogContext -> System.Threading.Tasks.Task
Public Overridable Function StartAsync (context As IDialogContext) As Task
Parameters
Returns

Applies to