version 18 fixes

This commit is contained in:
Jacob Dubin
2026-04-25 22:44:57 -05:00
parent 06af262192
commit 773e768898
14 changed files with 3372 additions and 37 deletions

View File

@@ -498,7 +498,9 @@ public sealed class JiboInteractionServiceTests
});
Assert.Equal("alarm_clarify", decision.IntentName);
Assert.Null(decision.SkillName);
Assert.Equal("@be/clock", decision.SkillName);
Assert.Equal("alarm", decision.SkillPayload!["domain"]);
Assert.Equal("set", decision.SkillPayload["clockIntent"]);
Assert.Equal("What time should I set the alarm for?", decision.ReplyText);
}
@@ -540,7 +542,9 @@ public sealed class JiboInteractionServiceTests
});
Assert.Equal("alarm_clarify", decision.IntentName);
Assert.Null(decision.SkillName);
Assert.Equal("@be/clock", decision.SkillName);
Assert.Equal("alarm", decision.SkillPayload!["domain"]);
Assert.Equal("set", decision.SkillPayload["clockIntent"]);
}
[Fact]
@@ -578,7 +582,9 @@ public sealed class JiboInteractionServiceTests
});
Assert.Equal("timer_clarify", decision.IntentName);
Assert.Null(decision.SkillName);
Assert.Equal("@be/clock", decision.SkillName);
Assert.Equal("timer", decision.SkillPayload!["domain"]);
Assert.Equal("set", decision.SkillPayload["clockIntent"]);
Assert.Equal("How long should I set the timer for?", decision.ReplyText);
}

View File

@@ -649,7 +649,7 @@ public sealed class JiboWebSocketServiceTests
}
[Fact]
public async Task ClientAsr_SetAlarmWithoutTime_UsesClarificationSpeechInsteadOfClockRedirect()
public async Task ClientAsr_SetAlarmWithoutTime_RedirectsIntoClockSkillWithoutDefaultingTime()
{
await _service.HandleMessageAsync(new WebSocketMessageEnvelope
{
@@ -669,20 +669,20 @@ public sealed class JiboWebSocketServiceTests
Text = """{"type":"CLIENT_ASR","transID":"trans-clock-clarify-alarm","data":{"text":"set an alarm"}}"""
});
Assert.Equal(3, replies.Count);
Assert.Equal("SKILL_ACTION", ReadReplyType(replies[2]));
Assert.Equal(4, replies.Count);
Assert.Equal("LISTEN", ReadReplyType(replies[0]));
Assert.Equal("EOS", ReadReplyType(replies[1]));
Assert.Equal("SKILL_REDIRECT", ReadReplyType(replies[2]));
Assert.Equal("SKILL_ACTION", ReadReplyType(replies[3]));
using var skillPayload = JsonDocument.Parse(replies[2].Text!);
var esml = skillPayload.RootElement
.GetProperty("data")
.GetProperty("action")
.GetProperty("config")
.GetProperty("jcp")
.GetProperty("config")
.GetProperty("play")
.GetProperty("esml")
.GetString();
Assert.Contains("What time should I set the alarm for?", esml, StringComparison.Ordinal);
using var listenPayload = JsonDocument.Parse(replies[0].Text!);
Assert.Equal("set", listenPayload.RootElement.GetProperty("data").GetProperty("nlu").GetProperty("intent").GetString());
Assert.Equal("alarm", listenPayload.RootElement.GetProperty("data").GetProperty("nlu").GetProperty("entities").GetProperty("domain").GetString());
Assert.False(listenPayload.RootElement.GetProperty("data").GetProperty("nlu").GetProperty("entities").TryGetProperty("time", out _));
using var redirectPayload = JsonDocument.Parse(replies[2].Text!);
Assert.Equal("@be/clock", redirectPayload.RootElement.GetProperty("data").GetProperty("match").GetProperty("skillID").GetString());
Assert.Equal("set", redirectPayload.RootElement.GetProperty("data").GetProperty("nlu").GetProperty("intent").GetString());
}
[Fact]