alexa-app
alexa-app copied to clipboard
Support for including utterances/ samples in slots
Now the schema's slot is an object that takes a map. Doc says "The slots object is a simple name: type mapping. The type must be one of Amazon's built-in slot types, such as AMAZON.DATE or AMAZON.NUMBER." If we require to specify a list of samples, for a slot it is not possible. This is especially useful when modeling a dialog flow. see https://raw.githubusercontent.com/alexa/alexa-cookbook/master/feature-demos/skill-demo-plan-my-trip/models/en-IN.json
In code it is explicitly passed as empty array. Changing the value of the map from string to object should do.
if (intent.slots && Object.keys(intent.slots).length > 0) {
intentSchema["slots"] = [];
for (key in intent.slots) {
// It's unclear whether `samples` is actually used for slots,
// but the interaction model will not build without an (empty) array
intentSchema.slots.push({
"name": key,
"type": intent.slots[key],
"samples": []
});
}
}
schema.intents.push(intentSchema);
}
Care to pull request a fix for this?
Comment added on the PR. Merge and release soon?