Extract launch decisions into partial
This commit is contained in:
@@ -0,0 +1,90 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Jibo.Cloud.Domain.Models;
|
||||||
|
|
||||||
|
namespace Jibo.Cloud.Application.Services;
|
||||||
|
|
||||||
|
public sealed partial class JiboInteractionService
|
||||||
|
{
|
||||||
|
private static JiboInteractionDecision BuildWordOfTheDayLaunchDecision()
|
||||||
|
{
|
||||||
|
return new JiboInteractionDecision(
|
||||||
|
"word_of_the_day",
|
||||||
|
"Starting word of the day.",
|
||||||
|
"@be/word-of-the-day",
|
||||||
|
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
||||||
|
{
|
||||||
|
["domain"] = "word-of-the-day",
|
||||||
|
["skillId"] = "@be/word-of-the-day"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static JiboInteractionDecision BuildRadioLaunchDecision()
|
||||||
|
{
|
||||||
|
return new JiboInteractionDecision(
|
||||||
|
"radio",
|
||||||
|
"Opening the radio.",
|
||||||
|
"@be/radio",
|
||||||
|
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
||||||
|
{
|
||||||
|
["skillId"] = "@be/radio"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static JiboInteractionDecision BuildPhotoGalleryLaunchDecision()
|
||||||
|
{
|
||||||
|
return new JiboInteractionDecision(
|
||||||
|
"photo_gallery",
|
||||||
|
"Opening the photo gallery.",
|
||||||
|
"@be/gallery",
|
||||||
|
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
||||||
|
{
|
||||||
|
["skillId"] = "@be/gallery",
|
||||||
|
["localIntent"] = "menu"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static JiboInteractionDecision BuildPhotoCreateDecision(string intentName, string replyText,
|
||||||
|
string localIntent)
|
||||||
|
{
|
||||||
|
return new JiboInteractionDecision(
|
||||||
|
intentName,
|
||||||
|
replyText,
|
||||||
|
"@be/create",
|
||||||
|
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
||||||
|
{
|
||||||
|
["skillId"] = "@be/create",
|
||||||
|
["localIntent"] = localIntent
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static JiboInteractionDecision BuildStopDecision()
|
||||||
|
{
|
||||||
|
return new JiboInteractionDecision(
|
||||||
|
"stop",
|
||||||
|
"Stopping.",
|
||||||
|
"@be/idle",
|
||||||
|
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
||||||
|
{
|
||||||
|
["skillId"] = "@be/idle",
|
||||||
|
["globalIntent"] = "stop",
|
||||||
|
["nluDomain"] = "global_commands"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static JiboInteractionDecision BuildIdleGlobalCommandDecision(
|
||||||
|
string intentName,
|
||||||
|
string globalIntent,
|
||||||
|
string replyText)
|
||||||
|
{
|
||||||
|
return new JiboInteractionDecision(
|
||||||
|
intentName,
|
||||||
|
replyText,
|
||||||
|
"@be/idle",
|
||||||
|
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
||||||
|
{
|
||||||
|
["skillId"] = "@be/idle",
|
||||||
|
["globalIntent"] = globalIntent,
|
||||||
|
["nluDomain"] = "global_commands"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -916,87 +916,4 @@ public sealed partial class JiboInteractionService(
|
|||||||
isTimerValueTurn,
|
isTimerValueTurn,
|
||||||
isAlarmValueTurn);
|
isAlarmValueTurn);
|
||||||
}
|
}
|
||||||
private static JiboInteractionDecision BuildWordOfTheDayLaunchDecision()
|
|
||||||
{
|
|
||||||
return new JiboInteractionDecision(
|
|
||||||
"word_of_the_day",
|
|
||||||
"Starting word of the day.",
|
|
||||||
"@be/word-of-the-day",
|
|
||||||
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
["domain"] = "word-of-the-day",
|
|
||||||
["skillId"] = "@be/word-of-the-day"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static JiboInteractionDecision BuildRadioLaunchDecision()
|
|
||||||
{
|
|
||||||
return new JiboInteractionDecision(
|
|
||||||
"radio",
|
|
||||||
"Opening the radio.",
|
|
||||||
"@be/radio",
|
|
||||||
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
["skillId"] = "@be/radio"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static JiboInteractionDecision BuildPhotoGalleryLaunchDecision()
|
|
||||||
{
|
|
||||||
return new JiboInteractionDecision(
|
|
||||||
"photo_gallery",
|
|
||||||
"Opening the photo gallery.",
|
|
||||||
"@be/gallery",
|
|
||||||
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
["skillId"] = "@be/gallery",
|
|
||||||
["localIntent"] = "menu"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static JiboInteractionDecision BuildPhotoCreateDecision(string intentName, string replyText,
|
|
||||||
string localIntent)
|
|
||||||
{
|
|
||||||
return new JiboInteractionDecision(
|
|
||||||
intentName,
|
|
||||||
replyText,
|
|
||||||
"@be/create",
|
|
||||||
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
["skillId"] = "@be/create",
|
|
||||||
["localIntent"] = localIntent
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static JiboInteractionDecision BuildStopDecision()
|
|
||||||
{
|
|
||||||
return new JiboInteractionDecision(
|
|
||||||
"stop",
|
|
||||||
"Stopping.",
|
|
||||||
"@be/idle",
|
|
||||||
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
["skillId"] = "@be/idle",
|
|
||||||
["globalIntent"] = "stop",
|
|
||||||
["nluDomain"] = "global_commands"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static JiboInteractionDecision BuildIdleGlobalCommandDecision(
|
|
||||||
string intentName,
|
|
||||||
string globalIntent,
|
|
||||||
string replyText)
|
|
||||||
{
|
|
||||||
return new JiboInteractionDecision(
|
|
||||||
intentName,
|
|
||||||
replyText,
|
|
||||||
"@be/idle",
|
|
||||||
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
["skillId"] = "@be/idle",
|
|
||||||
["globalIntent"] = globalIntent,
|
|
||||||
["nluDomain"] = "global_commands"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user