jibo news skill by voice
This commit is contained in:
@@ -17,5 +17,6 @@ public sealed class JiboExperienceCatalog
|
||||
public IReadOnlyList<string> CalendarReplies { get; init; } = [];
|
||||
public IReadOnlyList<string> CommuteReplies { get; init; } = [];
|
||||
public IReadOnlyList<string> NewsReplies { get; init; } = [];
|
||||
public IReadOnlyList<string> NewsBriefings { get; init; } = [];
|
||||
public IReadOnlyList<string> GenericFallbackReplies { get; init; } = [];
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ public sealed class DemoConversationBroker(JiboInteractionService interactionSer
|
||||
"word_of_the_day_guess" => false,
|
||||
"radio" => false,
|
||||
"radio_genre" => false,
|
||||
"news" => false,
|
||||
_ => true
|
||||
};
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public sealed class JiboInteractionService(
|
||||
"weather" => new JiboInteractionDecision("weather", randomizer.Choose(catalog.WeatherReplies)),
|
||||
"calendar" => new JiboInteractionDecision("calendar", randomizer.Choose(catalog.CalendarReplies)),
|
||||
"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))
|
||||
};
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(transcript))
|
||||
|
||||
@@ -26,6 +26,7 @@ public sealed class ResponsePlanToSocketMessagesMapper
|
||||
var isRadioLaunch = string.Equals(plan.IntentName, "radio", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(plan.IntentName, "radio_genre", StringComparison.OrdinalIgnoreCase);
|
||||
var radioStation = ReadSkillPayloadString(skill, "station");
|
||||
var cloudSkill = ReadSkillPayloadString(skill, "cloudSkill");
|
||||
var nluGuess = ReadClientEntity(turn, "guess");
|
||||
var wordOfDayGuess = ResolveWordOfDayGuess(turn, transcript, nluGuess);
|
||||
var outboundIntent = isWordOfDayLaunch
|
||||
@@ -84,7 +85,8 @@ public sealed class ResponsePlanToSocketMessagesMapper
|
||||
{
|
||||
intent = outboundIntent,
|
||||
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.",
|
||||
"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 =
|
||||
[
|
||||
"Okay. You said, {transcript}.",
|
||||
|
||||
Reference in New Issue
Block a user