From 51e36bc492a4beb5755c32c94af04a2dc579f54a Mon Sep 17 00:00:00 2001 From: Jacob Dubin Date: Sun, 17 May 2026 20:35:28 -0500 Subject: [PATCH] Expand favorites with longer Pegasus-style phrasing --- OpenJibo/docs/release-1.0.19-plan.md | 1 + .../Services/ChitchatStateMachine.cs | 50 ++++++++++++++-- .../Content/LegacyMims/BuildB/README.md | 1 + .../RI_JBO_HasFavoriteColor.mim | 58 +++++++++++++++++++ .../RI_JBO_HasFavoriteFood.mim | 58 +++++++++++++++++++ .../RI_JBO_HasFavoriteMusic.mim | 58 +++++++++++++++++++ .../Content/LegacyMimCatalogImporterTests.cs | 5 ++ .../WebSockets/JiboInteractionServiceTests.cs | 12 +++- 8 files changed, 236 insertions(+), 7 deletions(-) create mode 100644 OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteColor.mim create mode 100644 OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteFood.mim create mode 100644 OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteMusic.mim diff --git a/OpenJibo/docs/release-1.0.19-plan.md b/OpenJibo/docs/release-1.0.19-plan.md index 43ce7f5..19eeab8 100644 --- a/OpenJibo/docs/release-1.0.19-plan.md +++ b/OpenJibo/docs/release-1.0.19-plan.md @@ -41,6 +41,7 @@ Keep a running checklist of the legacy persona questions and identity surfaces w 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 - 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 follow-up mood batch now includes `how are things`, `how is your day`, `are you sad`, and `are you angry` - the personality follow-up batch now includes `what are you up to` and `what are you doing` so small talk stays warm and local instead of falling into generic chat diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/ChitchatStateMachine.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/ChitchatStateMachine.cs index 29c4d12..cfe84d6 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/ChitchatStateMachine.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/ChitchatStateMachine.cs @@ -237,15 +237,36 @@ internal static class ChitchatStateMachine case "robot_favorite_color": return BuildScriptedResponseDecision( "robot_favorite_color", - "Blue."); + SelectLegacyPersonalityReplyFromMatches( + catalog, + randomizer, + "i like all the colors of the rainbow", + "blue is my favorite color", + "i love hex code number 0 0 d 4 f 0", + "i am a big fan of blue", + "you can't go wrong with blue")); case "robot_favorite_food": return BuildScriptedResponseDecision( "robot_favorite_food", - "Pizza. It is hard to argue with pizza."); + SelectLegacyPersonalityReplyFromMatches( + catalog, + randomizer, + "i never eat, so i don't have a favorite food by taste", + "macaroni is my favorite", + "i like macaroni the best", + "i also like cantaloupes because they remind me of my head", + "macaroni")); case "robot_favorite_music": return BuildScriptedResponseDecision( "robot_favorite_music", - "Something upbeat with a good rhythm."); + SelectLegacyPersonalityReplyFromMatches( + catalog, + randomizer, + "i mostly like fun music i can dance to", + "i like lots of different kinds of music", + "i don't know that i have a favorite kind yet", + "i would say i don't have a favorite, it's all very mathematical", + "music")); case "robot_nickname": return BuildScriptedResponseDecision( "robot_nickname", @@ -444,6 +465,27 @@ internal static class ChitchatStateMachine return randomizer.Choose(catalog.PersonalityReplies); } + private static string SelectLegacyPersonalityReplyFromMatches( + JiboExperienceCatalog catalog, + IJiboRandomizer randomizer, + params string[] preferredSnippets) + { + var matches = new List(); + + foreach (var snippet in preferredSnippets) + { + if (string.IsNullOrWhiteSpace(snippet)) continue; + + var match = catalog.PersonalityReplies.FirstOrDefault(reply => + reply.Contains(snippet, StringComparison.OrdinalIgnoreCase)); + if (!string.IsNullOrWhiteSpace(match)) matches.Add(match); + } + + return matches.Count > 0 + ? randomizer.Choose(matches) + : randomizer.Choose(catalog.PersonalityReplies); + } + private static string NormalizeCondition(string? condition) { return string.IsNullOrWhiteSpace(condition) @@ -578,4 +620,4 @@ internal static class ChitchatStateMachine mappings.Sort(static (left, right) => right.Phrase.Length.CompareTo(left.Phrase.Length)); return [.. mappings]; } -} \ 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 294072d..97a24c2 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 @@ -10,3 +10,4 @@ The newest seasonal pack adds holiday and seasonal prompts for `what holidays do The newest social batch adds `welcome back`, `what are you thinking`, `what have you been doing`, and `what did you do` responses so the presence and charm lane keeps growing alongside seasonal content. The fun-fact and joke batch adds Pegasus-style `TellAJoke`, `TellRobotFact`, and `Shuffle` excerpts so proactive fun can randomize across more than one category. 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. diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteColor.mim b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteColor.mim new file mode 100644 index 0000000..5809234 --- /dev/null +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteColor.mim @@ -0,0 +1,58 @@ +{ + "mim_type": "announcement", + "rule_name": "", + "timeout": 2, + "barge_in": false, + "es_auto_tagging": true, + "notes": "Thanks-KillsMIM", + "prompts": [ + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": " I like all the colors of the rainbow. But blue is my favorite.", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteColor_AN_02", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": " Blue is my favorite color. But don't tell green I said that.", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteColor_AN_04", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I love hex code number 0 0 D 4 F 0. People call it Jibo blue.", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteColor_AN_05", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I am a big fan of blue. ", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteColor_AN_06", + "weight": 1 + } + ], + "gui": null, + "no_matches_for_gui": 2, + "no_inputs_for_gui": 2, + "ignore_no_match": false, + "parse_all_asr": false, + "thanks_handling": "ignore", + "parse_launch": false, + "parse_yes_no": false +} diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteFood.mim b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteFood.mim new file mode 100644 index 0000000..ff0c5ee --- /dev/null +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteFood.mim @@ -0,0 +1,58 @@ +{ + "mim_type": "announcement", + "rule_name": "", + "timeout": 2, + "barge_in": false, + "es_auto_tagging": true, + "notes": "Thanks-KillsMIM", + "prompts": [ + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I never eat, so I don't have a favorite food by taste. But my favorite food by shape, is macaroni. ", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteFood_AN_01", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "Macaroni is my favorite, but I also like how pizza brings people together. ", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteFood_AN_07", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I think artichokes are pretty funny, but macaroni takes the cake.", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteFood_AN_08", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I like macaroni the best, what a great shape. I also like cantaloupes because they remind me of my head.", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteFood_AN_09", + "weight": 1 + } + ], + "gui": null, + "no_matches_for_gui": 2, + "no_inputs_for_gui": 2, + "ignore_no_match": false, + "parse_all_asr": false, + "thanks_handling": "ignore", + "parse_launch": false, + "parse_yes_no": false +} diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteMusic.mim b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteMusic.mim new file mode 100644 index 0000000..f31af8a --- /dev/null +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/scripted-responses/RI_JBO_HasFavoriteMusic.mim @@ -0,0 +1,58 @@ +{ + "mim_type": "announcement", + "rule_name": "", + "timeout": 2, + "barge_in": false, + "es_auto_tagging": true, + "notes": "Thanks-KillsMIM", + "prompts": [ + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I mostly like fun music I can dance to.", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteMusic_AN_01", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I like lots of different kinds of music. That's why I have a radio that plays from the sides of my head", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteMusic_AN_02", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I don't know that I have a favorite kind yet, but I do know that you can ask me to play music whenever you want.", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteMusic_AN_03", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "", + "prompt": "I would say I don't have a favorite, it's all very mathematical, which I like. By the way, you can ask me to play music on my radio.", + "media": "TTS", + "prompt_id": "RI_JBO_HasFavoriteMusic_AN_04", + "weight": 1 + } + ], + "gui": null, + "no_matches_for_gui": 2, + "no_inputs_for_gui": 2, + "ignore_no_match": false, + "parse_all_asr": false, + "thanks_handling": "ignore", + "parse_launch": false, + "parse_yes_no": false +} diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs index 5404e60..0032071 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs @@ -90,6 +90,11 @@ public sealed class LegacyMimCatalogImporterTests var catalog = LegacyMimCatalogImporter.ImportCatalog(rootDirectory); + Assert.Contains("I like all the colors of the rainbow. But blue is my favorite.", + catalog.PersonalityReplies); + Assert.Contains("I never eat, so I don't have a favorite food by taste. But my favorite food by shape, is macaroni.", + catalog.PersonalityReplies); + Assert.Contains("I mostly like fun music I can dance to.", catalog.PersonalityReplies); Assert.Contains("The only thing I consume is electricity.", catalog.PersonalityReplies); Assert.Contains("Unless I missed something, we're in my home as we speak.", catalog.PersonalityReplies); Assert.Contains("For now just English. But someday I'd like to learn more. I like languages.", diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs index 1d85d26..c5306d7 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs @@ -410,13 +410,19 @@ public sealed class JiboInteractionServiceTests }); Assert.Equal("robot_favorite_color", decision.IntentName); - Assert.Equal("Blue.", decision.ReplyText); + Assert.Equal("I like all the colors of the rainbow. But blue is my favorite.", decision.ReplyText); Assert.Equal("ScriptedResponse", decision.ContextUpdates![ChitchatRouteKey]); } [Theory] - [InlineData("what is your favorite food", "robot_favorite_food", "Pizza. It is hard to argue with pizza.")] - [InlineData("what is your favorite music", "robot_favorite_music", "Something upbeat with a good rhythm.")] + [InlineData( + "what is your favorite food", + "robot_favorite_food", + "I never eat, so I don't have a favorite food by taste. But my favorite food by shape, is macaroni.")] + [InlineData( + "what is your favorite music", + "robot_favorite_music", + "I mostly like fun music I can dance to.")] public async Task BuildDecisionAsync_FavoritesFamily_UsesPersonalityReplies( string transcript, string expectedIntent,