Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult > Class Template Reference

A dialog specialized to handle intents and entities from LUIS. More...

Inheritance diagram for Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >:

Public Member Functions

 LuisDialog (params ILuisService[] services)
 Construct the LUIS dialog. More...
 
ILuisService[] MakeServicesFromAttributes ()
 
virtual async Task StartAsync (IDialogContext context)
 

Static Public Member Functions

static IEnumerable< KeyValuePair< string, IntentActivityHandler > > EnumerateHandlers (object dialog)
 Enumerate the handlers based on the attributes on the dialog instance. More...
 

Protected Member Functions

virtual IntentRecommendation BestIntentFrom (LuisResult result)
 Calculates the best scored IntentRecommendation from a LuisResult. More...
 
virtual LuisServiceResult BestResultFrom (IEnumerable< LuisServiceResult > results)
 Calculates the best scored LuisServiceResult across multiple LuisServiceResult returned by different ILuisService. More...
 
virtual async Task DispatchToIntentHandler (IDialogContext context, IAwaitable< IMessageActivity > item, IntentRecommendation bestInent, LuisResult result)
 
virtual IDictionary< string, IntentActivityHandlerGetHandlersByIntent ()
 
virtual Task< string > GetLuisQueryTextAsync (IDialogContext context, IMessageActivity message)
 
virtual async Task LuisActionDialogFinished (IDialogContext context, IAwaitable< LuisResult > item)
 
virtual async Task< IDialog< LuisResult > > MakeLuisActionDialog (ILuisService luisService, string contextId, string prompt)
 
virtual async Task MessageReceived (IDialogContext context, IAwaitable< IMessageActivity > item)
 

Protected Attributes

Dictionary< string, IntentActivityHandlerhandlerByIntent
 Mapping from intent string to the appropriate handler. More...
 
readonly IReadOnlyList< ILuisServiceservices
 

Detailed Description

A dialog specialized to handle intents and entities from LUIS.

Template Parameters
TResultThe result type.

Definition at line 143 of file LuisDialog.cs.

Constructor & Destructor Documentation

Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.LuisDialog ( params ILuisService[]  services)
inline

Construct the LUIS dialog.

Parameters
servicesThe LUIS service.

Definition at line 162 of file LuisDialog.cs.

Member Function Documentation

virtual IntentRecommendation Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.BestIntentFrom ( LuisResult  result)
inlineprotectedvirtual

Calculates the best scored IntentRecommendation from a LuisResult.

Parameters
resultA result of a LUIS service call.
Returns
The best scored IntentRecommendation, or null if result doesn't contain any intents.

Definition at line 182 of file LuisDialog.cs.

virtual LuisServiceResult Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.BestResultFrom ( IEnumerable< LuisServiceResult results)
inlineprotectedvirtual

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

Parameters
resultsResults 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.

Definition at line 194 of file LuisDialog.cs.

virtual async Task Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.DispatchToIntentHandler ( IDialogContext  context,
IAwaitable< IMessageActivity item,
IntentRecommendation  bestInent,
LuisResult  result 
)
inlineprotectedvirtual

Definition at line 232 of file LuisDialog.cs.

static IEnumerable<KeyValuePair<string, IntentActivityHandler> > Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.EnumerateHandlers ( object  dialog)
inlinestatic

Enumerate the handlers based on the attributes on the dialog instance.

Parameters
dialogThe dialog.
Returns
An enumeration of handlers.

Definition at line 338 of file LuisDialog.cs.

virtual IDictionary<string, IntentActivityHandler> Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.GetHandlersByIntent ( )
inlineprotectedvirtual

Definition at line 264 of file LuisDialog.cs.

virtual Task<string> Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.GetLuisQueryTextAsync ( IDialogContext  context,
IMessageActivity  message 
)
inlineprotectedvirtual

Definition at line 259 of file LuisDialog.cs.

virtual async Task Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.LuisActionDialogFinished ( IDialogContext  context,
IAwaitable< LuisResult item 
)
inlineprotectedvirtual

Definition at line 274 of file LuisDialog.cs.

virtual async Task<IDialog<LuisResult> > Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.MakeLuisActionDialog ( ILuisService  luisService,
string  contextId,
string  prompt 
)
inlineprotectedvirtual

Definition at line 269 of file LuisDialog.cs.

ILuisService [] Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.MakeServicesFromAttributes ( )
inline

Definition at line 151 of file LuisDialog.cs.

virtual async Task Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.MessageReceived ( IDialogContext  context,
IAwaitable< IMessageActivity item 
)
inlineprotectedvirtual

Definition at line 199 of file LuisDialog.cs.

virtual async Task Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.StartAsync ( IDialogContext  context)
inlinevirtual

Definition at line 172 of file LuisDialog.cs.

Member Data Documentation

Dictionary<string, IntentActivityHandler> Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.handlerByIntent
protected

Mapping from intent string to the appropriate handler.

Definition at line 149 of file LuisDialog.cs.

readonly IReadOnlyList<ILuisService> Microsoft.Bot.Builder.Dialogs.LuisDialog< TResult >.services
protected

Definition at line 145 of file LuisDialog.cs.


The documentation for this class was generated from the following file: