Expand legacy Build A routing and emotion replies

This commit is contained in:
Jacob Dubin
2026-05-14 06:48:39 -05:00
parent 7297017250
commit f5e37729ab

View File

@@ -346,6 +346,33 @@ public sealed class JiboInteractionServiceTests
Assert.Equal("EmotionQuery", decision.ContextUpdates![ChitchatRouteKey]); Assert.Equal("EmotionQuery", decision.ContextUpdates![ChitchatRouteKey]);
} }
[Theory]
[InlineData("joyful", "Yes indeed. Never been better.")]
[InlineData("pleased", "You know it. Life is good.")]
[InlineData("determined", "You're right. I am feeling pretty good at the moment.")]
[InlineData("confident", "All systems are go.")]
[InlineData("insecure", "Yes. Not too shabby.")]
[InlineData("neutral", "All systems are go.")]
public async Task BuildDecisionAsync_EmotionQuery_UsesStateDrivenLegacyReplies(
string emotion,
string expectedReply)
{
var service = CreateService();
var decision = await service.BuildDecisionAsync(new TurnContext
{
RawTranscript = "how are you",
NormalizedTranscript = "how are you",
Attributes = new Dictionary<string, object?>
{
[ChitchatEmotionKey] = emotion
}
});
Assert.Equal("how_are_you", decision.IntentName);
Assert.Equal(expectedReply, decision.ReplyText);
}
[Fact] [Fact]
public async Task BuildDecisionAsync_Smile_RoutesThroughEmotionCommandSplit() public async Task BuildDecisionAsync_Smile_RoutesThroughEmotionCommandSplit()
{ {