Skip to content

Commit

Permalink
AlarmBot Sample: mention both AlarmLuisDialog and AlarmDispatchDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
BrainCrumbz authored and Eric Dahlvang committed May 17, 2018
1 parent cb431b5 commit 078f31a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CSharp/Samples/AlarmBot/Dialogs/AlarmDispatchDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public MyLuisModelAttribute()
}

/// <summary>
/// The top-level natural language dialog for the alarm sample.
/// The top-level natural language dialog for the alarm sample,
/// based on <see cref="DispatchDialog"/>.
/// </summary>
[Serializable]
[MyLuisModel]
Expand Down
3 changes: 2 additions & 1 deletion CSharp/Samples/AlarmBot/Dialogs/AlarmLuisDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public static partial class Alarm
}

/// <summary>
/// The top-level natural language dialog for the alarm sample.
/// The top-level natural language dialog for the alarm sample,
/// based on <see cref="LuisDialog"/>.
/// </summary>
[Serializable]
public sealed class AlarmLuisDialog : LuisDialog<object>
Expand Down
5 changes: 4 additions & 1 deletion CSharp/Samples/AlarmBot/Models/AlarmModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ protected override void Load(ContainerBuilder builder)

builder.Register(c => new LuisModelAttribute("c413b2ef-382c-45bd-8ff0-f76d60e2a821", "6d0966209c6e4f6b835ce34492f3e6d9")).AsSelf().AsImplementedInterfaces().SingleInstance();

// register the top level dialog
// register the top level dialog, choosing either one of these
builder.RegisterType<AlarmDispatchDialog>().As<IDialog<object>>().InstancePerDependency();
/*
builder.RegisterType<AlarmLuisDialog>().As<IDialog<object>>().InstancePerDependency();
*/

// register other dialogs we use
builder.Register((c, p) => new AlarmRingDialog(p.TypedAs<string>(), c.Resolve<IAlarmService>(), c.Resolve<IAlarmRenderer>())).AsSelf().InstancePerDependency();
Expand Down
2 changes: 1 addition & 1 deletion CSharp/Samples/AlarmBot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The alarm bot sample illustrates several concepts:

The top "composition root" of the alarm code is the Autofac [Alarm Module](Models/AlarmModule.cs). In this module, you can see how we specify the dialog and supporting services for our bot. There are two dialogs:

* [AlarmLuisDialog](Dialogs/AlarmLuisDialog.cs) is the root dialog for the conversation, and it leverages the LUIS built-in model for alarms
* [AlarmLuisDialog](Dialogs/AlarmLuisDialog.cs) and [AlarmDispatchDialog](Dialogs/AlarmDispatchDialog.cs) are two available root dialogs for the conversation, both leveraging the LUIS built-in model for alarms. The former is based on `LuisDialog<T>`, while the latter is based on `DispatchDialog<T>`. Either one of the two should be registered as dependency in Autofac composition root
* [AlarmRingDialog](Dialogs/AlarmRingDialog.cs) will ask the user if they want to snooze the alarm when it rings

These two dialogs are supported by a series of other classes.
Expand Down

0 comments on commit 078f31a

Please sign in to comment.