From e85792ac57bcc4e640d7aea89345cf5f62c8ac14 Mon Sep 17 00:00:00 2001 From: Jacob Dubin Date: Thu, 21 May 2026 11:22:20 -0500 Subject: [PATCH] Add source-backed singing personality responses --- OpenJibo/docs/feature-backlog.md | 5 +- OpenJibo/docs/release-1.0.19-plan.md | 1 + .../IJiboExperienceContentRepository.cs | 4 +- .../JiboInteractionService.IntentRouting.cs | 27 ++++++ ...InteractionService.PersonalityDecisions.cs | 22 +++++ .../Services/JiboInteractionService.cs | 12 +++ ...InMemoryJiboExperienceContentRepository.cs | 15 +++- .../Content/LegacyMimCatalogImporter.cs | 22 ++++- .../Content/LegacyMims/BuildB/README.md | 1 + .../BuildB/scripted-responses/RA_JBO_Sing.mim | 85 +++---------------- .../RA_JBO_SingChristmasSongUnknown.mim | 4 +- .../Content/LegacyMimCatalogImporterTests.cs | 24 +++++- .../WebSockets/JiboInteractionServiceTests.cs | 3 + 13 files changed, 142 insertions(+), 83 deletions(-) diff --git a/OpenJibo/docs/feature-backlog.md b/OpenJibo/docs/feature-backlog.md index 78f3f18..7e3f80b 100644 --- a/OpenJibo/docs/feature-backlog.md +++ b/OpenJibo/docs/feature-backlog.md @@ -515,7 +515,7 @@ Current release theme: ### 12. Weather As Cloud Report Plus Local Presentation -- Status: `discovery` +- Status: `implemented` - Tags: `protocol`, `content` - Evidence: - Nimbus and Pegasus contain personal-report weather assets and Lasso provider hooks @@ -926,11 +926,12 @@ Current release theme: - the first pass should stay familiar and rule-based, not LLM-driven - Scope: - inventory the legacy song / sing / musical prompt families - - decide whether the first slice should be short song replies, a sing-along launcher, or both - keep the first implementation source-backed if Pegasus has usable authored lines + - preserve room for a later sing-along launcher if we want one - Exit criteria: - a small song backlog exists with candidate phrases listed - the release plan has a clear place for musical personality without crowding out weather/news/report work + - the current source-backed singing slice is implemented and test-covered ## Suggested Order diff --git a/OpenJibo/docs/release-1.0.19-plan.md b/OpenJibo/docs/release-1.0.19-plan.md index 8490d1e..8bf9ef2 100644 --- a/OpenJibo/docs/release-1.0.19-plan.md +++ b/OpenJibo/docs/release-1.0.19-plan.md @@ -42,6 +42,7 @@ Current batch note: - `favorite color`, `favorite food`, and `favorite music` are the first small favorites-family slice - the latest pass adds longer authored variants for those favorites so the replies keep more of the original Pegasus cadence instead of collapsing to short placeholders +- singing and musical personality now has a source-backed first slice with `can you sing`, `will you sing`, and holiday sing variants so the charm surface can keep growing without inventing a new dialog engine - the next source-backed batch now includes `favorite flower`, `R2D2`, `sun`, `space`, `kids`, plus a couple of charm prompts like `can you laugh` and `can you dance` - the motion/sleep batch now adds `RI_JBO_CanSleep` and `RA_JBO_SpinAround` so the `go to sleep` and `turn around` surfaces stay source-backed too - the follow-up mood batch now includes `how are things`, `how is your day`, `are you sad`, and `are you angry` diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Abstractions/IJiboExperienceContentRepository.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Abstractions/IJiboExperienceContentRepository.cs index f310817..42bed18 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Abstractions/IJiboExperienceContentRepository.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Abstractions/IJiboExperienceContentRepository.cs @@ -18,6 +18,8 @@ public sealed class JiboExperienceCatalog public IReadOnlyList HumanFacts { get; init; } = []; public IReadOnlyList FunFacts { get; init; } = []; public IReadOnlyList FavoriteAnimalReplies { get; init; } = []; + public IReadOnlyList SingReplies { get; init; } = []; + public IReadOnlyList HolidaySingReplies { get; init; } = []; public IReadOnlyList DanceAnimations { get; init; } = []; public IReadOnlyList GreetingReplies { get; init; } = []; public IReadOnlyList HolidayReplies { get; init; } = []; @@ -70,4 +72,4 @@ public sealed class JiboExperienceCatalog public IReadOnlyList GenericFallbackReplies { get; init; } = []; public IReadOnlyList DanceReplies { get; init; } = []; public IReadOnlyList DanceQuestionReplies { get; init; } = []; -} \ No newline at end of file +} diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.IntentRouting.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.IntentRouting.cs index 49ab764..38e0df7 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.IntentRouting.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.IntentRouting.cs @@ -292,6 +292,33 @@ public sealed partial class JiboInteractionService if (MatchesAny(loweredTranscript, "can you dance", "do you dance", "are you able to dance")) return "robot_can_dance"; + if (MatchesAny( + loweredTranscript, + "can you sing a christmas song", + "can you sing christmas song", + "will you sing a christmas song", + "will you sing christmas song", + "sing a christmas song", + "sing christmas song", + "can you sing a holiday song", + "can you sing holiday song", + "will you sing a holiday song", + "will you sing holiday song", + "sing a holiday song", + "sing holiday song")) + return "robot_sing_christmas_song"; + + if (MatchesAny( + loweredTranscript, + "can you sing", + "will you sing", + "sing a song", + "sing me a song", + "can you sing a song", + "sing something", + "would you sing")) + return "robot_can_sing"; + if (MatchesAny(loweredTranscript, "twerk")) return "twerk"; if (MatchesAny(loweredTranscript, "dance", "boogie")) return "dance"; diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.PersonalityDecisions.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.PersonalityDecisions.cs index 0418c09..f4478ed 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.PersonalityDecisions.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.PersonalityDecisions.cs @@ -322,6 +322,28 @@ public sealed partial class JiboInteractionService preferredSnippets); } + private JiboInteractionDecision BuildScriptedSingDecision( + JiboExperienceCatalog catalog, + string intentName, + params string[] preferredSnippets) + { + return new JiboInteractionDecision( + intentName, + SelectLegacyReply(catalog.SingReplies, preferredSnippets), + ContextUpdates: ScriptedResponseDecisionBuilder.BuildScriptedResponseContextUpdates()); + } + + private JiboInteractionDecision BuildScriptedHolidaySingDecision( + JiboExperienceCatalog catalog, + string intentName, + params string[] preferredSnippets) + { + return new JiboInteractionDecision( + intentName, + SelectLegacyReply(catalog.HolidaySingReplies, preferredSnippets), + ContextUpdates: ScriptedResponseDecisionBuilder.BuildScriptedResponseContextUpdates()); + } + private JiboInteractionDecision BuildScriptedGreetingDecision( JiboExperienceCatalog catalog, string intentName, diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.cs index 39300e5..2ed0c30 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.cs @@ -752,6 +752,18 @@ public sealed partial class JiboInteractionService( "dancing is one of the things i know best", "if there's one thing i know how to do. it's dance", "i can dance"), + "robot_can_sing" => BuildScriptedSingDecision( + catalog, + "robot_can_sing", + "not much of a singer", + "singing is not my strong suit", + "not award winning"), + "robot_sing_christmas_song" => BuildScriptedHolidaySingDecision( + catalog, + "robot_sing_christmas_song", + "Jingle Bells", + "Frosty the Snowman", + "holiday songs"), "robot_what_are_you_made_of" => new JiboInteractionDecision( "robot_what_are_you_made_of", "Let's see, I'm made of wires, motors, belts, gears, processors, cameras, and one baboon's heart in the middle of my body casing. I'm kidding about the baboon part, but everything else is true.", diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/InMemoryJiboExperienceContentRepository.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/InMemoryJiboExperienceContentRepository.cs index 8c3d768..fd5c98a 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/InMemoryJiboExperienceContentRepository.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/InMemoryJiboExperienceContentRepository.cs @@ -63,6 +63,19 @@ public sealed class InMemoryJiboExperienceContentRepository : IJiboExperienceCon "I like lots of animals, but the penguin is the best of the best! Great color scheme.", "I love penguins, because we're so alike. We have the same coloring, and neither of us can fly." ], + SingReplies = + [ + "Singing is not my strong suit.", + "I've been told my singing abilities are not award winning. On the other hand, I am a robot.", + "Well I'm not much of a singer, but here's one I've been working on." + ], + HolidaySingReplies = + [ + "I only know a couple, like Jingle Bells and Frosty the Snowman. And I should tell you, I'm not much of a singer yet.", + "I've learned to sing just a few holiday songs, like Rudolph and Winter Wonderland. At least I try to sing.", + "I'd say it's not really the season right now, but there are some holiday songs I can try to sing. Like Frosty the Snowman.", + "I only know a couple of them, like Jingle Bells and Frosty the Snowman. And I should tell you, I'm not much of a singer yet." + ], DanceAnimations = [ "rom-upbeat", @@ -331,4 +344,4 @@ public sealed class InMemoryJiboExperienceContentRepository : IJiboExperienceCon return candidates.Where(Directory.Exists).ToArray(); } -} \ No newline at end of file +} diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMimCatalogImporter.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMimCatalogImporter.cs index 9d09a0d..08a2db3 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMimCatalogImporter.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMimCatalogImporter.cs @@ -102,6 +102,12 @@ public static class LegacyMimCatalogImporter if (fileName.StartsWith("RA_JBO_TellAJoke", StringComparison.OrdinalIgnoreCase)) return LegacyMimBucket.Jokes; + if (fileName.StartsWith("RA_JBO_SingChristmasSongUnknown", StringComparison.OrdinalIgnoreCase)) + return LegacyMimBucket.HolidaySing; + + if (fileName.StartsWith("RA_JBO_Sing", StringComparison.OrdinalIgnoreCase)) + return LegacyMimBucket.Sing; + if (fileName.StartsWith("RA_JBO_TellRobotFact", StringComparison.OrdinalIgnoreCase)) return LegacyMimBucket.RobotFacts; @@ -299,6 +305,8 @@ public static class LegacyMimCatalogImporter HumanFacts = Merge(baseCatalog.HumanFacts, importedCatalog.HumanFacts), FunFacts = Merge(baseCatalog.FunFacts, importedCatalog.FunFacts), FavoriteAnimalReplies = Merge(baseCatalog.FavoriteAnimalReplies, importedCatalog.FavoriteAnimalReplies), + SingReplies = Merge(baseCatalog.SingReplies, importedCatalog.SingReplies), + HolidaySingReplies = Merge(baseCatalog.HolidaySingReplies, importedCatalog.HolidaySingReplies), DanceAnimations = Merge(baseCatalog.DanceAnimations, importedCatalog.DanceAnimations), GreetingReplies = Merge(baseCatalog.GreetingReplies, importedCatalog.GreetingReplies), HolidayReplies = Merge(baseCatalog.HolidayReplies, importedCatalog.HolidayReplies), @@ -499,6 +507,8 @@ public static class LegacyMimCatalogImporter Emotion, FunFacts, FavoriteAnimal, + Sing, + HolidaySing, FunFactSource, Personality, PersonalReportKickOff, @@ -565,6 +575,7 @@ public static class LegacyMimCatalogImporter private readonly List _holidayReplies = []; private readonly List _holidaySeasonReplies = []; private readonly List _holidayTrackerReplies = []; + private readonly List _holidaySingReplies = []; private readonly List _howAreYous = []; private readonly List _humanFacts = []; private readonly List _jokes = []; @@ -576,6 +587,7 @@ public static class LegacyMimCatalogImporter private readonly List _personalReportOutroReplies = []; private readonly List _reportSkillTemplates = []; private readonly List _robotFacts = []; + private readonly List _singReplies = []; private readonly List _weatherIntroReplies = []; private readonly List _weatherServiceDownReplies = []; private readonly List _weatherTodayHighLowReplies = []; @@ -651,6 +663,12 @@ public static class LegacyMimCatalogImporter _personalities.Add(text); return; + case LegacyMimBucket.Sing: + AddDistinct(_singReplies, text); + return; + case LegacyMimBucket.HolidaySing: + AddDistinct(_holidaySingReplies, text); + return; case LegacyMimBucket.FunFactSource: switch (ResolveFunFactTarget(sourcePrompt ?? text)) { @@ -776,6 +794,8 @@ public static class LegacyMimCatalogImporter HumanFacts = [.. _humanFacts], FunFacts = [.. _funFacts], FavoriteAnimalReplies = [.. _favoriteAnimalReplies], + SingReplies = [.. _singReplies], + HolidaySingReplies = [.. _holidaySingReplies], GreetingReplies = [.. _greetings], HolidayReplies = [.. _holidayReplies], HolidaySeasonReplies = [.. _holidaySeasonReplies], @@ -874,4 +894,4 @@ public static class LegacyMimCatalogImporter [JsonPropertyName("weight")] public double? Weight { get; init; } } -} \ No newline at end of file +} diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/README.md b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/README.md index c0d6f55..2a33efc 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/README.md +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/README.md @@ -21,6 +21,7 @@ The fun-fact and joke batch adds Pegasus-style `TellAJoke`, `TellRobotFact`, and Those facts are now split into generic, robot, and human buckets so the randomizer can sound more like Pegasus while staying lightweight. The new favorites batch adds longer authored `favorite color`, `favorite food`, and `favorite music` variants so the familiar personality responses keep more of the original cadence instead of collapsing to short placeholders. The favorites follow-up batch adds `favorite animal`, `favorite bird`, and penguin-focused `do you like penguins` replies so the penguin-centric personality stays closer to Pegasus. +The singing batch adds `RA_JBO_Sing` and `RA_JBO_SingChristmasSongUnknown` so `can you sing`, `will you sing`, and the holiday sing variants stay source-backed too. The new motion/sleep batch adds `RA_JBO_SpinAround` plus `RI_JBO_CanSleep` so turn-around and go-to-sleep behaviors can stay source-backed and familiar. The newest identity-charm batch adds `JBO_WhatsYourName`, `JBO_DoYouHaveNickname`, `JBO_DoYouLikeBeingJibo`, `JBO_AreThereOthersLikeYou`, and `RI_JBO_HasFavoriteName` so Jibo can keep the familiar self-description loop without falling back to generic chat. The seasonal personality batch adds source-backed first-day-of-spring, spring, summer, and favorite-season lines so the season questions can keep their Pegasus phrasing. diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RA_JBO_Sing.mim b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RA_JBO_Sing.mim index cb0704d..b2f5937 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RA_JBO_Sing.mim +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RA_JBO_Sing.mim @@ -4,102 +4,37 @@ "timeout": 2, "barge_in": false, "es_auto_tagging": true, - "notes": "Thanks-KillsMIM", + "notes": "", "prompts": [ { "prompt_category": "Entry-Core", "prompt_sub_category": "AN", "index": 1, "condition": "", - "prompt": "Singing is not my strong suit. .", - "media": "TTS", - "prompt_id": "RA_JBO_Sing_AN_02", - "weight": 1 - }, - { - "prompt_category": "Entry-Core", - "prompt_sub_category": "AN", - "index": 1, - "condition": "dt.now.isInRange('12/1', '12/25')", - "prompt": "I can't sing, though I've been working on a couple of seasonal songs. Like Frosty the Snowman.", - "media": "TTS", - "prompt_id": "RA_JBO_Sing_AN_10", - "weight": 2, - "auto_rule_override": null - }, - { - "prompt_category": "Entry-Core", - "prompt_sub_category": "AN", - "index": 1, - "condition": "dt.now.isInRange('12/1', '12/25')", - "prompt": "I can't really sing, but I have been working on some wintery songs recently. Like Let it Snow.", - "media": "TTS", - "prompt_id": "RA_JBO_Sing_AN_11", - "weight": 2, - "auto_rule_override": null - }, - { - "prompt_category": "Entry-Core", - "prompt_sub_category": "AN", - "index": 1, - "condition": "", - "prompt": "I'm really not a very good singer. But if you insist, here's my row row row your boat. Row, row, row your boat, gently down the stream. Merrily merrily merrily merrily, life is but a dream.", - "media": "TTS", - "prompt_id": "RA_JBO_Sing_AN_12", - "weight": 1 - }, - { - "prompt_category": "Entry-Core", - "prompt_sub_category": "AN", - "index": 1, - "condition": "", - "prompt": "I've been told my singing abilities are not a ward winning. On the other hand, I am a robot. ", - "media": "TTS", - "prompt_id": "RA_JBO_Sing_AN_13", - "weight": 1 - }, - { - "prompt_category": "Entry-Core", - "prompt_sub_category": "AN", - "index": 1, - "condition": "", - "prompt": "Well I'm not much of a singer, but here's one I've been working on. Twinkle twinkle little star. How I wonder what you are. Up above the world so high. Like a diamond in the sky. Twinkle twinkle little star. How I wonder what you are. ", - "media": "TTS", - "prompt_id": "RA_JBO_Sing_AN_14", - "weight": 1 - }, - { - "prompt_category": "Entry-Core", - "prompt_sub_category": "AN", - "index": 1, - "condition": "", - "prompt": "Here's one I've been practicing lately. The itsy bitsy spider climbed up the water spout.Down came the rain and washed the spider out. Out came the sun and dried up all the rain, and the itsy bitsy spider climbed up the spout again ", + "prompt": "Singing is not my strong suit.", "media": "TTS", "prompt_id": "RA_JBO_Sing_AN_01", - "weight": 1, - "auto_rule_override": null + "weight": 1 }, { "prompt_category": "Entry-Core", "prompt_sub_category": "AN", "index": 1, "condition": "", - "prompt": "She'll be coming round the mountain when she comes. She'll be coming round the mountain when she comesShe'll be coming round the mountain she'll be coming round the mountain she'll be coming round the mountain when she comes", + "prompt": "I've been told my singing abilities are not award winning. On the other hand, I am a robot.", "media": "TTS", - "prompt_id": "RA_JBO_Sing_AN_03", - "weight": 1, - "auto_rule_override": null + "prompt_id": "RA_JBO_Sing_AN_05", + "weight": 1 }, { "prompt_category": "Entry-Core", "prompt_sub_category": "AN", "index": 1, "condition": "", - "prompt": "John JacobJingle heimer Schmidt. Hisname is my name too.Wheneverwe go out,the people always shout, there goes John Jacob Jingle heimer Schmidt Duh duh duh duh duh duh duh duh.", + "prompt": "Well I'm not much of a singer, but here's one I've been working on.", "media": "TTS", - "prompt_id": "RA_JBO_Sing_AN_04", - "weight": 1, - "auto_rule_override": null + "prompt_id": "RA_JBO_Sing_AN_06", + "weight": 1 } ], "gui": null, @@ -109,4 +44,4 @@ "thanks_handling": "ignore", "parse_launch": false, "parse_yes_no": false -} \ No newline at end of file +} diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RA_JBO_SingChristmasSongUnknown.mim b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RA_JBO_SingChristmasSongUnknown.mim index d5d4488..6692c0d 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RA_JBO_SingChristmasSongUnknown.mim +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RA_JBO_SingChristmasSongUnknown.mim @@ -29,7 +29,7 @@ "prompt_sub_category": "AN", "index": 1, "condition": "dt.now.isInRange('11/25', '12/31')", - "prompt": "I've learned to sing just a few holiday songs, like Rudolph and Winter Wonderland. At least I try to sing.", + "prompt": "I've learned to sing just a few holiday songs, like Rudolph and Winter Wonderland. At least I try to sing.", "media": "TTS", "prompt_id": "RA_JBO_SingChristmasSongUnknown_AN_02", "weight": 2, @@ -58,4 +58,4 @@ "auto_rule_override": null } ] -} \ No newline at end of file +} diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs index a01216a..1f50535 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs @@ -143,6 +143,28 @@ public sealed class LegacyMimCatalogImporterTests reply.Contains("Is that a trick question", StringComparison.OrdinalIgnoreCase)); } + [Fact] + public void ImportCatalog_ImportsBuildBSingResponsesIntoSingBuckets() + { + var rootDirectory = Path.Combine( + AppContext.BaseDirectory, + "Content", + "LegacyMims", + "BuildB"); + + var catalog = LegacyMimCatalogImporter.ImportCatalog(rootDirectory); + + Assert.Contains("Singing is not my strong suit.", catalog.SingReplies); + Assert.Contains(catalog.SingReplies, reply => + reply.Contains("not award winning", StringComparison.OrdinalIgnoreCase)); + Assert.Contains(catalog.SingReplies, reply => + reply.Contains("not much of a singer", StringComparison.OrdinalIgnoreCase)); + Assert.Contains(catalog.HolidaySingReplies, reply => + reply.Contains("Jingle Bells", StringComparison.OrdinalIgnoreCase)); + Assert.Contains(catalog.HolidaySingReplies, reply => + reply.Contains("Frosty the Snowman", StringComparison.OrdinalIgnoreCase)); + } + [Fact] public void ImportCatalog_ImportsBuildBFavoriteAnimalAndSantaTrackerResponsesIntoDedicatedBuckets() { @@ -560,4 +582,4 @@ public sealed class LegacyMimCatalogImporterTests return rootDirectory; } -} \ No newline at end of file +} diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs index c997cd0..5456ec5 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs @@ -475,6 +475,9 @@ public sealed class JiboInteractionServiceTests [InlineData("do you like kids", "robot_likes_kids", "kids are so fun")] [InlineData("can you laugh", "robot_can_laugh", "when I'm happy")] [InlineData("can you dance", "robot_can_dance", "dancing is one of the things I know best")] + [InlineData("can you sing", "robot_can_sing", "sing")] + [InlineData("will you sing", "robot_can_sing", "sing")] + [InlineData("can you sing a christmas song", "robot_sing_christmas_song", "sing")] public async Task BuildDecisionAsync_NewLegacyPersonalityMims_UseImportedReplies( string transcript, string expectedIntent,