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.
- 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:
- 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.
- author — The package’s author. This can be your name, nickname, your company’s name, etc.
- email — An email that will be displayed on the package list.
- source_for — An array of strings. Depending on what your package provides, add the following values: “functions”, “intents”, “entities”, “templates”.
- Write a package definition class for your package. This class should extend \Convo\Core\Factory\AbstractRepositoryPackageDefinition and, optionally, implement one of the following:
- \Convo\Core\Intent\ISystemIntentRepository if you provide intents
- \Convo\Core\Intent\ISystemEntityRepository if you provide entities
- \Convo\Core\Factory\IComponentProvider if you provide components
- \Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface if you provide expression functions
IMPORTANT: Make sure your .json meta file and the .php class have the same name.