Registering voice commands
manifest.json
{
"voice": {
"intents": ["crypto.price"]
}
}Runtime registration
voice.registerIntent(
"crypto.price",
{
slots: {
symbol: { type: "string", required: true },
},
examples: [
"Hey Piper, what's Bitcoin at?",
"Hey Piper, Ethereum price please",
],
},
async ({ symbol }) => {
const price = await fetchPrice(symbol);
return { speak: `${symbol} is about ${price} dollars.` };
},
);ℹ️ Note: Example phrases train the NLU pack shipped with your addon — more diverse phrasing reduces false negatives.
Debugging
- Enable verbose voice logs in developer settings.
- Print resolved slots before hitting external APIs.
- Return
{ speak: "…", display: … }to also show a card on screen.
Troubleshooting
Intent never fires
Conflicts with core built-ins — rename intent id; check marketplace namespace rules.
Last updated on
Was this helpful?