This commit is contained in:
Mostafa Elaraby (IBS) 2018-03-20 20:58:23 +02:00
Родитель 905e7c6c15
Коммит 23051d67f6
17 изменённых файлов: 164 добавлений и 357 удалений

Просмотреть файл

@ -1,171 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder", "libraries\Microsoft.Bot.Builder\Microsoft.Bot.Builder.csproj", "{74908F42-3842-49B4-9344-60BB791FDE32}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{4269F3C3-6B42-419B-B64A-3E6DC0F1574A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{AD743B78-D61F-4FBF-B620-FA83CE599A50}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{3ADFB27A-95FA-4330-B211-1D66A29A17AB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.EchoBot-Console", "samples\Microsoft.Bot.Samples.EchoBot-Console\Microsoft.Bot.Samples.EchoBot-Console.csproj", "{41BC20C1-523A-4715-8E8B-88390E6F45F6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.Azure", "libraries\Microsoft.Bot.Builder.Azure\Microsoft.Bot.Builder.Azure.csproj", "{B2C5EED9-21B2-4763-AB92-C1995B76DA3A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.Ai", "libraries\Microsoft.Bot.Builder.Ai\Microsoft.Bot.Builder.Ai.csproj", "{F31CF172-6FEE-4188-9828-E5FDA531C871}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.BotFramework", "libraries\Microsoft.Bot.Builder.BotFramework\Microsoft.Bot.Builder.BotFramework.csproj", "{20DB2748-6562-472F-AD20-E57167913C7D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.Ai.Tests", "tests\Microsoft.Bot.Builder.Ai.Tests\Microsoft.Bot.Builder.Ai.Tests.csproj", "{9BDF7020-A19F-4C6C-B329-E4BFEFF6DE6B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.Tests", "tests\Microsoft.Bot.Builder.Tests\Microsoft.Bot.Builder.Tests.csproj", "{6AE5D88B-7F99-444E-ADA0-7CEAADFC477C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.Azure.Tests", "tests\Microsoft.Bot.Builder.Azure.Tests\Microsoft.Bot.Builder.Azure.Tests.csproj", "{E325A0E2-716A-49E0-9767-5087CF05727C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlarmBot", "Samples\AlarmBot\AlarmBot.csproj", "{AF1A1EAB-9427-4798-A356-65EB4B4BDFCA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlarmBot-Cards", "samples\AlarmBot-Cards\AlarmBot-Cards.csproj", "{3B5BFCCB-23CF-4849-8B2C-74D05DC3E402}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Connector", "libraries\Microsoft.Bot.Connector\Microsoft.Bot.Connector.csproj", "{6462DA5D-27DC-4CD5-9467-5EFB998FD838}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Connector.AspNetCore", "libraries\Microsoft.Bot.Connector.AspNetCore\Microsoft.Bot.Connector.AspNetCore.csproj", "{7663C249-6BC3-4CB0-A930-A1C6C7DA5EDD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Schema", "libraries\Microsoft.Bot.Schema\Microsoft.Bot.Schema.csproj", "{C1F54CDC-AD1D-45BB-8F7D-F49E411AFAF1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.Luis", "samples\Microsoft.Bot.Samples.Ai.Luis\Microsoft.Bot.Samples.Ai.Luis.csproj", "{3902803E-78B7-4236-A4E4-884CF0034FA4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.QnA", "samples\Microsoft.Bot.Samples.Ai.QnA\Microsoft.Bot.Samples.Ai.QnA.csproj", "{57E8A156-5D68-4A84-9DE8-3403CA4D2733}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.CustomMiddleware", "samples\Microsoft.Bot.Samples.CustomMiddleware\Microsoft.Bot.Samples.CustomMiddleware.csproj", "{7DFD2037-A631-48B2-9704-3F9AC9363BF5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Simplified.Asp", "samples\Microsoft.Bot.Samples.Simplified.Asp\Microsoft.Bot.Samples.Simplified.Asp.csproj", "{BF6D1EA0-BA3B-4DB3-8247-5CEB18584E59}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Bot.Samples.EchoBot-AspNet461", "samples\Microsoft.Bot.Samples.EchoBot-AspNet461\Microsoft.Bot.Samples.EchoBot-AspNet461.csproj", "{AAC0F76C-4114-4D64-A99E-8BE4C43982F9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.Luis.Translator", "samples\Microsoft.Bot.Samples.Ai.Luis.Translator\Microsoft.Bot.Samples.Ai.Luis.Translator.csproj", "{CB3E5EC8-F666-4A13-AD9C-DB79E014AA43}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.QnA.Translator", "samples\Microsoft.Bot.Samples.Ai.QnA.Translator\Microsoft.Bot.Samples.Ai.QnA.Translator.csproj", "{10A00767-431E-4C18-BE26-1FA2AE3D18E2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{74908F42-3842-49B4-9344-60BB791FDE32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74908F42-3842-49B4-9344-60BB791FDE32}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74908F42-3842-49B4-9344-60BB791FDE32}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74908F42-3842-49B4-9344-60BB791FDE32}.Release|Any CPU.Build.0 = Release|Any CPU
{41BC20C1-523A-4715-8E8B-88390E6F45F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41BC20C1-523A-4715-8E8B-88390E6F45F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41BC20C1-523A-4715-8E8B-88390E6F45F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41BC20C1-523A-4715-8E8B-88390E6F45F6}.Release|Any CPU.Build.0 = Release|Any CPU
{B2C5EED9-21B2-4763-AB92-C1995B76DA3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2C5EED9-21B2-4763-AB92-C1995B76DA3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2C5EED9-21B2-4763-AB92-C1995B76DA3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2C5EED9-21B2-4763-AB92-C1995B76DA3A}.Release|Any CPU.Build.0 = Release|Any CPU
{F31CF172-6FEE-4188-9828-E5FDA531C871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F31CF172-6FEE-4188-9828-E5FDA531C871}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F31CF172-6FEE-4188-9828-E5FDA531C871}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F31CF172-6FEE-4188-9828-E5FDA531C871}.Release|Any CPU.Build.0 = Release|Any CPU
{20DB2748-6562-472F-AD20-E57167913C7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20DB2748-6562-472F-AD20-E57167913C7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20DB2748-6562-472F-AD20-E57167913C7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20DB2748-6562-472F-AD20-E57167913C7D}.Release|Any CPU.Build.0 = Release|Any CPU
{9BDF7020-A19F-4C6C-B329-E4BFEFF6DE6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BDF7020-A19F-4C6C-B329-E4BFEFF6DE6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BDF7020-A19F-4C6C-B329-E4BFEFF6DE6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BDF7020-A19F-4C6C-B329-E4BFEFF6DE6B}.Release|Any CPU.Build.0 = Release|Any CPU
{6AE5D88B-7F99-444E-ADA0-7CEAADFC477C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AE5D88B-7F99-444E-ADA0-7CEAADFC477C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AE5D88B-7F99-444E-ADA0-7CEAADFC477C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AE5D88B-7F99-444E-ADA0-7CEAADFC477C}.Release|Any CPU.Build.0 = Release|Any CPU
{E325A0E2-716A-49E0-9767-5087CF05727C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E325A0E2-716A-49E0-9767-5087CF05727C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E325A0E2-716A-49E0-9767-5087CF05727C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E325A0E2-716A-49E0-9767-5087CF05727C}.Release|Any CPU.Build.0 = Release|Any CPU
{AF1A1EAB-9427-4798-A356-65EB4B4BDFCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF1A1EAB-9427-4798-A356-65EB4B4BDFCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF1A1EAB-9427-4798-A356-65EB4B4BDFCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF1A1EAB-9427-4798-A356-65EB4B4BDFCA}.Release|Any CPU.Build.0 = Release|Any CPU
{3B5BFCCB-23CF-4849-8B2C-74D05DC3E402}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B5BFCCB-23CF-4849-8B2C-74D05DC3E402}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B5BFCCB-23CF-4849-8B2C-74D05DC3E402}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B5BFCCB-23CF-4849-8B2C-74D05DC3E402}.Release|Any CPU.Build.0 = Release|Any CPU
{6462DA5D-27DC-4CD5-9467-5EFB998FD838}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6462DA5D-27DC-4CD5-9467-5EFB998FD838}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6462DA5D-27DC-4CD5-9467-5EFB998FD838}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6462DA5D-27DC-4CD5-9467-5EFB998FD838}.Release|Any CPU.Build.0 = Release|Any CPU
{7663C249-6BC3-4CB0-A930-A1C6C7DA5EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7663C249-6BC3-4CB0-A930-A1C6C7DA5EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7663C249-6BC3-4CB0-A930-A1C6C7DA5EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7663C249-6BC3-4CB0-A930-A1C6C7DA5EDD}.Release|Any CPU.Build.0 = Release|Any CPU
{C1F54CDC-AD1D-45BB-8F7D-F49E411AFAF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1F54CDC-AD1D-45BB-8F7D-F49E411AFAF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1F54CDC-AD1D-45BB-8F7D-F49E411AFAF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1F54CDC-AD1D-45BB-8F7D-F49E411AFAF1}.Release|Any CPU.Build.0 = Release|Any CPU
{3902803E-78B7-4236-A4E4-884CF0034FA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3902803E-78B7-4236-A4E4-884CF0034FA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3902803E-78B7-4236-A4E4-884CF0034FA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3902803E-78B7-4236-A4E4-884CF0034FA4}.Release|Any CPU.Build.0 = Release|Any CPU
{57E8A156-5D68-4A84-9DE8-3403CA4D2733}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57E8A156-5D68-4A84-9DE8-3403CA4D2733}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57E8A156-5D68-4A84-9DE8-3403CA4D2733}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57E8A156-5D68-4A84-9DE8-3403CA4D2733}.Release|Any CPU.Build.0 = Release|Any CPU
{7DFD2037-A631-48B2-9704-3F9AC9363BF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DFD2037-A631-48B2-9704-3F9AC9363BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DFD2037-A631-48B2-9704-3F9AC9363BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DFD2037-A631-48B2-9704-3F9AC9363BF5}.Release|Any CPU.Build.0 = Release|Any CPU
{BF6D1EA0-BA3B-4DB3-8247-5CEB18584E59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF6D1EA0-BA3B-4DB3-8247-5CEB18584E59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF6D1EA0-BA3B-4DB3-8247-5CEB18584E59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF6D1EA0-BA3B-4DB3-8247-5CEB18584E59}.Release|Any CPU.Build.0 = Release|Any CPU
{AAC0F76C-4114-4D64-A99E-8BE4C43982F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AAC0F76C-4114-4D64-A99E-8BE4C43982F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAC0F76C-4114-4D64-A99E-8BE4C43982F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAC0F76C-4114-4D64-A99E-8BE4C43982F9}.Release|Any CPU.Build.0 = Release|Any CPU
{CB3E5EC8-F666-4A13-AD9C-DB79E014AA43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB3E5EC8-F666-4A13-AD9C-DB79E014AA43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB3E5EC8-F666-4A13-AD9C-DB79E014AA43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB3E5EC8-F666-4A13-AD9C-DB79E014AA43}.Release|Any CPU.Build.0 = Release|Any CPU
{10A00767-431E-4C18-BE26-1FA2AE3D18E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10A00767-431E-4C18-BE26-1FA2AE3D18E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10A00767-431E-4C18-BE26-1FA2AE3D18E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10A00767-431E-4C18-BE26-1FA2AE3D18E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{74908F42-3842-49B4-9344-60BB791FDE32} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
{41BC20C1-523A-4715-8E8B-88390E6F45F6} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{B2C5EED9-21B2-4763-AB92-C1995B76DA3A} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
{F31CF172-6FEE-4188-9828-E5FDA531C871} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
{20DB2748-6562-472F-AD20-E57167913C7D} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
{9BDF7020-A19F-4C6C-B329-E4BFEFF6DE6B} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
{6AE5D88B-7F99-444E-ADA0-7CEAADFC477C} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
{E325A0E2-716A-49E0-9767-5087CF05727C} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
{AF1A1EAB-9427-4798-A356-65EB4B4BDFCA} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{3B5BFCCB-23CF-4849-8B2C-74D05DC3E402} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{6462DA5D-27DC-4CD5-9467-5EFB998FD838} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
{7663C249-6BC3-4CB0-A930-A1C6C7DA5EDD} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
{C1F54CDC-AD1D-45BB-8F7D-F49E411AFAF1} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
{3902803E-78B7-4236-A4E4-884CF0034FA4} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{57E8A156-5D68-4A84-9DE8-3403CA4D2733} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{7DFD2037-A631-48B2-9704-3F9AC9363BF5} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{BF6D1EA0-BA3B-4DB3-8247-5CEB18584E59} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{AAC0F76C-4114-4D64-A99E-8BE4C43982F9} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{CB3E5EC8-F666-4A13-AD9C-DB79E014AA43} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{10A00767-431E-4C18-BE26-1FA2AE3D18E2} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7173C9F3-A7F9-496E-9078-9156E35D6E16}
EndGlobalSection
EndGlobal
=======
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
@ -248,6 +80,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Schema.Tests"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.Luis", "samples\Microsoft.Bot.Samples.Ai.Luis\Microsoft.Bot.Samples.Ai.Luis.csproj", "{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.Luis.Translator", "samples\Microsoft.Bot.Samples.Ai.Luis.Translator\Microsoft.Bot.Samples.Ai.Luis.Translator.csproj", "{57188218-5497-4CEE-B7FC-515FAA1F1151}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.QnA.Translator", "samples\Microsoft.Bot.Samples.Ai.QnA.Translator\Microsoft.Bot.Samples.Ai.QnA.Translator.csproj", "{FC829D74-47BB-47F0-AEA0-9F0153008217}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -390,6 +226,14 @@ Global
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}.Release|Any CPU.Build.0 = Release|Any CPU
{57188218-5497-4CEE-B7FC-515FAA1F1151}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57188218-5497-4CEE-B7FC-515FAA1F1151}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57188218-5497-4CEE-B7FC-515FAA1F1151}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57188218-5497-4CEE-B7FC-515FAA1F1151}.Release|Any CPU.Build.0 = Release|Any CPU
{FC829D74-47BB-47F0-AEA0-9F0153008217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC829D74-47BB-47F0-AEA0-9F0153008217}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC829D74-47BB-47F0-AEA0-9F0153008217}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC829D74-47BB-47F0-AEA0-9F0153008217}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -431,6 +275,8 @@ Global
{7C7F5C89-C3A4-43B8-90D1-53F13C3A0510} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
{A4184239-F13F-4A09-B2D3-0B9532609248} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{57188218-5497-4CEE-B7FC-515FAA1F1151} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
{FC829D74-47BB-47F0-AEA0-9F0153008217} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7173C9F3-A7F9-496E-9078-9156E35D6E16}

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.Bot.Builder.Middleware;
using Microsoft.Bot.Schema;
using System;
using System.Threading.Tasks;
@ -11,7 +11,7 @@ namespace Microsoft.Bot.Builder.Ai
/// <summary>
/// Middleware to convert messages between different locales specified
/// </summary>
public class LocaleConverterMiddleware : IReceiveActivity
public class LocaleConverterMiddleware : IMiddleware
{
private ILocaleConverter localeConverter;
private readonly string toLocale;
@ -39,15 +39,15 @@ namespace Microsoft.Bot.Builder.Ai
/// <param name="context"></param>
/// <param name="next"></param>
/// <returns></returns>
public async Task ReceiveActivity(IBotContext context, MiddlewareSet.NextDelegate next)
public async Task OnProcessRequest(IBotContext context, MiddlewareSet.NextDelegate next)
{
IMessageActivity message = context.Request.AsMessageActivity();
if (message != null)
{
if (!String.IsNullOrWhiteSpace(message.Text))
{
string fromLocale = _getUserLocale(context);
((BotContext)context).State.User["LocaleConversionOriginalMessage"] = message.Text;
string fromLocale = _getUserLocale(context);
((BotContext)context).Set("LocaleConversionOriginalMessage",message.Text);
await ConvertLocaleMessageAsync(message, fromLocale);
await _setUserLocale(context);
}
@ -57,7 +57,7 @@ namespace Microsoft.Bot.Builder.Ai
public static string GetOriginalMessage(IBotContext context)
{
string message = ((BotContext)context).State.User["LocaleConversionOriginalMessage"] as string;
string message = ((BotContext)context).Get("LocaleConversionOriginalMessage") as string;
return message;
}
@ -69,5 +69,7 @@ namespace Microsoft.Bot.Builder.Ai
message.Text = await localeConverter.Convert(message.Text, fromLocale, toLocale);
}
}
}
}

