1. Home
  2. Docs
  3. Developers
  4. Develop custom packages
  5. Overview

Overview

While Convoworks core library defines how the requests are executed, it does not contain real components that you could use. Actual components are defined in Convoworks packages that you have to register in the system and include in your service.

Besides components, in your package you can define intents, entities, expression language functions and templates for services.

To get started, you need two things.

  1. Write a .json meta file for your package. To follow our recommended naming guidelines, name it something like “MyCustomPackageDefinition”, and always end the name with “PackageDefinition”. This meta file should consist of the following information:
    1. namespace — A prefix that will distinguish your data from the rest. This allows you to have multiple components of the same name spread out across multiple different packages.
    2. author — The package’s author. This can be your name, nickname, your company’s name, etc.
    3. email — An email that will be displayed on the package list.
    4. source_for — An array of strings. Depending on what your package provides, add the following values: “functions”, “intents”, “entities”, “templates”.
  2. Write a package definition class for your package. This class should extend \Convo\Core\Factory\AbstractRepositoryPackageDefinition and, optionally, implement one of the following:
    1. \Convo\Core\Intent\ISystemIntentRepository if you provide intents
    2. \Convo\Core\Intent\ISystemEntityRepository if you provide entities
    3. \Convo\Core\Factory\IComponentProvider if you provide components
    4. \Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface if you provide expression functions

IMPORTANT: Make sure your .json meta file and the .php class have the same name.

Was this article helpful to you? Yes No

How can we help?