localedirectories contain subdirectories for each spoken language the skill supports. The subdirectories are named using the IETF language tag for the language. For example, Brazilian Portugues is 'pt-br', German is 'de-de', and Australian English is 'en-au'.
en-us) for each type of dialog the Skill will use. Currently this will contain all of the phrases you input when creating the Skill.
vocabdirectory is organized by language, just like the
vocabdirectory you may find multiple types of files:
.intentfiles used for defining Padatious Intents
.vocfiles define keywords primarily used in Adapt Intents
.entityfiles define a named entity also used in Adapt Intents
.intentfile will contain all of the sample utterances we provided when creating the Skill.
vocabinto a single directory. This was requested by the Community to reduce the complexity of a Skills structure, particularly for smaller Skills. Any of the standard file types that we've looked at so far will be treated the same if they are contained in the
regexdirectory that you will learn about later in the tutorial.
__init__.pyfile is where most of the Skill is defined using Python code. We will learn more about the contents of this file in the next section.
classdefinition extends the
__init__method might be:
initializefunction was used to register intents, however our new
@intent_handlerdecorator is a cleaner way to achieve this. We will learn all about the different Intents shortly. You may also see the
@intent_file_handlerdecorator used in Skills. This has been deprecated and you can now replace any instance of this with the simpler
self- a reference to the HelloWorldSkill object itself
message- an incoming message from the
self.speak_dialog()method, passing the name of a dialog file to it. In this case
passstatement is used as a placeholder; it doesn't actually have any function. However, if the Skill had any active functionality, the stop() method would terminate the functionality, leaving the Skill in a known good state.
create_skillfunction that returns our new Skill: