- Component Structure
- Using Conversational Components
- Developing Conversational Components
The idea behind Conversational Components is to provide solutions for recurring problems you might encounter while creating voice apps.
They are pre-built npm packages containing the necessary language model, handler (logic) and i18n (cms) files, which you utilize by delegating the task to the component.
Each component has the following structure:
models folder contains the language model, the
src folder contains the logic and the
i18n folder contains the components responses.
The component's handler contains the states/intents to fulfill the incoming request. It has to have a
START intent which is the entry point for the component.
Every component has its own default configuration, which can be overwritten by the developer.
They provide you with a way to customize them without having to go through the handler and modifying stuff there. The possible options should be documented in each component's own README file.
The i18n folder contains the component's responses. Again, it's a way for the developer to customize the component, without having to dig through the handler.
The sample dialogs in the component's README file, should give you the necessary information you need to make changes to the responses.
For now, i18n is the only supported CMS, with other external ones planned.
index.ts file at the root is the entry point of each component. It exports a class which contains references to the handler and config object as well as the path to the i18n folder. The component's handler has to be nested inside a state named after the component itself to prevent intents from being overwritten. It also has a
name property which has to be the same as the package name.
||Name of your component. Has to be the same as the package name||
||Contains the logic of your component, i.e. states & intents||
||Contains the default configuration||
||Specifies the path to your i18n folder containing the responses used in your component||
That's the basic structure of a component.
Learn how to integrate existing Conversational Components into your Jovo project here.
Learn how to develop your own Conversational Components here.