Просмотреть файл

@ -39,7 +39,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.Cognitive.LUIS" Version="2.0.2" />
<PackageReference Include="Microsoft.Bot.Builder" Condition=" '$(PackageVersion)' == '' " Version="4.0.0-local" />
<PackageReference Include="Microsoft.Bot.Builder" Condition=" '$(PackageVersion)' != '' " Version="$(PackageVersion)" />
<PackageReference Include="Microsoft.Recognizers.Text" Version="1.0.0.35" />
<PackageReference Include="Microsoft.Recognizers.Text.DateTime" Version="1.0.0.35" />
</ItemGroup>
@ -47,6 +46,7 @@
<ItemGroup>
<ProjectReference Include="..\Microsoft.Bot.Builder.Core.Extensions\Microsoft.Bot.Builder.Core.Extensions.csproj" />
<ProjectReference Include="..\Microsoft.Bot.Builder.Core\Microsoft.Bot.Builder.Core.csproj" />
<ProjectReference Include="..\Microsoft.Bot.Builder\Microsoft.Bot.Builder.csproj" />
<ProjectReference Include="..\Microsoft.Bot.Schema\Microsoft.Bot.Schema.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -7,13 +7,11 @@ using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Middleware;
using Microsoft.Bot.Schema;
using Microsoft.Cognitive.LUIS;
namespace Microsoft.Bot.Builder.Ai
{
public class TranslationMiddleware : IReceiveActivity
public class TranslationMiddleware : IMiddleware
{
private readonly string[] nativeLanguages;
private Translator translator;
@ -69,7 +67,7 @@ namespace Microsoft.Bot.Builder.Ai
/// <param name="context"></param>
/// <param name="token"></param>
/// <returns></returns>
public async Task ReceiveActivity(IBotContext context, MiddlewareSet.NextDelegate next)
public async Task OnProcessRequest(IBotContext context, MiddlewareSet.NextDelegate next)
{
IMessageActivity message = context.Request.AsMessageActivity();
if (message != null)
@ -107,7 +105,7 @@ namespace Microsoft.Bot.Builder.Ai
SourceLanguage = sourceLanguage,
TargetLanguage = (this.nativeLanguages.Contains(sourceLanguage)) ? sourceLanguage : this.nativeLanguages.FirstOrDefault() ?? "en"
};
((BotContext)context)["Microsoft.API.Translation"] = translationContext;
((BotContext)context).Set("Microsoft.API.Translation", translationContext);
// translate to bots language
if (translationContext.SourceLanguage != translationContext.TargetLanguage)
@ -162,6 +160,5 @@ namespace Microsoft.Bot.Builder.Ai
message.Text = text;
}
}
}
}

