This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable websocket for skills by referencing the latest skills package (#…
- Loading branch information
Showing
35 changed files
with
380 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...src/csharp/automotiveskill/automotiveskill/Adapters/AutomotiveSkillWebSocketBotAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Globalization; | ||
using AutomotiveSkill.Responses.Shared; | ||
using AutomotiveSkill.Services; | ||
using Microsoft.Bot.Builder; | ||
using Microsoft.Bot.Builder.Azure; | ||
using Microsoft.Bot.Builder.Dialogs; | ||
using Microsoft.Bot.Builder.Skills; | ||
using Microsoft.Bot.Builder.Solutions.Middleware; | ||
using Microsoft.Bot.Builder.Solutions.Responses; | ||
using Microsoft.Bot.Builder.Solutions.Telemetry; | ||
using Microsoft.Bot.Schema; | ||
|
||
namespace AutomotiveSkill.Adapters | ||
{ | ||
public class AutomotiveSkillWebSocketBotAdapter : SkillWebSocketBotAdapter | ||
{ | ||
public AutomotiveSkillWebSocketBotAdapter( | ||
BotSettings settings, | ||
UserState userState, | ||
ConversationState conversationState, | ||
BotStateSet botStateSet, | ||
ResponseManager responseManager, | ||
IBotTelemetryClient telemetryClient) | ||
{ | ||
OnTurnError = async (context, exception) => | ||
{ | ||
CultureInfo.CurrentUICulture = new CultureInfo(context.Activity.Locale); | ||
await context.SendActivityAsync(responseManager.GetResponse(AutomotiveSkillSharedResponses.ErrorMessage)); | ||
await context.SendActivityAsync(new Activity(type: ActivityTypes.Trace, text: $"Automotive Skill Error: {exception.Message} | {exception.StackTrace}")); | ||
telemetryClient.TrackExceptionEx(exception, context.Activity); | ||
}; | ||
|
||
Use(new TranscriptLoggerMiddleware(new AzureBlobTranscriptStore(settings.BlobStorage.ConnectionString, settings.BlobStorage.Container))); | ||
Use(new TelemetryLoggerMiddleware(telemetryClient, logPersonalInformation: true)); | ||
Use(new ShowTypingMiddleware()); | ||
Use(new SetLocaleMiddleware(settings.DefaultLocale ?? "en-us")); | ||
Use(new EventDebuggerMiddleware()); | ||
Use(new AutoSaveStateMiddleware(botStateSet)); | ||
Use(new SkillMiddleware(userState, conversationState, conversationState.CreateProperty<DialogState>(nameof(AutomotiveSkill)))); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
skills/src/csharp/automotiveskill/automotiveskill/SkillWhitelist.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
skills/src/csharp/calendarskill/calendarskill/Adapters/CalendarSkillWebSocketBotAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Globalization; | ||
using CalendarSkill.Responses.Shared; | ||
using CalendarSkill.Services; | ||
using Microsoft.Bot.Builder; | ||
using Microsoft.Bot.Builder.Azure; | ||
using Microsoft.Bot.Builder.Dialogs; | ||
using Microsoft.Bot.Builder.Skills; | ||
using Microsoft.Bot.Builder.Solutions.Middleware; | ||
using Microsoft.Bot.Builder.Solutions.Responses; | ||
using Microsoft.Bot.Builder.Solutions.Telemetry; | ||
using Microsoft.Bot.Schema; | ||
|
||
namespace CalendarSkill.Adapters | ||
{ | ||
public class CalendarSkillWebSocketBotAdapter : SkillWebSocketBotAdapter | ||
{ | ||
public CalendarSkillWebSocketBotAdapter( | ||
BotSettings settings, | ||
UserState userState, | ||
ConversationState conversationState, | ||
BotStateSet botStateSet, | ||
ResponseManager responseManager, | ||
IBotTelemetryClient telemetryClient) | ||
{ | ||
OnTurnError = async (context, exception) => | ||
{ | ||
CultureInfo.CurrentUICulture = new CultureInfo(context.Activity.Locale); | ||
await context.SendActivityAsync(responseManager.GetResponse(CalendarSharedResponses.CalendarErrorMessage)); | ||
await context.SendActivityAsync(new Activity(type: ActivityTypes.Trace, text: $"Calendar Skill Error: {exception.Message} | {exception.StackTrace}")); | ||
telemetryClient.TrackExceptionEx(exception, context.Activity); | ||
}; | ||
|
||
Use(new TranscriptLoggerMiddleware(new AzureBlobTranscriptStore(settings.BlobStorage.ConnectionString, settings.BlobStorage.Container))); | ||
Use(new TelemetryLoggerMiddleware(telemetryClient, logPersonalInformation: true)); | ||
Use(new ShowTypingMiddleware()); | ||
Use(new SetLocaleMiddleware(settings.DefaultLocale ?? "en-us")); | ||
Use(new EventDebuggerMiddleware()); | ||
Use(new AutoSaveStateMiddleware(botStateSet)); | ||
Use(new SkillMiddleware(userState, conversationState, conversationState.CreateProperty<DialogState>(nameof(CalendarSkill)))); | ||
} | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
skills/src/csharp/calendarskill/calendarskill/SkillWhitelist.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
skills/src/csharp/emailskill/emailskill/Adapters/EmailSkillWebSocketBotAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Globalization; | ||
using EmailSkill.Responses.Shared; | ||
using EmailSkill.Services; | ||
using Microsoft.Bot.Builder; | ||
using Microsoft.Bot.Builder.Azure; | ||
using Microsoft.Bot.Builder.Dialogs; | ||
using Microsoft.Bot.Builder.Skills; | ||
using Microsoft.Bot.Builder.Solutions.Middleware; | ||
using Microsoft.Bot.Builder.Solutions.Responses; | ||
using Microsoft.Bot.Builder.Solutions.Telemetry; | ||
using Microsoft.Bot.Schema; | ||
|
||
namespace EmailSkill.Adapters | ||
{ | ||
public class EmailSkillWebSocketBotAdapter : SkillWebSocketBotAdapter | ||
{ | ||
public EmailSkillWebSocketBotAdapter( | ||
BotSettings settings, | ||
UserState userState, | ||
ConversationState conversationState, | ||
BotStateSet botStateSet, | ||
ResponseManager responseManager, | ||
IBotTelemetryClient telemetryClient) | ||
{ | ||
OnTurnError = async (context, exception) => | ||
{ | ||
CultureInfo.CurrentUICulture = new CultureInfo(context.Activity.Locale); | ||
await context.SendActivityAsync(responseManager.GetResponse(EmailSharedResponses.EmailErrorMessage)); | ||
await context.SendActivityAsync(new Activity(type: ActivityTypes.Trace, text: $"Email Skill Error: {exception.Message} | {exception.StackTrace}")); | ||
telemetryClient.TrackExceptionEx(exception, context.Activity); | ||
}; | ||
|
||
Use(new TranscriptLoggerMiddleware(new AzureBlobTranscriptStore(settings.BlobStorage.ConnectionString, settings.BlobStorage.Container))); | ||
Use(new TelemetryLoggerMiddleware(telemetryClient, logPersonalInformation: true)); | ||
Use(new ShowTypingMiddleware()); | ||
Use(new SetLocaleMiddleware(settings.DefaultLocale ?? "en-us")); | ||
Use(new EventDebuggerMiddleware()); | ||
Use(new AutoSaveStateMiddleware(botStateSet)); | ||
Use(new SkillMiddleware(userState, conversationState, conversationState.CreateProperty<DialogState>(nameof(EmailSkill)))); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.