1
votes

I can't believe I have to ask this, but I have searched through the documentation for quiet a while now and couldn't find an answer: How should the files defining the interaction model in an Alexa skill (<locale>.json, sample_uterrances.txt, lists of values for custom slot types) be organized and deployed?

  • Where do these files go in the project structure: In the root dir, in the models dir, in a separate speech assets dir?
  • Where do I have to place the sample_utterances.txt in relation to the <locale>.json?
  • How do I handle multiple sample utterances files for different locales? Where are they mapped to each other?
  • How do I specify which list of custom slot type values belongs to which slot type in the <locale>.json?
  • How can I tell the ASK CLI exactly which files to deploy? The ask deploy command knows only a --target argument, whithout, it seems, the possibility to specify exactly what files are part of each target.

None of these questions seems to be answered in Amazon official documentation, am I really the only one who finds all of this non-obvious?

1
utterances needs to be placed @ developer.amazon.com take a look at this video youtube.com/watch?v=KrAGJB1oKDM&t=599s for end to end demo.. lot of documentation is also available on developer.amazon.comAmod Gokhale
@AmodGokhale I know that I could copypaste all of that into the Alexa Developer Console, but that is not an option for larger projects. That's why I was asking about the ASK CLI.gmolau

1 Answers

4
votes

I think you're mixing up two different things. The "old" style of creating an Alexa Skill, wich can still be used via developer.amazon.com (without the new Skill Builder). And the new way, via Skill Builder. The ASK CLI somehow uses a "mixed" form of both :D. With the Skill Builder you end up with one .json File that contains all the information, with the "old" way you have many input fields to fill. ASK CLI has:

  • lambda/
  • skill.json (general skill definition)
  • models/
    • .json (slots, sample utterances, etc.)

I recommend you just do a ask new in your terminal, the CLI will create all folders you need. All your information about the skill (including, sample utterances, custom slots, etc. will go into 'models/.json', all general information about your skill will go into 'skill.json'. There is no such thing as 'sample_utterances.txt', it's now in your .json and grouped for each intent. I can also recommend to create a sample skill in the web console and then use ask clone to learn how it is structured.

Here are answers to your questions:

  • Where do these files go in the project structure: In the root dir, in the models dir, in a separate speech assets dir? --> Use ask new to create the default project structure.

  • Where do I have to place the sample_utterances.txt in relation to the .json? --> Sample utterances are placed in the .json

  • How do I handle multiple sample utterances files for different locales? Where are they mapped to each other? --> As sample utterances are in the .json, they are different for each locale

  • How do I specify which list of custom slot type values belongs to which slot type in the .json? --> They are also defined in the .json, under "types"

  • How can I tell the ASK CLI exactly which files to deploy? The ask deploy command knows only a --target argument, whithout, it seems, the possibility to specify exactly what files are part of each target. --> The model of the ASK CLI is that everything in the folder belongs to one Skill. You can have a Skill "Sample Skill" with for example us-US and us-UK locales in your "models" folder, one skill.json definition and your lambda in "lambda" folder. I don't think there is a way do specify files with 'ask deploy'