Просмотреть файл

@ -52,7 +52,7 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Extensions.Configuration">
<Version>2.0.0</Version>
<Version>2.0.1</Version>
</PackageReference>
</ItemGroup>

Просмотреть файл

@ -40,12 +40,12 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.1" />
<PackageReference Include="Microsoft.Bot.Builder.Core" Condition=" '$(PackageVersion)' == '' " Version="4.0.0-local" />
<PackageReference Include="Microsoft.Bot.Builder.Core" Condition=" '$(PackageVersion)' != '' " Version="$(PackageVersion)" />
<PackageReference Include="Microsoft.Bot.Connector" Condition=" '$(PackageVersion)' == '' " Version="4.0.0-local" />
<PackageReference Include="Microsoft.Bot.Connector" Condition=" '$(PackageVersion)' != '' " Version="$(PackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.1" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>

Просмотреть файл

@ -19,8 +19,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.AdaptiveCards" Version="0.5.1" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
<PackageReference Include="Microsoft.Recognizers.Text.DateTime" Version="1.0.0.35" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
<PackageReference Include="Microsoft.Recognizers.Text.DateTime" Version="1.0.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>

Просмотреть файл

@ -3,15 +3,17 @@
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Adapters;
using Microsoft.Bot.Builder.Ai;
using Microsoft.Bot.Builder.BotFramework;
using Microsoft.Bot.Builder.Middleware;
using Microsoft.Bot.Builder.Storage;
using Microsoft.Bot.Builder.LUIS;
using Microsoft.Bot.Schema;
using Microsoft.Cognitive.LUIS;
using Microsoft.Extensions.Configuration;
namespace Microsoft.Bot.Samples.Ai.Luis.Translator
@ -36,36 +38,37 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Translator
public MessagesController(IConfiguration configuration)
{
var bot = new Builder.Bot(new BotFrameworkAdapter(configuration))
.Use(new BotStateManager(new FileStorage(System.IO.Path.GetTempPath()))) //store user state in a temp directory
.Use(new TranslationMiddleware(new string[] { "en" }, "xxxxxx", "templates", GetActiveLanguage, SetActiveLanguage))
.Use(new LocaleConverterMiddleware(GetActiveLocale, SetActiveLocale, "en-us", new LocaleConverter()))
// add QnA middleware
.Use(new LuisRecognizerMiddleware("xxxxxx", "xxxxxx"));
// LUIS with correct baseUri format example
//.Use(new LuisRecognizerMiddleware("xxxxxx", "xxxxxx", "https://xxxxxx.api.cognitive.microsoft.com/luis/v2.0/apps"))
bot.OnReceive(BotReceiveHandler);
if (_adapter == null)
{
var luisModel = new LuisModel("modelId", "subscriptionKey", new Uri("https://RegionOfYourLuisApp.api.cognitive.microsoft.com/luis/v2.0/apps/"));
var options = new LuisRequest { Verbose = true }; // If you want to get all intents scorings, add verbose in luisOptions
//LuisRequest options = null;
_adapter = (BotFrameworkAdapter)bot.Adapter;
_adapter = new BotFrameworkAdapter(new ConfigurationCredentialProvider(configuration))
.Use(new TranslationMiddleware(new string[] { "en" }, "xxxxxx", "templates", GetActiveLanguage, SetActiveLanguage))
.Use(new LocaleConverterMiddleware(GetActiveLocale, SetActiveLocale, "en-us", new LocaleConverter()))
.Use(new LuisRecognizerMiddleware(luisModel, luisOptions: options));
}
}
private Task BotReceiveHandler(IBotContext context)
{
if (context.Request.Type == ActivityTypes.Message)
{
if (context.Responses.Count > 0)
{
return Task.CompletedTask;
}
context.Reply($"the top intent was: {context.TopIntent.Name}");
var luisResult = context.Get<RecognizerResult>(LuisRecognizerMiddleware.LuisRecognizerResultKey);
foreach (var entity in context.TopIntent.Entities)
if (luisResult != null)
{
context.Reply($"entity: {entity.ValueAs<string>()}");
(string key, double score) topItem = luisResult.GetTopScoringIntent();
context.SendActivity($"The **top intent** was: **'{topItem.key}'**, with score **{topItem.score}**");
context.SendActivity($"Detail of intents scorings:");
var intentsResult = new List<string>();
foreach (var intent in luisResult.Intents)
{
intentsResult.Add($"* '{intent.Key}', score {intent.Value}");
}
context.SendActivity(string.Join("\n\n", intentsResult));
}
}
return Task.CompletedTask;
@ -76,7 +79,7 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Translator
{
try
{
await _adapter.Receive(this.Request.Headers["Authorization"].FirstOrDefault(), activity);
await _adapter.ProcessActivity(this.Request.Headers["Authorization"].FirstOrDefault(), activity, BotReceiveHandler);
return this.Ok();
}
catch (UnauthorizedAccessException)
@ -94,8 +97,8 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Translator
return new ObjectResult("Success!");
}
private void SetLanguage(IBotContext context, string language) => context.State.User[@"Microsoft.API.translateTo"] = language;
private void SetLocale(IBotContext context, string locale) => context.State.User[@"LocaleConverterMiddleware.fromLocale"] = locale;
private void SetLanguage(IBotContext context, string language) => context.Set(@"Microsoft.API.translateTo",language);
private void SetLocale(IBotContext context, string locale) => context.Set(@"LocaleConverterMiddleware.fromLocale",locale);
protected bool IsSupportedLanguage(string language) => _supportedLanguages.Contains(language);
protected async Task<bool> SetActiveLanguage(IBotContext context)
@ -114,11 +117,11 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Translator
&& IsSupportedLanguage(newLang))
{
SetLanguage(context, newLang);
context.Reply($@"Changing your language to {newLang}");
await context.SendActivity($@"Changing your language to {newLang}");
}
else
{
context.Reply($@"{newLang} is not a supported language.");
await context.SendActivity($@"{newLang} is not a supported language.");
}
//intercepts message
return true;
@ -131,15 +134,15 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Translator
if (currentLanguage != null)
{
//user has specified a different language so update the bot state
if (currentLanguage != (string)context.State.User[@"Microsoft.API.translateTo"])
if (context.Has(@"Microsoft.API.translateTo") && currentLanguage != (string)context.Get(@"Microsoft.API.translateTo") )
{
SetLanguage(context, currentLanguage);
}
}
if (context.Request.Type == ActivityTypes.Message
&& context.State.User.ContainsKey(@"Microsoft.API.translateTo"))
&& context.Has(@"Microsoft.API.translateTo"))
{
return (string)context.State.User[@"Microsoft.API.translateTo"];
return (string)context.Get(@"Microsoft.API.translateTo");
}
return "en";
@ -160,11 +163,11 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Translator
&& IsSupportedLanguage(newLocale))
{
SetLocale(context, newLocale);
context.Reply($@"Changing your language to {newLocale}");
await context.SendActivity($@"Changing your language to {newLocale}");
}
else
{
context.Reply($@"{newLocale} is not a supported locale.");
await context.SendActivity($@"{newLocale} is not a supported locale.");
}
//intercepts message
return true;
@ -177,15 +180,15 @@ namespace Microsoft.Bot.Samples.Ai.Luis.Translator
if (currentLocale != null)
{
//the user has specified a different locale so update the bot state
if (currentLocale != (string)context.State.User[@"LocaleConverterMiddleware.fromLocale"])
if (currentLocale != (string)context.Get(@"LocaleConverterMiddleware.fromLocale"))
{
SetLocale(context, currentLocale);
}
}
if (context.Request.Type == ActivityTypes.Message
&& context.State.User.ContainsKey(@"LocaleConverterMiddleware.fromLocale"))
&& context.Has(@"LocaleConverterMiddleware.fromLocale"))
{
return (string)context.State.User[@"LocaleConverterMiddleware.fromLocale"];
return (string)context.Get(@"LocaleConverterMiddleware.fromLocale");
}
return "en-us";

