-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for custom slot types #275
Conversation
This is perfect, merging! |
Nice! So this will be part of the next 4.1.1 release? |
Yep, it'll be part of the next release (which I suspect should actually be called Unless anyone else feels differently, my plan was to wait until a few other pending threads were closed before cutting a new release. Tracking here: #277 |
@jradwan I just pushed a new version |
Great, thanks @lazerwalker! I have no internet at home (after Hurricane Irma - power, but no TV/internet/phone) but once I do I'm looking forward to testing this out. 😄 |
Oh no! Hope things aren’t too bad :( |
We were lucky ... no major damage (lost a fence, lots of tree debris), got power back after 21 hours and internet after 5 days. Thanks for asking! |
Gave this a shot and see how the app.schema.skillBuilder call works, nice. Now if I could just get the results into the Alexa Tester UI for the alexa-app-server. Thanks again! |
This adds in support for defining your own custom slot types.
The use case for this: I have a script that automatically takes my generated Skill Builder schema, navigates to the Amazon dev portal, and uploads the new schema file + rebuilds the interaction model. For my skills that have custom slot types, this means uploading a new schema file overwrites my existing custom slot types, which renders that workflow useless. Adding first-class support for custom slot types within the library itself means that the Skill Builder schema file it generates can now contain 100% of your interaction model for skills with custom slot types.
In its simplest form, you can add a custom slot type via
app.customSlot("SlotName", ["value1", "value2", "value3"])
. There's a slightly more verbose syntax if you want to take advantage of the new Skill Builder features, like synonyms.If you do that, and then call
app.schemas.skillBuilder()
, the resulting schema object contains your custom slots, ready to paste into the Skill Builder UI.This doesn't affect intents or actually handling requests (nor should there really be any reason to). It exists purely to thread the data through to the schema JSON.
This would resolve #114 and #222.