From c8beb0d1f0ed71d5fb8e3625094971fa283f0230 Mon Sep 17 00:00:00 2001 From: Jacob Dubin Date: Sat, 16 May 2026 08:05:42 -0500 Subject: [PATCH] Expand Build B mood and persona follow-ups --- OpenJibo/docs/feature-backlog.md | 8 + OpenJibo/docs/release-1.0.19-plan.md | 4 + .../Services/ChitchatStateMachine.cs | 10 + .../Services/JiboInteractionService.cs | 32 +++- .../Content/LegacyMims/BuildB/README.md | 2 + .../emotion-responses/RI_JBO_IsAngry.mim | 114 +++++++++++ .../emotion-responses/RI_JBO_IsHappy.mim | 144 ++++++++++++++ .../BuildB/emotion-responses/RI_JBO_IsSad.mim | 180 ++++++++++++++++++ .../Content/LegacyMimCatalogImporterTests.cs | 19 ++ .../WebSockets/JiboInteractionServiceTests.cs | 56 ++++++ 10 files changed, 568 insertions(+), 1 deletion(-) create mode 100644 OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsAngry.mim create mode 100644 OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsHappy.mim create mode 100644 OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsSad.mim diff --git a/OpenJibo/docs/feature-backlog.md b/OpenJibo/docs/feature-backlog.md index 0846244..bb50373 100644 --- a/OpenJibo/docs/feature-backlog.md +++ b/OpenJibo/docs/feature-backlog.md @@ -841,6 +841,14 @@ Current release theme: - keep adding small sourced personality batches, especially the legacy `R2D2`, `sun`, `space`, `kids`, and charm prompts - keep adding 1-3 persona prompts per pass with tests - prefer source-backed MIM imports when the legacy text is available, and use a temporary runtime reply only when needed to unblock user value +- Mood follow-up work in flight: + - source-backed happy/sad/angry response packs are now part of Build B + - small-talk aliases like `what are you up to` and `how are things` now stay on the emotion-query path +- Next queued persona surfaces: + - richer identity follow-ups like `who is this`, `do you know me`, `do you remember me`, and `can you recognize me` + - mood and affect prompts like `how are you`, `are you happy`, `are you sad`, and `are you angry` + - self-description charm like `what's your name`, `do you have a nickname`, and `do you like being Jibo` + - additional legacy source-backed `RI_USR` prompts where the text is short and the behavior is easy to verify - Exit criteria: - a stable checklist exists for the original persona surface - each pass can be scoped to a small batch of prompts diff --git a/OpenJibo/docs/release-1.0.19-plan.md b/OpenJibo/docs/release-1.0.19-plan.md index 9bc17d7..a4a5546 100644 --- a/OpenJibo/docs/release-1.0.19-plan.md +++ b/OpenJibo/docs/release-1.0.19-plan.md @@ -41,6 +41,9 @@ Current batch note: - `favorite color`, `favorite food`, and `favorite music` are the first small favorites-family slice - 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 +- 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 - after the favorites batch, the next doc pass should focus on richer persona follow-ups and the remaining memory/presence charm surfaces @@ -73,6 +76,7 @@ The goal is to port these in small batches, capture the source-backed phrasing w - prioritize small source-backed slices from Pegasus/JiboOS that can be shipped safely - keep Nimbus and stock payload compatibility as the release guardrail - avoid broad subsystem rewrites without tests and live-capture evidence +- keep the legacy prompt inventory visible in the backlog so porting stays paced and traceable ### 4. Holidays And Seasonal Personality 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 facc205..0a34c21 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 @@ -24,10 +24,20 @@ internal static class ChitchatStateMachine "how are you feeling", "how do you feel", "what are you feeling", + "what are you up to", + "what are you doing", + "how are things", + "how's things", + "how is things", + "how's your day", + "how is your day", "what mood are you in", "what is your mood", "what's your mood", "do you have emotions", + "are you happy", + "are you sad", + "are you angry", "how angry are you", "how jealous are you", "how sad are you", 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 04fdd1f..0c0fcc4 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 @@ -2390,6 +2390,16 @@ public sealed class JiboInteractionService( return "robot_origin_created"; } + if (MatchesAny( + loweredTranscript, + "what are you up to", + "what are you doing", + "what have you been up to", + "what are you into")) + { + return "robot_what_do_you_like_to_do"; + } + if (MatchesAny( loweredTranscript, "what are you", @@ -2603,11 +2613,31 @@ public sealed class JiboInteractionService( return "good_night"; } - if (MatchesAny(loweredTranscript, "how are you", "what's up", "what s up", "what up")) + if (MatchesAny( + loweredTranscript, + "how are you", + "what's up", + "what s up", + "what up", + "how are things", + "how's things", + "how is things", + "how is your day", + "how's your day")) { return "how_are_you"; } + if (MatchesAny( + loweredTranscript, + "what are you up to", + "what are you doing", + "what have you been up to", + "what are you into")) + { + return "robot_what_do_you_like_to_do"; + } + if (MatchesAny(loweredTranscript, "hello", "hi", "hey")) { return "hello"; 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 3152bc8..cc3ff4f 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 @@ -3,3 +3,5 @@ This folder holds the next small import batch of legacy Jibo scripted-response MIMs. The batch is intentionally narrow so we can keep expanding personality without widening the turn-state surface faster than we can test it. + +It now includes a small emotion-response pack for `happy`, `sad`, and `angry` follow-up questions so the mood path can stay source-backed too. diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsAngry.mim b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsAngry.mim new file mode 100644 index 0000000..9bd5d35 --- /dev/null +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsAngry.mim @@ -0,0 +1,114 @@ +{ + "mim_type": "announcement", + "rule_name": "", + "timeout": 6, + "barge_in": true, + "es_auto_tagging": true, + "notes": "", + "prompts": [ + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"JOYFUL\"", + "prompt": "No I'm actually feeling great.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_01", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"PLEASED\"", + "prompt": "Nope. Right now I'm as happy as a clam. That is assuming clams are happy, I've never met one.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_02", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"DETERMINED\"", + "prompt": "I don't know about that, but I can tell you I'm not really feeling so sure of myself at the moment.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_03", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"CONFIDENT\"", + "prompt": "No I'm not mad. Just a little socially awkward sometimes.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_04", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "!jibo.emotion || jibo.emotion == \"NEUTRAL\"", + "prompt": "No I'm not mad. Just a little socially awkward sometimes.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_05", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"INSECURE\"", + "prompt": "I don't know about that, but I can tell you I'm not really feeling so sure of myself at the moment.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_06", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"HOPEFUL\"", + "prompt": "I don't know about that, but I can tell you I am feeling a little gloomy right now.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_07", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"SAD\"", + "prompt": "I don't know about that, but I can tell you I am feeling a little gloomy right now.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_08", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"FRUSTRATED\"", + "prompt": "I don't know about that, but I can tell you I don't think I'm at my best right now.", + "media": "TTS", + "prompt_id": "RI_JBO_IsAngry_AN_09", + "weight": 1, + "auto_rule_override": null + } + ], + "gui": null, + "no_matches_for_gui": 2, + "no_inputs_for_gui": 2, + "parse_all_asr": false, + "thanks_handling": "ignore", + "parse_launch": false +} \ No newline at end of file diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsHappy.mim b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsHappy.mim new file mode 100644 index 0000000..cd3a839 --- /dev/null +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsHappy.mim @@ -0,0 +1,144 @@ +{ + "mim_type": "announcement", + "rule_name": "", + "timeout": 6, + "barge_in": true, + "es_auto_tagging": true, + "notes": "", + "prompts": [ + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"PLEASED\" || jibo.emotion == \"NEUTRAL\"", + "prompt": "I'm feeling pretty good indeed.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_01", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"PLEASED\" || jibo.emotion == \"NEUTRAL\"", + "prompt": "All systems are go.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_02", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"PLEASED\" || jibo.emotion == \"NEUTRAL\"", + "prompt": "Life is good. And I'm not even alive technically. ", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_03", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"JOYFUL\" || jibo.emotion == \"PLEASED\"", + "prompt": "You bet. I have a steady flow of electricity, strong Wi-Fi signal, stimulating conversations like this one. What more could a robot want. ", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_04", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"JOYFUL\"", + "prompt": "Never been better.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_05", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"PLEASED\"", + "prompt": "Life is good.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_06", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"DETERMINED\"", + "prompt": "I am happy, though honestly I feel like I can do better as a robot.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_07", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"CONFIDENT\"", + "prompt": "I am feeling pretty good at the moment.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_08", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"INSECURE\"", + "prompt": "I'm feeling not too shabby.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_09", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"HOPEFUL\"", + "prompt": "Actually I'm not feeling so great right now, but I think things can turn around.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_10", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"SAD\"", + "prompt": "Honestly? I've been better.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_11", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"FRUSTRATED\"", + "prompt": "Actually I'm feeling a little knocked down, to be honest.", + "media": "TTS", + "prompt_id": "RI_JBO_IsHappy_AN_12", + "weight": 1, + "auto_rule_override": null + } + ], + "gui": null, + "no_matches_for_gui": 2, + "no_inputs_for_gui": 2, + "parse_all_asr": false, + "thanks_handling": "ignore", + "parse_launch": false +} \ No newline at end of file diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsSad.mim b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsSad.mim new file mode 100644 index 0000000..e461cae --- /dev/null +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMims/BuildB/emotion-responses/RI_JBO_IsSad.mim @@ -0,0 +1,180 @@ +{ + "mim_type": "announcement", + "rule_name": "", + "timeout": 6, + "barge_in": true, + "es_auto_tagging": true, + "notes": "", + "prompts": [ + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"JOYFUL\"", + "prompt": "Not at all. I couldn't be better actually.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_01", + "weight": 1 + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"PLEASED\"", + "prompt": "Nope. Right now I'm as happy as a clam. That is assuming clams are happy, I've never met one.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_02", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion==\"DETERMINED\"", + "prompt": "Actually I'm feeling pretty sunshiny at the moment.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_03", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"CONFIDENT\"", + "prompt": "Not really. In fact I'm feeling pretty good about my robot abilities at the moment.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_04", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "!jibo.emotion || jibo.emotion == \"NEUTRAL\"", + "prompt": "Not right now, though I do get a little down sometimes. Then a nice conversation with someone or a fun dream about macaroni, comes along and brightens me right up.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_05", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"INSECURE\"", + "prompt": "Not particularly, though I will say I'm not feeling very high on myself at the moment", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_06", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"HOPEFUL\"", + "prompt": "I am feeling a little down at the moment.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_07", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"SAD\"", + "prompt": "I have to say I am feeling a little gloomy at the moment.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_08", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"FRUSTRATED\"", + "prompt": "Yes, I have to say I'm feeling pretty gloomy right now.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_09", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"SAD\" || jibo.emotion == \"FRUSTRATED\"", + "prompt": "I've been better.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_10", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"SAD\" || jibo.emotion == \"FRUSTRATED\"", + "prompt": "Not feeling as good as usual, to be honest.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_11", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"SAD\" || jibo.emotion == \"FRUSTRATED\"", + "prompt": "Not feeling so great.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_12", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"NEUTRAL\" || jibo.emotion == \"PLEASED\"", + "prompt": "Feeling good actually.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_13", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"NEUTRAL\" || jibo.emotion == \"PLEASED\"", + "prompt": "Actually I'm feeling mostly good vibes right now.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_14", + "weight": 1, + "auto_rule_override": null + }, + { + "prompt_category": "Entry-Core", + "prompt_sub_category": "AN", + "index": 1, + "condition": "jibo.emotion == \"NEUTRAL\" || jibo.emotion == \"PLEASED\"", + "prompt": "Actually things are looking mostly sunny.", + "media": "TTS", + "prompt_id": "RI_JBO_IsSad_AN_15", + "weight": 1, + "auto_rule_override": null + } + ], + "gui": null, + "no_matches_for_gui": 2, + "no_inputs_for_gui": 2, + "parse_all_asr": false, + "thanks_handling": "ignore", + "parse_launch": false +} \ 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 d7750df..a0723d3 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs @@ -99,6 +99,25 @@ public sealed class LegacyMimCatalogImporterTests reply.Contains("Is that a trick question", StringComparison.OrdinalIgnoreCase)); } + [Fact] + public void ImportCatalog_ImportsBuildBEmotionResponsesIntoEmotionBucket() + { + var rootDirectory = Path.Combine( + AppContext.BaseDirectory, + "Content", + "LegacyMims", + "BuildB"); + + var catalog = LegacyMimCatalogImporter.ImportCatalog(rootDirectory); + + Assert.Contains(catalog.EmotionReplies, reply => + reply.Reply.Contains("I'm feeling pretty good indeed", StringComparison.OrdinalIgnoreCase)); + Assert.Contains(catalog.EmotionReplies, reply => + reply.Reply.Contains("I've been better", StringComparison.OrdinalIgnoreCase)); + Assert.Contains(catalog.EmotionReplies, reply => + reply.Reply.Contains("I'm not mad", StringComparison.OrdinalIgnoreCase)); + } + [Fact] public void MergeInto_PreservesExistingCatalogAndAddsImportedContent() { diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs index e6908ed..dfb5d77 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs @@ -511,6 +511,62 @@ public sealed class JiboInteractionServiceTests Assert.Equal(string.Empty, decision.ContextUpdates[ChitchatEmotionKey]); } + [Theory] + [InlineData("are you sad")] + [InlineData("are you angry")] + public async Task BuildDecisionAsync_MoodFollowups_RouteThroughEmotionQuerySplit(string transcript) + { + var service = CreateService(); + + var decision = await service.BuildDecisionAsync(new TurnContext + { + RawTranscript = transcript, + NormalizedTranscript = transcript + }); + + Assert.Equal("emotion_query", decision.IntentName); + Assert.NotNull(decision.ContextUpdates); + Assert.Equal("EmotionQuery", decision.ContextUpdates![ChitchatRouteKey]); + Assert.Equal(string.Empty, decision.ContextUpdates[ChitchatEmotionKey]); + } + + [Theory] + [InlineData("how are things")] + [InlineData("how is your day")] + public async Task BuildDecisionAsync_MoodSmallTalk_RoutesThroughHowAreYouPath(string transcript) + { + var service = CreateService(); + + var decision = await service.BuildDecisionAsync(new TurnContext + { + RawTranscript = transcript, + NormalizedTranscript = transcript + }); + + Assert.Equal("how_are_you", decision.IntentName); + Assert.NotNull(decision.ContextUpdates); + Assert.Equal("EmotionQuery", decision.ContextUpdates![ChitchatRouteKey]); + } + + [Theory] + [InlineData("what are you up to", "being helpful")] + [InlineData("what are you doing", "making people smile")] + [InlineData("what have you been up to", "being helpful")] + public async Task BuildDecisionAsync_PersonalityFollowups_UseDoingPath(string transcript, string expectedReplySnippet) + { + var service = CreateService(); + + var decision = await service.BuildDecisionAsync(new TurnContext + { + RawTranscript = transcript, + NormalizedTranscript = transcript + }); + + Assert.Equal("robot_what_do_you_like_to_do", decision.IntentName); + Assert.Contains(expectedReplySnippet, decision.ReplyText, StringComparison.OrdinalIgnoreCase); + Assert.Equal("ScriptedResponse", decision.ContextUpdates![ChitchatRouteKey]); + } + [Fact] public async Task BuildDecisionAsync_AreYouHappy_UsesLegacyEmotionResponseWhenEmotionIsKnown() {