Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Base Intents module adds handling for necessary intents such as the welcome intent to a project.

Table of Contents

Dependencies

The Base Intents module is dependent on the following modules:

Intents Handled

Launch

The module handles the launch intent by checking for a launch flow ID in custom data (at the path msg.payload.originalDetectIntentRequest.payload.customData.launchFlowId) or the settings (at the path flow.launch.id). If there is a launch flow specified, it will attempt to launch that flow, otherwise, it will give a standard welcome message based on the project description.

Info

If both are specified, the custom data launch flow ID will take precedence. If msg.launchFlowId is already set by the afterLaunch handler, that will take precedence over both.

None Intent

The module handles the none intent for no state and any state. When it fires, the registered fallback handler will fire. A default fallback handler is registered that will respond with the message “Sorry, I didn't understand you. Could you repeat that?“.

Handlers

Handlers for the following events can be registered by calling baseIntents.registerHandler and passing it the handler key:

afterLaunch

This handler is executed after the launch node has fired but before the launch flow (or default message) is provided. The handler can be asynchronous and modifications made to the msg object by the handler will be carried forward. The handler can set msg.launchFlowId to force a particular launch flow.

...

  • msg (object): The Node-RED message object.

fallback

This handler is executed after the none intent has fired.

...