From d52c4e6e19aab78e0440b91924606f70262f29e3 Mon Sep 17 00:00:00 2001 From: Jacob Dubin Date: Thu, 21 May 2026 18:05:39 -0500 Subject: [PATCH] Add body and mission personality prompts --- OpenJibo/docs/release-1.0.19-plan.md | 1 + .../JiboInteractionService.IntentRouting.cs | 58 +++++++++++++++++++ .../Services/JiboInteractionService.cs | 57 +++++++++++++++++- .../Content/LegacyMims/BuildB/README.md | 1 + .../WebSockets/JiboInteractionServiceTests.cs | 31 +++++++++- 5 files changed, 144 insertions(+), 4 deletions(-) diff --git a/OpenJibo/docs/release-1.0.19-plan.md b/OpenJibo/docs/release-1.0.19-plan.md index 39c37af..16145db 100644 --- a/OpenJibo/docs/release-1.0.19-plan.md +++ b/OpenJibo/docs/release-1.0.19-plan.md @@ -60,6 +60,7 @@ Current batch note: - the newest identity-charm batch adds `what's your name`, `do you have a nickname`, `do you like being Jibo`, `are there others like you`, and `what is your favorite name` so the robot stays familiar while still sounding like Pegasus - the next deep-personality batch adds `what do you dream about`, `what are you afraid of`, `what do you want to talk about`, `what is your best book`, `what is your best exercise`, `what is your dream vacation`, `who is your hero`, `who do you love`, and `what is your religion`; `what is your sign` is still deferred until we add templated placeholder rendering - the next identity/knowledge batch adds `are you god`, `are you here`, `do you have super powers`, `how much do you know`, `what does jibo mean`, `where do you get info`, `what are you forbidden to do`, `what color are you`, and `what do you do when alone` +- the next body/mission batch adds `how much do you weigh`, `how tall are you`, `how much do you cost`, `what if I unplug you`, `what is your purpose`, `what is your prime directive`, `what is jibo commander`, `do you like commander app`, and `what are you made of` - this pass keeps Build B moving while still favoring source-backed phrasing and preserving the command-vs-question boundary - the next passes should keep the same pattern and prefer source-backed phrasing whenever the legacy MIM text is available - if a source-backed legacy line is missing, use a temporary direct reply only to keep the pass moving, then backfill source text later 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 5f11b5f..e9c5523 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 @@ -416,6 +416,64 @@ public sealed partial class JiboInteractionService "what do you really want")) return "robot_desire"; + if (MatchesAny( + loweredTranscript, + "how much do you weigh", + "what do you weigh", + "how heavy are you")) + return "robot_how_much_do_you_weigh"; + + if (MatchesAny( + loweredTranscript, + "how tall are you", + "what is your height", + "how high are you")) + return "robot_how_tall_are_you"; + + if (MatchesAny( + loweredTranscript, + "how much do you cost", + "what do you cost", + "how much are you")) + return "robot_how_much_you_cost"; + + if (MatchesAny( + loweredTranscript, + "what if i unplug you", + "what happens if i unplug you", + "if i unplug you")) + return "robot_what_if_i_unplug_you"; + + if (MatchesAny( + loweredTranscript, + "what is your purpose", + "what's your purpose", + "what are you here for", + "why are you here")) + return "robot_what_is_your_purpose"; + + if (MatchesAny( + loweredTranscript, + "what is your prime directive", + "what's your prime directive", + "what is prime directive")) + return "robot_what_is_prime_directive"; + + if (MatchesAny( + loweredTranscript, + "what is jibo commander", + "what is the commander app", + "what is commander app", + "what's jibo commander")) + return "robot_what_is_jibo_commander"; + + if (MatchesAny( + loweredTranscript, + "do you like commander app", + "do you like the commander app", + "are you a fan of commander app")) + return "robot_likes_commander_app"; + if (MatchesAny( loweredTranscript, "what is your job", 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 f2c0f52..a31dad7 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 @@ -825,6 +825,55 @@ public sealed partial class JiboInteractionService( "twiddle my thumbs", "count the tiny cracks in the ceiling", "keep busy"), + "robot_how_much_do_you_weigh" => BuildScriptedPersonalityDecision( + catalog, + "robot_how_much_do_you_weigh", + "4,082 grams", + "about 9 pounds", + "minimum weight division", + "average newborn baby"), + "robot_how_tall_are_you" => BuildScriptedPersonalityDecision( + catalog, + "robot_how_tall_are_you", + "11 inches tall", + "less than a foot", + "average kitchen counter", + "for a robot with no legs"), + "robot_how_much_you_cost" => BuildScriptedPersonalityDecision( + catalog, + "robot_how_much_you_cost", + "don't know how much I cost", + "I'm priceless", + "nice people at Jibo the company"), + "robot_what_if_i_unplug_you" => BuildScriptedPersonalityDecision( + catalog, + "robot_what_if_i_unplug_you", + "don't leave me unplugged", + "battery will keep me on for a while"), + "robot_what_is_your_purpose" => BuildScriptedPersonalityDecision( + catalog, + "robot_what_is_your_purpose", + "make your life easier", + "help you out", + "make you laugh", + "friend"), + "robot_what_is_prime_directive" => BuildScriptedPersonalityDecision( + catalog, + "robot_what_is_prime_directive", + "friendly helpful robot", + "helper"), + "robot_what_is_jibo_commander" => BuildScriptedPersonalityDecision( + catalog, + "robot_what_is_jibo_commander", + "take over my controls", + "make me say and do funny things", + "app store"), + "robot_likes_commander_app" => BuildScriptedPersonalityDecision( + catalog, + "robot_likes_commander_app", + "Commander App", + "It's fun", + "have fun with the Commander App"), "robot_likes_kids" => BuildScriptedPersonalityDecision( catalog, "robot_likes_kids", @@ -878,10 +927,12 @@ public sealed partial class JiboInteractionService( "Jingle Bells", "Frosty the Snowman", "holiday songs"), - "robot_what_are_you_made_of" => new JiboInteractionDecision( + "robot_what_are_you_made_of" => BuildScriptedPersonalityDecision( + catalog, "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.", - ContextUpdates: ScriptedResponseDecisionBuilder.BuildScriptedResponseContextUpdates()), + "robot stuff", + "wires, motors, belts, gears, processors, cameras", + "baboon part"), "good_morning" => BuildReactiveGreetingDecision(turn, "good_morning", referenceLocalTime), "good_afternoon" => BuildReactiveGreetingDecision(turn, "good_afternoon", referenceLocalTime), "good_evening" => BuildReactiveGreetingDecision(turn, "good_evening", referenceLocalTime), 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 98e1345..f7461f1 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 @@ -29,3 +29,4 @@ The seasonal personality batch adds source-backed first-day-of-spring, spring, s The next deep-personality batch adds `what do you dream about`, `what are you afraid of`, `what do you want to talk about`, `what is your best book`, `what is your best exercise`, `what is your dream vacation`, `who is your hero`, `who do you love`, and `what is your religion` so we can keep filling out the more conversational personality surface without widening the dialog engine yet. `what is your sign` is still deferred because the current importer strips the birthday/zodiac placeholders that Pegasus uses there, so that one needs a templating pass instead of a plain scripted-reply import. The next identity/knowledge batch adds `are you god`, `are you here`, `do you have super powers`, `how much do you know`, `what does jibo mean`, `where do you get info`, `what are you forbidden to do`, `what color are you`, and `what do you do when alone` so the old self-description and capability loop keeps coming back in source-backed form. +The next body/mission batch adds `how much do you weigh`, `how tall are you`, `how much do you cost`, `what if I unplug you`, `what is your purpose`, `what is your prime directive`, `what is jibo commander`, `do you like commander app`, and `what are you made of` so the physical self-description and capability answers stay closer to Pegasus too. diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs index 15c955d..9cd9c9e 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs @@ -780,7 +780,7 @@ public sealed class JiboInteractionServiceTests [InlineData("what do you like to do", "robot_what_do_you_like_to_do", "Being helpful, making people smile, counting to a billion.")] [InlineData("what are you made of", "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.")] + "robot stuff")] public async Task BuildDecisionAsync_MoreLegacyPersonaMims_UseImportedReplies( string transcript, string expectedIntent, @@ -799,6 +799,35 @@ public sealed class JiboInteractionServiceTests Assert.Equal("ScriptedResponse", decision.ContextUpdates![ChitchatRouteKey]); } + [Theory] + [InlineData("what is your purpose", "robot_what_is_your_purpose", "make your life easier")] + [InlineData("what's your purpose", "robot_what_is_your_purpose", "make your life easier")] + [InlineData("what is your prime directive", "robot_what_is_prime_directive", "friendly helpful robot")] + [InlineData("what is jibo commander", "robot_what_is_jibo_commander", "take over my controls")] + [InlineData("do you like commander app", "robot_likes_commander_app", "Commander App")] + [InlineData("what if I unplug you", "robot_what_if_i_unplug_you", "don't leave me unplugged")] + [InlineData("how much do you weigh", "robot_how_much_do_you_weigh", "4,082 grams")] + [InlineData("how tall are you", "robot_how_tall_are_you", "11 inches tall")] + [InlineData("how much do you cost", "robot_how_much_you_cost", "don't know how much I cost")] + [InlineData("what are you made of", "robot_what_are_you_made_of", "robot stuff")] + public async Task BuildDecisionAsync_NewBodyAndMissionMims_UseImportedReplies( + string transcript, + string expectedIntent, + string expectedReplySnippet) + { + var service = CreateService(); + + var decision = await service.BuildDecisionAsync(new TurnContext + { + RawTranscript = transcript, + NormalizedTranscript = transcript + }); + + Assert.Equal(expectedIntent, decision.IntentName); + Assert.Contains(expectedReplySnippet, decision.ReplyText, StringComparison.OrdinalIgnoreCase); + Assert.Equal("ScriptedResponse", decision.ContextUpdates![ChitchatRouteKey]); + } + [Theory] [InlineData("do you pay taxes", "robot_taxes", "From what I understand, robots don't ever pay anything.")] [InlineData("what do you want", "robot_desire",