Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public MainResponses()

public static IMessageActivity BuildIntroCard(ITurnContext turnContext, dynamic data)
{
var introCard = File.ReadAllText(@".\Dialogs\Main\Resources\Intro.json");
var introCard = File.ReadAllText(MainStrings.INTRO_PATH);
var card = AdaptiveCard.FromJson(introCard).Card;
var attachment = new Attachment(AdaptiveCard.ContentType, content: card);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
Expand All @@ -23,7 +23,7 @@
"type": "TextBlock",
"size": "default",
"isSubtle": true,
"text": "Nun, da Sie Ihren virtuellen Assistenten erfolgreich gef�hrt haben, folgen Sie den Links in dieser adaptiven Karte, um weiter zu erforschen.",
"text": "Nun, da Sie Ihren virtuellen Assistenten erfolgreich geführt haben, folgen Sie den Links in dieser adaptiven Karte, um weiter zu erforschen.",
"speak": "Jetzt, wo Sie loslegen lassen.",
"wrap": true,
"maxLines": 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"speak": " Bienvenido a tu asistente virtual! Ahora que est�s en marcha, empecemos.",
"speak": "¡ Bienvenido a tu asistente virtual! Ahora que estás en marcha, empecemos.",
"body": [
{
"type": "Image",
Expand All @@ -23,7 +23,7 @@
"type": "TextBlock",
"size": "default",
"isSubtle": true,
"text": "Ahora que ha ejecutado correctamente su asistente virtual, siga los enlaces de esta tarjeta adaptativa para explorar m�s.",
"text": "Ahora que ha ejecutado correctamente su asistente virtual, siga los enlaces de esta tarjeta adaptativa para explorar más.",
"speak": "Ahora que su funcionamiento vamos a empezar.",
"wrap": true,
"maxLines": 0
Expand All @@ -32,7 +32,7 @@
"actions": [
{
"type": "Action.OpenUrl",
"title": "Documentaci�n",
"title": "Documentación",
"url": "https://aka.ms/customassistantdocs"
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"speak": "Bienvenue votre assistant virtuel! Maintenant que vous �tes en marche, commen�ons.",
"speak": "Bienvenue à votre assistant virtuel! Maintenant que vous êtes en marche, commençons.",
"body": [
{
"type": "Image",
Expand All @@ -14,17 +14,17 @@
"spacing": "medium",
"size": "default",
"weight": "bolder",
"text": "Bienvenue votre assistant virtuel",
"speak": "Bienvenue votre assistant virtuel",
"text": "Bienvenue à votre assistant virtuel",
"speak": "Bienvenue à votre assistant virtuel",
"wrap": true,
"maxLines": 0
},
{
"type": "TextBlock",
"size": "default",
"isSubtle": true,
"text": "Maintenant que vous avez r�ussi � ex�cuter votre assistant virtuel, suivez les liens dans cette carte adaptative pour explorer plus loin.",
"speak": "Maintenant que votre place et en cours d'ex�cution nous allons commencer.",
"text": "Maintenant que vous avez réussi à exécuter votre assistant virtuel, suivez les liens dans cette carte adaptative pour explorer plus loin.",
"speak": "Maintenant que votre place et en cours d'exécution nous allons commencer.",
"wrap": true,
"maxLines": 0
}
Expand All @@ -37,7 +37,7 @@
},
{
"type": "Action.OpenUrl",
"title": "Comptes li�s",
"title": "Comptes liés",
"url": "https://github.com/Microsoft/AI/blob/master/solutions/Virtual-Assistant/docs/virtualassistant-linkedaccounts.md"
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<data name="Intro" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Intro.de.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="INTRO_PATH" xml:space="preserve">
<value>.\Dialogs\Main\Resources\Intro.de.json</value>
</data>
<data name="LOGOUT" xml:space="preserve">
<value>OK, du bist abgemeldet.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<data name="Intro" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Intro.es.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="INTRO_PATH" xml:space="preserve">
<value>.\Dialogs\Main\Resources\Intro.es.json</value>
</data>
<data name="LOGOUT" xml:space="preserve">
<value>OK, estás desconectado.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<data name="Intro" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Intro.fr.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="INTRO_PATH" xml:space="preserve">
<value>.\Dialogs\Main\Resources\Intro.fr.json</value>
</data>
<data name="LOGOUT" xml:space="preserve">
<value>OK, vous êtes déconnecté.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<data name="Intro" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Intro.it.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="INTRO_PATH" xml:space="preserve">
<value>.\Dialogs\Main\Resources\Intro.it.json</value>
</data>
<data name="LOGOUT" xml:space="preserve">
<value>OK, sei uscito.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<data name="Intro" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Intro.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="INTRO_PATH" xml:space="preserve">
<value>.\Dialogs\Main\Resources\Intro.json</value>
</data>
<data name="LOGOUT" xml:space="preserve">
<value>Ok, you're signed out.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<data name="Intro" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Intro.zh.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="INTRO_PATH" xml:space="preserve">
<value>.\Dialogs\Main\Resources\Intro.zh.json</value>
</data>
<data name="LOGOUT" xml:space="preserve">
<value>你已成功退出。</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ public TestFlow GetTestFlow()

public override IBot BuildBot()
{
return new ToDoSkill.ToDoSkill(this.Services, this.ConversationState, this.UserState, this.TelemetryClient, this.ToDoService, this.MailService, true);
var skill = new ToDoSkill.ToDoSkill(this.Services, this.ConversationState, this.UserState, this.TelemetryClient, this.ToDoService, true);
skill.MailService = MailService;

return skill;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ public class ToDoSkill : IBot
private readonly UserState _userState;
private readonly IBotTelemetryClient _telemetryClient;
private ITaskService _serviceManager;
private IMailService _mailService;
private DialogSet _dialogs;
private bool _skillMode;

public ToDoSkill(ISkillConfiguration services, ConversationState conversationState, UserState userState, IBotTelemetryClient telemetryClient, ITaskService serviceManager = null, IMailService mailService = null, bool skillMode = false)
public ToDoSkill(ISkillConfiguration services, ConversationState conversationState, UserState userState, IBotTelemetryClient telemetryClient, ITaskService serviceManager = null, bool skillMode = false)
{
_skillMode = skillMode;
_services = services ?? throw new ArgumentNullException(nameof(services));
Expand All @@ -43,12 +42,14 @@ public ToDoSkill(ISkillConfiguration services, ConversationState conversationSta
}

_serviceManager = serviceManager ?? taskService;
_mailService = mailService ?? new MailService();
MailService = new MailService();

_dialogs = new DialogSet(_conversationState.CreateProperty<DialogState>(nameof(DialogState)));
_dialogs.Add(new MainDialog(_services, _conversationState, _userState, _telemetryClient, _serviceManager, _mailService, _skillMode));
}

// TODO: this property was added to allow the to do tests to work correctly. It should be reevaluated.
public IMailService MailService { get; set; }

/// <summary>
/// Run every turn of the conversation. Handles orchestration of messages.
/// </summary>
Expand All @@ -57,6 +58,11 @@ public ToDoSkill(ISkillConfiguration services, ConversationState conversationSta
/// <returns>A <see cref="TaskItem"/> representing the asynchronous operation.</returns>
public async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken)
{
if (_dialogs.Find(nameof(MainDialog)) == null)
{
_dialogs.Add(new MainDialog(_services, _conversationState, _userState, _telemetryClient, _serviceManager, MailService, _skillMode));
}

var dc = await _dialogs.CreateContextAsync(turnContext);

if (dc.ActiveDialog != null)
Expand Down