For voice assistants
Answers that sound right, and show up when there's a screen
Every answer carries a short speech line written to be heard, plus the follow-ups people tend to ask next. On devices with a screen, the same answer renders as a card.
“It's 15 degrees and partly cloudy in Dresden. Rain starts this evening and lasts until early morning.”
The spoken answer and its follow-ups, from one response
One response, two channels
“A medium banana has about 105 calories.”
A medium banana (118 g) has about 105 kcal, mostly from carbohydrates: 27 g, including 14 g of sugars. It also gives you 3.1 g of fiber and 422 mg of potassium.
Where it fits in a voice pipeline
Between speech-to-text and text-to-speech: WebKnox takes text in and gives text out.
- Someone speaksyour speech-to-text turns it into a message
- Your serversends the conversation to WebKnox
- matched: truespeak the speech line, listen for follow-ups
- matched: falseyour assistant answers as usual
const answer = await askWebKnox(messages);
if (answer.matched) {
speak(answer.speech); // short, written to be heard
listenFor(answer.follow_ups); // what people ask next
if (device.hasScreen) show(answer);
} else {
speak(await myLlm.reply(messages));
}Good to know for voice
Speech is not text
speech is shorter than the written answer and leaves out symbols, tables and links.
Listen for follow-ups
follow_ups lists what people tend to ask next. Use it to prime your speech recognition.
Timers just work
A timer answer comes with a timer.start action your device can run.