jibo news skill by voice
This commit is contained in:
@@ -165,6 +165,12 @@ Latest radio discovery findings:
|
|||||||
- `result.nlu.entities.station` is the genre selector, and `Country` is a real supported station key from the robot's `genres.json`.
|
- `result.nlu.entities.station` is the genre selector, and `Country` is a real supported station key from the robot's `genres.json`.
|
||||||
- The smallest stock-shaped cloud handoff for voice launch is therefore a local `SKILL_REDIRECT` to `@be/radio` with `nlu.intent = "menu"`, optional `entities.station`, and a silent completion to settle the hotphrase cloud response.
|
- The smallest stock-shaped cloud handoff for voice launch is therefore a local `SKILL_REDIRECT` to `@be/radio` with `nlu.intent = "menu"`, optional `entities.station`, and a silent completion to settle the hotphrase cloud response.
|
||||||
|
|
||||||
|
Latest news discovery findings:
|
||||||
|
|
||||||
|
- Nimbus explicitly treats `match.cloudSkill === "news"` like the GQA path and waits on `cloudSkillResponse`.
|
||||||
|
- The first OpenJibo news pass should therefore use a real cloud-skill shape, not a generic placeholder chat reply.
|
||||||
|
- For now, the content can stay synthetic while the protocol is grounded: `match.cloudSkill = "news"` plus a supported `SLIM` announcement response is enough to validate the robot path before provider-backed headlines arrive later.
|
||||||
|
|
||||||
## Speech, Animation, And ESML
|
## Speech, Animation, And ESML
|
||||||
|
|
||||||
The current joke flow is only a small foothold into Jibo expressiveness.
|
The current joke flow is only a small foothold into Jibo expressiveness.
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ Parallel tags:
|
|||||||
- Implementation notes:
|
- Implementation notes:
|
||||||
- decide whether the first pass is a simple headline summary or a closer personal-report style payload
|
- decide whether the first pass is a simple headline summary or a closer personal-report style payload
|
||||||
- confirm whether stock OS expects `news` as a dedicated cloud skill or under the broader personal-report family
|
- confirm whether stock OS expects `news` as a dedicated cloud skill or under the broader personal-report family
|
||||||
|
- Latest progress:
|
||||||
|
- first pass should use Nimbus's supported cloud path by setting `match.cloudSkill = news` and returning a supported `SLIM` announcement
|
||||||
|
- provider-backed headlines can follow later under the `Lasso / Knowledge And Event Aggregation` track
|
||||||
- Exit criteria:
|
- Exit criteria:
|
||||||
- `tell me the news` reaches a non-placeholder live path
|
- `tell me the news` reaches a non-placeholder live path
|
||||||
- robot behavior feels Nimbus-native rather than generic chat playback
|
- robot behavior feels Nimbus-native rather than generic chat playback
|
||||||
|
|||||||
@@ -17,5 +17,6 @@ public sealed class JiboExperienceCatalog
|
|||||||
public IReadOnlyList<string> CalendarReplies { get; init; } = [];
|
public IReadOnlyList<string> CalendarReplies { get; init; } = [];
|
||||||
public IReadOnlyList<string> CommuteReplies { get; init; } = [];
|
public IReadOnlyList<string> CommuteReplies { get; init; } = [];
|
||||||
public IReadOnlyList<string> NewsReplies { get; init; } = [];
|
public IReadOnlyList<string> NewsReplies { get; init; } = [];
|
||||||
|
public IReadOnlyList<string> NewsBriefings { get; init; } = [];
|
||||||
public IReadOnlyList<string> GenericFallbackReplies { get; init; } = [];
|
public IReadOnlyList<string> GenericFallbackReplies { get; init; } = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public sealed class DemoConversationBroker(JiboInteractionService interactionSer
|
|||||||
"word_of_the_day_guess" => false,
|
"word_of_the_day_guess" => false,
|
||||||
"radio" => false,
|
"radio" => false,
|
||||||
"radio_genre" => false,
|
"radio_genre" => false,
|
||||||
|
"news" => false,
|
||||||
_ => true
|
_ => true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public sealed class JiboInteractionService(
|
|||||||
"weather" => new JiboInteractionDecision("weather", randomizer.Choose(catalog.WeatherReplies)),
|
"weather" => new JiboInteractionDecision("weather", randomizer.Choose(catalog.WeatherReplies)),
|
||||||
"calendar" => new JiboInteractionDecision("calendar", randomizer.Choose(catalog.CalendarReplies)),
|
"calendar" => new JiboInteractionDecision("calendar", randomizer.Choose(catalog.CalendarReplies)),
|
||||||
"commute" => new JiboInteractionDecision("commute", randomizer.Choose(catalog.CommuteReplies)),
|
"commute" => new JiboInteractionDecision("commute", randomizer.Choose(catalog.CommuteReplies)),
|
||||||
"news" => new JiboInteractionDecision("news", randomizer.Choose(catalog.NewsReplies)),
|
"news" => BuildNewsDecision(catalog),
|
||||||
_ => new JiboInteractionDecision("chat", BuildGenericReply(catalog, transcript, lowered))
|
_ => new JiboInteractionDecision("chat", BuildGenericReply(catalog, transcript, lowered))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -75,6 +75,22 @@ public sealed class JiboInteractionService(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private JiboInteractionDecision BuildNewsDecision(JiboExperienceCatalog catalog)
|
||||||
|
{
|
||||||
|
var briefing = randomizer.Choose(catalog.NewsBriefings);
|
||||||
|
return new JiboInteractionDecision(
|
||||||
|
"news",
|
||||||
|
briefing,
|
||||||
|
"news",
|
||||||
|
new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase)
|
||||||
|
{
|
||||||
|
["skillId"] = "news",
|
||||||
|
["cloudSkill"] = "news",
|
||||||
|
["mim_id"] = "runtime-news",
|
||||||
|
["mim_type"] = "announcement"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private string BuildGenericReply(JiboExperienceCatalog catalog, string transcript, string lowered)
|
private string BuildGenericReply(JiboExperienceCatalog catalog, string transcript, string lowered)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(transcript))
|
if (string.IsNullOrWhiteSpace(transcript))
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public sealed class ResponsePlanToSocketMessagesMapper
|
|||||||
var isRadioLaunch = string.Equals(plan.IntentName, "radio", StringComparison.OrdinalIgnoreCase) ||
|
var isRadioLaunch = string.Equals(plan.IntentName, "radio", StringComparison.OrdinalIgnoreCase) ||
|
||||||
string.Equals(plan.IntentName, "radio_genre", StringComparison.OrdinalIgnoreCase);
|
string.Equals(plan.IntentName, "radio_genre", StringComparison.OrdinalIgnoreCase);
|
||||||
var radioStation = ReadSkillPayloadString(skill, "station");
|
var radioStation = ReadSkillPayloadString(skill, "station");
|
||||||
|
var cloudSkill = ReadSkillPayloadString(skill, "cloudSkill");
|
||||||
var nluGuess = ReadClientEntity(turn, "guess");
|
var nluGuess = ReadClientEntity(turn, "guess");
|
||||||
var wordOfDayGuess = ResolveWordOfDayGuess(turn, transcript, nluGuess);
|
var wordOfDayGuess = ResolveWordOfDayGuess(turn, transcript, nluGuess);
|
||||||
var outboundIntent = isWordOfDayLaunch
|
var outboundIntent = isWordOfDayLaunch
|
||||||
@@ -84,7 +85,8 @@ public sealed class ResponsePlanToSocketMessagesMapper
|
|||||||
{
|
{
|
||||||
intent = outboundIntent,
|
intent = outboundIntent,
|
||||||
rule = outboundRules.FirstOrDefault() ?? string.Empty,
|
rule = outboundRules.FirstOrDefault() ?? string.Empty,
|
||||||
score = 0.95
|
score = 0.95,
|
||||||
|
cloudSkill
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -66,6 +66,11 @@ public sealed class InMemoryJiboExperienceContentRepository : IJiboExperienceCon
|
|||||||
"I heard your news request. That path is still a future cloud integration.",
|
"I heard your news request. That path is still a future cloud integration.",
|
||||||
"News is recognized, but I do not have the full news service behind it yet."
|
"News is recognized, but I do not have the full news service behind it yet."
|
||||||
],
|
],
|
||||||
|
NewsBriefings =
|
||||||
|
[
|
||||||
|
"Here are your headlines. Space missions are preparing for new launches, climate and weather systems are staying active across the country, and AI tools keep pushing into everyday products.",
|
||||||
|
"Here is a quick news brief. Technology companies are still racing on AI, global leaders are trading policy updates, and science teams are sharing new research findings."
|
||||||
|
],
|
||||||
GenericFallbackReplies =
|
GenericFallbackReplies =
|
||||||
[
|
[
|
||||||
"Okay. You said, {transcript}.",
|
"Okay. You said, {transcript}.",
|
||||||
|
|||||||
@@ -181,6 +181,25 @@ public sealed class JiboInteractionServiceTests
|
|||||||
Assert.Equal("Country", decision.SkillPayload!["station"]);
|
Assert.Equal("Country", decision.SkillPayload!["station"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task BuildDecisionAsync_TellMeTheNews_UsesNimbusCloudSkillPath()
|
||||||
|
{
|
||||||
|
var service = CreateService();
|
||||||
|
|
||||||
|
var decision = await service.BuildDecisionAsync(new TurnContext
|
||||||
|
{
|
||||||
|
RawTranscript = "tell me the news",
|
||||||
|
NormalizedTranscript = "tell me the news"
|
||||||
|
});
|
||||||
|
|
||||||
|
Assert.Equal("news", decision.IntentName);
|
||||||
|
Assert.Equal("news", decision.SkillName);
|
||||||
|
Assert.Equal("news", decision.SkillPayload!["skillId"]);
|
||||||
|
Assert.Equal("news", decision.SkillPayload["cloudSkill"]);
|
||||||
|
Assert.Equal("runtime-news", decision.SkillPayload["mim_id"]);
|
||||||
|
Assert.DoesNotContain("future cloud integration", decision.ReplyText, StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task BuildDecisionAsync_WordOfDayGuess_UsesStructuredClientNluGuess()
|
public async Task BuildDecisionAsync_WordOfDayGuess_UsesStructuredClientNluGuess()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -545,6 +545,50 @@ public sealed class JiboWebSocketServiceTests
|
|||||||
Assert.DoesNotContain("'", esml, StringComparison.Ordinal);
|
Assert.DoesNotContain("'", esml, StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task ClientAsr_TellMeTheNews_EmitsNimbusCloudSkillMatchAndNewsSkillAction()
|
||||||
|
{
|
||||||
|
await _service.HandleMessageAsync(new WebSocketMessageEnvelope
|
||||||
|
{
|
||||||
|
HostName = "neo-hub.jibo.com",
|
||||||
|
Path = "/listen",
|
||||||
|
Kind = "neo-hub-listen",
|
||||||
|
Token = "hub-news-token",
|
||||||
|
Text = """{"type":"LISTEN","transID":"trans-news","data":{"hotphrase":true,"rules":["launch","globals/global_commands_launch"]}}"""
|
||||||
|
});
|
||||||
|
|
||||||
|
var replies = await _service.HandleMessageAsync(new WebSocketMessageEnvelope
|
||||||
|
{
|
||||||
|
HostName = "neo-hub.jibo.com",
|
||||||
|
Path = "/listen",
|
||||||
|
Kind = "neo-hub-listen",
|
||||||
|
Token = "hub-news-token",
|
||||||
|
Text = """{"type":"CLIENT_ASR","transID":"trans-news","data":{"text":"tell me the news"}}"""
|
||||||
|
});
|
||||||
|
|
||||||
|
Assert.Equal(3, replies.Count);
|
||||||
|
Assert.Equal("LISTEN", ReadReplyType(replies[0]));
|
||||||
|
Assert.Equal("EOS", ReadReplyType(replies[1]));
|
||||||
|
Assert.Equal("SKILL_ACTION", ReadReplyType(replies[2]));
|
||||||
|
|
||||||
|
using var listenPayload = JsonDocument.Parse(replies[0].Text!);
|
||||||
|
Assert.Equal("news", listenPayload.RootElement.GetProperty("data").GetProperty("nlu").GetProperty("intent").GetString());
|
||||||
|
Assert.Equal("news", listenPayload.RootElement.GetProperty("data").GetProperty("match").GetProperty("cloudSkill").GetString());
|
||||||
|
|
||||||
|
using var skillPayload = JsonDocument.Parse(replies[2].Text!);
|
||||||
|
Assert.Equal("news", skillPayload.RootElement.GetProperty("data").GetProperty("skill").GetProperty("id").GetString());
|
||||||
|
var meta = skillPayload.RootElement
|
||||||
|
.GetProperty("data")
|
||||||
|
.GetProperty("action")
|
||||||
|
.GetProperty("config")
|
||||||
|
.GetProperty("jcp")
|
||||||
|
.GetProperty("config")
|
||||||
|
.GetProperty("play")
|
||||||
|
.GetProperty("meta");
|
||||||
|
Assert.Equal("runtime-news", meta.GetProperty("mim_id").GetString());
|
||||||
|
Assert.Equal("announcement", meta.GetProperty("mim_type").GetString());
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task ClientAsr_OpenTheRadio_EmitsRadioRedirectAndSilentCompletion()
|
public async Task ClientAsr_OpenTheRadio_EmitsRadioRedirectAndSilentCompletion()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user