Просмотреть файл

@ -10,13 +10,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Builder.Ai\Microsoft.Bot.Builder.Ai.csproj" />
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Builder.BotFramework\Microsoft.Bot.Builder.BotFramework.csproj" />
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Builder.LUIS\Microsoft.Bot.Builder.LUIS.csproj" />
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Builder\Microsoft.Bot.Builder.csproj" />
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Schema\Microsoft.Bot.Schema.csproj" />
<ProjectReference Include="..\libraries\Microsoft.Bot.Builder.Ai\Microsoft.Bot.Builder.Ai.csproj" />
<ProjectReference Include="..\libraries\Microsoft.Bot.Builder.BotFramework\Microsoft.Bot.Builder.BotFramework.csproj" />
<ProjectReference Include="..\libraries\Microsoft.Bot.Builder\Microsoft.Bot.Builder.csproj" />
<ProjectReference Include="..\libraries\Microsoft.Bot.Schema\Microsoft.Bot.Schema.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="templates\fr.template">

Просмотреть файл

@ -11,7 +11,8 @@ using Microsoft.Bot.Builder.Ai;
using Microsoft.Bot.Builder.BotFramework;
using Microsoft.Bot.Schema;
using Microsoft.Extensions.Configuration;
using Microsoft.Bot.Builder.Storage;
using Microsoft.Bot.Builder.Adapters;
using Microsoft.Bot.Builder.Core.Extensions;
namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
{
@ -20,7 +21,7 @@ namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
{
private static readonly HttpClient _httpClient = new HttpClient();
BotFrameworkAdapter _adapter;
BotFrameworkAdapter adapter;
//supported langauges and locales
private static readonly string[] _supportedLanguages = new string[] { "en", "fr" };
@ -31,35 +32,29 @@ namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
public MessagesController(IConfiguration configuration)
{
var qnaMiddlewareOptions = new QnAMakerMiddlewareOptions
if (adapter == null)
{
// add subscription key and knowledge base id
SubscriptionKey = "xxxxxx",
KnowledgeBaseId = "xxxxxx"
};
var bot = new Builder.Bot(new BotFrameworkAdapter(configuration))
.Use(new BotStateManager(new FileStorage(System.IO.Path.GetTempPath()))) //store user state in a temp directory
.Use(new TranslationMiddleware(new string[] { "en" }, "xxxxxx", "templates", GetActiveLanguage, SetActiveLanguage))
.Use(new LocaleConverterMiddleware(GetActiveLocale, SetActiveLocale, "en-us", new LocaleConverter()))
//LocaleConverter and Translation middleware use default values for source language and from locale
// add QnA middleware
.Use(new QnAMakerMiddleware(qnaMiddlewareOptions, _httpClient));
bot.OnReceive(BotReceiveHandler);
_adapter = (BotFrameworkAdapter)bot.Adapter;
var qnaOptions = new QnAMakerMiddlewareOptions
{
// add subscription key and knowledge base id
SubscriptionKey = "xxxxxx",
KnowledgeBaseId = "xxxxxx"
};
adapter = new BotFrameworkAdapter(new ConfigurationCredentialProvider(configuration))
.Use(new BatchOutputMiddleware())
.Use(new TranslationMiddleware(new string[] { "en" }, "xxxxxx", "templates", GetActiveLanguage, SetActiveLanguage))
.Use(new LocaleConverterMiddleware(GetActiveLocale, SetActiveLocale, "en-us", new LocaleConverter()))
.Use(new QnAMakerMiddleware(qnaOptions, _httpClient));
}
}
private Task BotReceiveHandler(IBotContext context)
{
if (context.Request.Type == ActivityTypes.Message && context.Responses.Count == 0)
if (context.Request.Type == ActivityTypes.Message && context.Responded == false)
{
// add app logic when QnA Maker doesn't find an answer
context.Reply("No good match found in the KB.");
context.Batch().Reply("No good match found in the KB.");
}
//context.Reply(context.Request.AsMessageActivity().Text);
return Task.CompletedTask;
}
@ -68,7 +63,7 @@ namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
{
try
{
await _adapter.Receive(this.Request.Headers["Authorization"].FirstOrDefault(), activity);
await adapter.ProcessActivity(this.Request.Headers["Authorization"].FirstOrDefault(), activity, BotReceiveHandler);
return this.Ok();
}
catch (UnauthorizedAccessException)
@ -86,8 +81,8 @@ namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
return new ObjectResult("Success!");
}
private void SetLanguage(IBotContext context, string language) => context.State.User[@"Microsoft.API.translateTo"] = language;
private void SetLocale(IBotContext context, string locale) => context.State.User[@"LocaleConverterMiddleware.fromLocale"] = locale;
private void SetLanguage(IBotContext context, string language) => context.Set(@"Microsoft.API.translateTo", language);
private void SetLocale(IBotContext context, string locale) => context.Set(@"LocaleConverterMiddleware.fromLocale", locale);
protected bool IsSupportedLanguage(string language) => _supportedLanguages.Contains(language);
protected async Task<bool> SetActiveLanguage(IBotContext context)
@ -106,11 +101,11 @@ namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
&& IsSupportedLanguage(newLang))
{
SetLanguage(context, newLang);
context.Reply($@"Changing your language to {newLang}");
await context.SendActivity($@"Changing your language to {newLang}");
}
else
{
context.Reply($@"{newLang} is not a supported language.");
await context.SendActivity($@"{newLang} is not a supported language.");
}
//intercepts message
return true;
@ -123,15 +118,15 @@ namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
if (currentLanguage != null)
{
//user has specified a different language so update the bot state
if (currentLanguage != (string)context.State.User[@"Microsoft.API.translateTo"])
if (currentLanguage != (string)context.Get(@"Microsoft.API.translateTo"))
{
SetLanguage(context, currentLanguage);
}
}
if (context.Request.Type == ActivityTypes.Message
&& context.State.User.ContainsKey(@"Microsoft.API.translateTo"))
&& context.Has(@"Microsoft.API.translateTo"))
{
return (string)context.State.User[@"Microsoft.API.translateTo"];
return (string)context.Get(@"Microsoft.API.translateTo");
}
return "en";
@ -152,11 +147,11 @@ namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
&& IsSupportedLanguage(newLocale))
{
SetLocale(context, newLocale);
context.Reply($@"Changing your language to {newLocale}");
await context.SendActivity($@"Changing your language to {newLocale}");
}
else
{
context.Reply($@"{newLocale} is not a supported locale.");
await context.SendActivity($@"{newLocale} is not a supported locale.");
}
//intercepts message
return true;
@ -169,15 +164,15 @@ namespace Microsoft.Bot.Samples.Ai.QnA.Controllers
if (currentLocale != null)
{
//the user has specified a different locale so update the bot state
if (currentLocale != (string)context.State.User[@"LocaleConverterMiddleware.fromLocale"])
if (currentLocale != (string)context.Get(@"LocaleConverterMiddleware.fromLocale"))
{
SetLocale(context, currentLocale);
}
}
if (context.Request.Type == ActivityTypes.Message
&& context.State.User.ContainsKey(@"LocaleConverterMiddleware.fromLocale"))
&& context.Has(@"LocaleConverterMiddleware.fromLocale"))
{
return (string)context.State.User[@"LocaleConverterMiddleware.fromLocale"];
return (string)context.Get(@"LocaleConverterMiddleware.fromLocale");
}
return "en-us";

