Skip to content

Commit 9ec6f2e

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/BotBuilder
2 parents 7ebbf20 + 688932a commit 9ec6f2e

File tree

5 files changed

+62
-22
lines changed

5 files changed

+62
-22
lines changed

Diff for: CSharp/Library/Dialogs/Conversations.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ internal static BinaryFormatter MakeBinaryFormatter(IServiceProvider provider)
9797
};
9898
var formatter = Conversation.MakeBinaryFormatter(provider);
9999

100-
IDialogContextStore store = new DialogContextStore(formatter);
100+
IDialogContextStore contextStore = new DialogContextStore(formatter);
101+
IDialogContextStore store = new ErrorResilientDialogContextStore(contextStore);
101102

102103
IDialogContext context;
103104
if (!store.TryLoad(botData.PerUserInConversationData, BlobKey, out context))

Diff for: CSharp/Library/Dialogs/DialogContextStore.cs

+29
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,33 @@ void IDialogContextStore.Save(IDialogContext context, IBotDataBag bag, string ke
8888
bag.SetValue(key, blobNew);
8989
}
9090
}
91+
92+
public sealed class ErrorResilientDialogContextStore : IDialogContextStore
93+
{
94+
private readonly IDialogContextStore store;
95+
96+
public ErrorResilientDialogContextStore(IDialogContextStore store)
97+
{
98+
SetField.NotNull(out this.store, nameof(store), store);
99+
}
100+
101+
public void Save(IDialogContext context, IBotDataBag bag, string key)
102+
{
103+
this.store.Save(context, bag, key);
104+
}
105+
106+
public bool TryLoad(IBotDataBag bag, string key, out IDialogContext context)
107+
{
108+
try
109+
{
110+
return this.store.TryLoad(bag, key, out context);
111+
}
112+
catch (Exception)
113+
{
114+
// exception in loading the serialized context data
115+
context = null;
116+
return false;
117+
}
118+
}
119+
}
91120
}

Diff for: CSharp/Library/Dialogs/LuisDialog.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ protected async Task MessageReceived(IDialogContext context, IAwaitable<Message>
119119
var message = await item;
120120
var luisRes = await this.service.QueryAsync(message.Text);
121121

122-
var maximum = luisRes.Intents.Max(t => t.Score);
123-
var intent = luisRes.Intents.FirstOrDefault(i => i.Score == maximum);
122+
var maximum = luisRes.Intents.Max(t => t.Score ?? 0);
123+
var intent = luisRes.Intents.FirstOrDefault(i => { var curScore = i.Score ?? 0; return curScore == maximum; });
124124

125125
IntentHandler handler = null;
126126
if (intent == null || !this.handlerByIntent.TryGetValue(intent.Intent, out handler))

Diff for: CSharp/Library/Microsoft.Bot.Builder.nuspec

+27-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
<?xml version="1.0"?>
22
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3-
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4-
<id>$id$</id>
5-
<version>$version$</version>
6-
<authors>Microsoft</authors>
7-
<requireLicenseAcceptance>false</requireLicenseAcceptance>
8-
<description>The Microsoft.Bot.Builder is a framework for building bots based on a persistent dialog system</description>
9-
<summary>The Microsoft.Bot.Builder is a framework for building bots based on a persistent dialog system</summary>
10-
<language>en-US</language>
11-
<dependencies>
12-
<dependency id="Microsoft.AspNet.WebApi.Client" version="5.2.3" />
13-
<dependency id="Microsoft.AspNet.WebApi.Core" version="5.2.3" />
14-
<dependency id="Microsoft.Bot.Connector" version="1.0.0.0" />
15-
<dependency id="Microsoft.Rest.ClientRuntime" version="1.8.2" />
16-
<dependency id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" />
17-
<dependency id="Newtonsoft.Json" version="7.0.1" />
18-
</dependencies>
19-
</metadata>
3+
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4+
<id>$id$</id>
5+
<version>$version$</version>
6+
<authors>Microsoft</authors>
7+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
8+
<description>
9+
Microsoft Bot Builder is a powerful framework for constructing bots that can handle both freeform interactions and more guided ones where the possibilities are explicitly shown to the user. It is easy to use and leverages C# to provide a natural way to write bots.
10+
11+
High Level Features:
12+
* Powerful dialog system with dialogs that are isolated and composable.
13+
* Built-in dialogs for simple things like Yes/No, strings, numbers, enumerations.
14+
* Built-in dialogs that utilize powerful AI frameworks like LUIS http://luis.ai.
15+
* Bots are stateless which helps them scale.
16+
* Form Flow for automatically generating a Bot from a C# class for filling in the class and that supports help, navigation, clarification and confirmation.
17+
See http://docs.botframework.com/sdkreference/csharp/ for documentation.
18+
</description>
19+
<summary>Microsoft.Bot.Builder is a framework for easily building stateless bots that span from regular expressions to AI based natural language.</summary>
20+
<language>en-US</language>
21+
<dependencies>
22+
<dependency id="Microsoft.AspNet.WebApi.Client" version="5.2.3" />
23+
<dependency id="Microsoft.AspNet.WebApi.Core" version="5.2.3" />
24+
<dependency id="Microsoft.Bot.Connector" version="1.0.0.0" />
25+
<dependency id="Microsoft.Rest.ClientRuntime" version="1.8.2" />
26+
<dependency id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" />
27+
<dependency id="Newtonsoft.Json" version="7.0.1" />
28+
</dependencies>
29+
</metadata>
2030
</package>

Diff for: CSharp/Library/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.0.1.0")]
36+
[assembly: AssemblyFileVersion("1.0.1.0")]
3737

3838
[assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Tests")]
3939

0 commit comments

Comments
 (0)