Conversational Components

Introduction

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.

Component Structure

Each component has the following structure:

The models folder contains the language model, the src folder contains the logic and the i18n folder contains the components responses.

handler

The component's handler contains the states/intents to fulfill the incoming request. The only difference between the Jovo project's handler and component's handler is, that all of its intents are inside a state named after the component itself with the START intent being its entry point.

config

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.

i18n

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

The 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.

Name Description Value Required
handler Contains the logic of your component, i.e. states & intents object Yes
config Contains the default configuration object Yes
pathToI18n Specifies the path to your i18n folder containing the responses used in your component string Yes

That's the basic structure of a component.

Using Conversational Components

Learn how to integrate existing Conversational Components into your Jovo project here.

Developing Conversational Components

Learn how to develop your own Conversational Components here.

Comments and Questions

Any specific questions? Just drop them below or join the Jovo Community Forum.

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.