Просмотреть файл

@ -10,9 +10,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Builder.Ai\Microsoft.Bot.Builder.Ai.csproj" />
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Builder.BotFramework\Microsoft.Bot.Builder.BotFramework.csproj" />
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Builder\Microsoft.Bot.Builder.csproj" />
<ProjectReference Include="..\..\libraries\Microsoft.Bot.Schema\Microsoft.Bot.Schema.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="templates\fr.template">

Просмотреть файл

@ -82,9 +82,8 @@
<Private>True</Private>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Net.Http.Formatting, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.4\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Numerics" />
@ -93,9 +92,8 @@
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Web.Http, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.4\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />

Просмотреть файл

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autofac" version="4.6.2" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.Net.Compilers" version="1.2.1" targetFramework="net46" developmentDependency="true" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.2" targetFramework="net46" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.1" targetFramework="net46" />

Просмотреть файл

@ -2,14 +2,10 @@
// Licensed under the MIT License.
using Microsoft.Bot.Builder.Adapters;
using Microsoft.Bot.Builder.Tests;
using Microsoft.Bot.Builder.Core.Extensions;
using Microsoft.Bot.Schema;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Storage;
namespace Microsoft.Bot.Builder.Ai.Tests
{
@ -21,26 +17,24 @@ namespace Microsoft.Bot.Builder.Ai.Tests
[TestCategory("Locale Converter")]
public async Task LocaleConverterMiddleware_ConvertFromFrench()
{
TestAdapter adapter = new TestAdapter();
Bot bot = new Bot(adapter)
.Use(new BotStateManager(new FileStorage(System.IO.Path.GetTempPath()))) //store user state in a temp directory
.Use(new LocaleConverterMiddleware(GetActiveLocale, SetActiveLocale, "en-us", new LocaleConverter()));
TestAdapter adapter = new TestAdapter()
.Use(new BatchOutputMiddleware())
.Use(new LocaleConverterMiddleware(GetActiveLocale, SetActiveLocale, "en-us", new LocaleConverter()));
bot.OnReceive((context) =>
await new TestFlow(adapter, (context) =>
{
if (context.Responses.Count == 0)
if (context.Request.AsMessageActivity().Text == "foo")
{
context.Reply(context.Request.AsMessageActivity().Text);
context.Batch().Reply(context.Request.AsMessageActivity().Text);
}
return Task.CompletedTask;
});
await adapter
})
.Send("set my locale to fr-fr")
.AssertReply("Changing your locale to fr-fr")
.Send("Set a meeting on 30/9/2017")
.AssertReply("Set a meeting on 09/30/2017")
.StartTest();
.StartTest();
}
[TestMethod]
@ -48,21 +42,19 @@ namespace Microsoft.Bot.Builder.Ai.Tests
[TestCategory("Locale Converter")]
public async Task LocaleConverterMiddleware_ConvertToChinese()
{
TestAdapter adapter = new TestAdapter();
Bot bot = new Bot(adapter)
.Use(new BotStateManager(new FileStorage(System.IO.Path.GetTempPath()))) //store user state in a temp directory
.Use(new LocaleConverterMiddleware(GetActiveLocale, SetActiveLocale, "zh-cn", new LocaleConverter()));
TestAdapter adapter = new TestAdapter()
.Use(new BatchOutputMiddleware())
.Use(new LocaleConverterMiddleware(GetActiveLocale, SetActiveLocale, "zh-cn", new LocaleConverter()));
bot.OnReceive((context) =>
await new TestFlow(adapter, (context) =>
{
if (context.Responses.Count == 0)
if (context.Request.AsMessageActivity().Text == "foo")
{
context.Reply(context.Request.AsMessageActivity().Text);
context.Batch().Reply(context.Request.AsMessageActivity().Text);
}
return Task.CompletedTask;
});
await adapter
})
.Send("set my locale to en-us")
.AssertReply("Changing your locale to en-us")
.Send("Book me a plane ticket for France on 12/25/2018")
@ -70,7 +62,7 @@ namespace Microsoft.Bot.Builder.Ai.Tests
.StartTest();
}
private void SetLocale(IBotContext context, string locale) => context.State.User[@"LocaleConverterMiddleware.fromLocale"] = locale;
private void SetLocale(IBotContext context, string locale) => context.Set(@"LocaleConverterMiddleware.fromLocale",locale);
protected async Task<bool> SetActiveLocale(IBotContext context)
{
@ -87,11 +79,11 @@ namespace Microsoft.Bot.Builder.Ai.Tests
if (!string.IsNullOrWhiteSpace(newLocale))
{
SetLocale(context, newLocale);
context.Reply($@"Changing your locale to {newLocale}");
await context.SendActivity($@"Changing your locale to {newLocale}");
}
else
{
context.Reply($@"{newLocale} is not a supported locale.");
await context.SendActivity($@"{newLocale} is not a supported locale.");
}
//intercepts message
return true;
@ -102,9 +94,9 @@ namespace Microsoft.Bot.Builder.Ai.Tests
protected string GetActiveLocale(IBotContext context)
{
if (context.Request.Type == ActivityTypes.Message
&& context.State.User.ContainsKey(@"LocaleConverterMiddleware.fromLocale"))
&& context.Has(@"LocaleConverterMiddleware.fromLocale"))
{
return (string)context.State.User[@"LocaleConverterMiddleware.fromLocale"];
return (string)context.Get(@"LocaleConverterMiddleware.fromLocale");
}
return "en-us";

Просмотреть файл

@ -1,15 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.Bot.Builder.Adapters;
using Microsoft.Bot.Builder.Tests;
using Microsoft.Bot.Schema;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Storage;
namespace Microsoft.Bot.Builder.Ai.Tests
{

Просмотреть файл

@ -2,13 +2,10 @@
// Licensed under the MIT License.
using Microsoft.Bot.Builder.Adapters;
using Microsoft.Bot.Builder.Storage;
using Microsoft.Bot.Builder.Tests;
using Microsoft.Bot.Builder.Core.Extensions;
using Microsoft.Bot.Builder.Core.Extensions.Tests;
using Microsoft.Bot.Schema;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Bot.Builder.Ai.Tests
@ -23,26 +20,23 @@ namespace Microsoft.Bot.Builder.Ai.Tests
[TestCategory("Translator")]
public async Task TranslatorMiddleware_DetectAndTranslateToEnglish()
{
TestAdapter adapter = new TestAdapter()
.Use(new BatchOutputMiddleware())
.Use(new TranslationMiddleware(new string[] { "en-us" }, translatorKey));
TestAdapter adapter = new TestAdapter();
Bot bot = new Bot(adapter)
.Use(new BotStateManager(new FileStorage(System.IO.Path.GetTempPath()))) //store user state in a temp directory
.Use(new TranslationMiddleware(new string[] { "en-us" }, translatorKey));
bot.OnReceive((context) =>
await new TestFlow(adapter, (context) =>
{
if (context.Responses.Count == 0)
if (context.Request.AsMessageActivity().Text == "foo")
{
context.Reply(context.Request.AsMessageActivity().Text);
context.Batch().Reply(context.Request.AsMessageActivity().Text);
}
return Task.CompletedTask;
});
await adapter
.Send("salut")
.AssertReply("Hello")
.Send("salut 10-20")
.AssertReply("Hi 10-20")
})
.Send("salut")
.AssertReply("Hello")
.Send("salut 10-20")
.AssertReply("Hi 10-20")
.StartTest();
}
@ -52,29 +46,26 @@ namespace Microsoft.Bot.Builder.Ai.Tests
public async Task TranslatorMiddleware_TranslateFrenchToEnglish()
{
TestAdapter adapter = new TestAdapter();
Bot bot = new Bot(adapter)
.Use(new BotStateManager(new FileStorage(System.IO.Path.GetTempPath()))) //store user state in a temp directory
TestAdapter adapter = new TestAdapter()
.Use(new BatchOutputMiddleware())
.Use(new TranslationMiddleware(new string[] { "en-us" }, translatorKey, "", GetActiveLanguage, SetActiveLanguage));
bot.OnReceive((context) =>
await new TestFlow(adapter, (context) =>
{
if (context.Responses.Count == 0)
if (context.Request.AsMessageActivity().Text == "foo")
{
context.Reply(context.Request.AsMessageActivity().Text);
context.Batch().Reply(context.Request.AsMessageActivity().Text);
}
return Task.CompletedTask;
});
await adapter
.Send("set my language to fr")
.AssertReply("Changing your language to fr")
.Send("salut")
.AssertReply("Hello")
})
.Send("set my language to fr")
.AssertReply("Changing your language to fr")
.Send("salut")
.AssertReply("Hello")
.StartTest();
}
private void SetLanguage(IBotContext context, string language) => context.State.User[@"Microsoft.API.translateTo"] = language;
private void SetLanguage(IBotContext context, string language) => context.Set(@"Microsoft.API.translateTo",language);
protected async Task<bool> SetActiveLanguage(IBotContext context)
{
@ -91,11 +82,11 @@ namespace Microsoft.Bot.Builder.Ai.Tests
if (!string.IsNullOrWhiteSpace(newLang))
{
SetLanguage(context, newLang);
context.Reply($@"Changing your language to {newLang}");
await context.SendActivity($@"Changing your language to {newLang}");
}
else
{
context.Reply($@"{newLang} is not a supported language.");
await context.SendActivity($@"{newLang} is not a supported language.");
}
//intercepts message
return true;
@ -106,9 +97,9 @@ namespace Microsoft.Bot.Builder.Ai.Tests
protected string GetActiveLanguage(IBotContext context)
{
if (context.Request.Type == ActivityTypes.Message
&& context.State.User.ContainsKey(@"Microsoft.API.translateTo"))
&& context.Has(@"Microsoft.API.translateTo"))
{
return (string)context.State.User[@"Microsoft.API.translateTo"];
return (string)context.Get(@"Microsoft.API.translateTo");
}
return "en";

Просмотреть файл

@ -1,14 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.Bot.Builder.Adapters;
using Microsoft.Bot.Builder.Storage;
using Microsoft.Bot.Builder.Tests;
using Microsoft.Bot.Schema;
using Microsoft.Bot.Builder.Core.Extensions.Tests;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using System;
using System.Threading.Tasks;
namespace Microsoft.Bot.Builder.Ai.Tests