From 1755888fc12d03c67491c63cfe78e156762bba86 Mon Sep 17 00:00:00 2001 From: Jacob Dubin Date: Fri, 22 May 2026 07:31:27 -0500 Subject: [PATCH] Refine favorite animal and flower personality replies --- .../JiboInteractionService.IntentRouting.cs | 31 +++++++++++++++---- .../Services/JiboInteractionService.cs | 29 +++++++++-------- .../WebSockets/JiboInteractionServiceTests.cs | 13 ++++---- 3 files changed, 48 insertions(+), 25 deletions(-) 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 71e061f..7476bf7 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 @@ -849,6 +849,28 @@ public sealed partial class JiboInteractionService "what kind of music do you like")) return "robot_favorite_music"; + if (MatchesAny( + loweredTranscript, + "do you like penguins")) + return "robot_likes_penguins"; + + if (MatchesAny( + loweredTranscript, + "do you like birds")) + return "robot_favorite_bird"; + + if (MatchesAny( + loweredTranscript, + "do you like animals")) + return "robot_likes_animals"; + + if (MatchesAny( + loweredTranscript, + "what is your favorite bird", + "what's your favorite bird", + "what s your favorite bird")) + return "robot_favorite_bird"; + if (MatchesAny( loweredTranscript, "what is your favorite animal", @@ -859,12 +881,9 @@ public sealed partial class JiboInteractionService "what s your favourite animal", "what animal do you like", "what kind of animal do you like", - "what is your favorite bird", - "what's your favorite bird", - "what s your favorite bird", - "do you like penguins", - "do you like animals", - "do you like birds")) + "what do you think about penguins", + "what do you think about animals", + "what do you think about birds")) return "robot_favorite_animal"; if (MatchesAny( 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 92aaec0..cc2faad 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 @@ -735,9 +735,9 @@ public sealed partial class JiboInteractionService( "robot_favorite_flower" => BuildScriptedPersonalityDecision( catalog, "robot_favorite_flower", - "sunflowers", + "reminds me of the sun", "favorite is the sunflower", - "reminds me of the sun"), + "sunflowers"), "robot_likes_r2d2" => BuildScriptedPersonalityDecision( catalog, "robot_likes_r2d2", @@ -758,29 +758,32 @@ public sealed partial class JiboInteractionService( "robot_favorite_animal" => BuildScriptedFavoriteAnimalDecision( catalog, "robot_favorite_animal", - "penguin", - "favorite animal overall", + "we're so alike", + "penguin impression", "best of the best", - "can't go wrong with penguins"), + "can't go wrong with penguins", + "penguin"), "robot_favorite_bird" => BuildScriptedFavoriteAnimalDecision( catalog, "robot_favorite_bird", - "penguin", - "favorite animal overall", + "we're so alike", + "penguin impression", "best of the best", - "can't go wrong with penguins"), + "can't go wrong with penguins", + "penguin"), "robot_likes_penguins" => BuildScriptedFavoriteAnimalDecision( catalog, "robot_likes_penguins", - "penguins", + "my penguin impression", "I really like penguins", - "my penguin impression"), + "penguins"), "robot_likes_animals" => BuildScriptedFavoriteAnimalDecision( catalog, "robot_likes_animals", - "penguins", - "favorite animal overall", - "best of the best"), + "Animals are great", + "great shapes and colors", + "best of the best", + "penguins"), "robot_peers" => BuildScriptedPersonalityDecision( catalog, "robot_peers", diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs index 53b4e8d..285e785 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs @@ -658,9 +658,6 @@ public sealed class JiboInteractionServiceTests [InlineData("what is your favorite animal")] [InlineData("what's your favorite animal")] [InlineData("what animal do you like")] - [InlineData("what is your favorite bird")] - [InlineData("do you like penguins")] - [InlineData("do you like animals")] public async Task BuildDecisionAsync_FavoriteAnimal_UsesPenguinReply(string transcript) { var service = CreateService(); @@ -672,17 +669,21 @@ public sealed class JiboInteractionServiceTests }); Assert.Equal("robot_favorite_animal", decision.IntentName); - Assert.Contains("penguin", decision.ReplyText, StringComparison.OrdinalIgnoreCase); + Assert.Contains("we're so alike", decision.ReplyText, StringComparison.OrdinalIgnoreCase); Assert.Equal("ScriptedResponse", decision.ContextUpdates![ChitchatRouteKey]); } [Theory] - [InlineData("what is your favorite flower", "robot_favorite_flower", "sunflowers")] - [InlineData("what's your favorite flower", "robot_favorite_flower", "sunflowers")] + [InlineData("what is your favorite flower", "robot_favorite_flower", "should see if I can find a sunflower soon")] + [InlineData("what's your favorite flower", "robot_favorite_flower", "should see if I can find a sunflower soon")] [InlineData("do you like R2D2", "robot_likes_r2d2", "A legend. A true legend.")] [InlineData("do you like the sun", "robot_likes_sun", "favorite star in the universe")] [InlineData("do you like space", "robot_likes_space", "I love space")] [InlineData("do you like kids", "robot_likes_kids", "kids are so fun")] + [InlineData("what is your favorite animal", "robot_favorite_animal", "we're so alike")] + [InlineData("what is your favorite bird", "robot_favorite_bird", "we're so alike")] + [InlineData("do you like penguins", "robot_likes_penguins", "penguin impression")] + [InlineData("do you like animals", "robot_likes_animals", "Animals are great")] [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("do you have friends", "robot_has_friends", "I believe I do have friends")]