Defining an Assistant
Working with Assistants
Extension Packs
An Extension Pack is a basic container and a metadata file, the metadata file represents a definition of both the extension itself and all the “services” or components that are held within this extension pack.
All components (like project templates, stores, etc) are really just metadata, but two of them will reference runnable code that is held within the extension pack. These are “Assistant Definitions” and “Actions”. The assistant definition is basically the structure of the assistant, its metadata and any specific components within the assistant.
All components within Kodexa when defined in metadata will have the following basic parts:
This is common to all component metadata, and must be present. For an extension pack, we also include two other parts:
The source defines where the platform will find the container that we are building and deploying, typically this is an ECR repository. If you use kodexa:// then we will be picking up from the defined Kodexa repository for your implementation. The second is the services, a list of other components.
In the example above because we are defining an assistant we also have all the settings available to configure that assistant. For example, we define if the assistant can be scheduled, any options for assistant and if the assistant can react. These settings are used by the platform to do two things:
- Determine which events should be able to trigger the assistant
- Determine what to present to the user for configuration of the assistant
- If not reactive don’t show the user the reactive tab in assistant configuration
- If not schedulable don’t show the user the schedule tab in assistant configuration
- If options are defined then show these options to allow the user to configure assistant
The other key information for the Assistant component metadata is that we have the assistant package and class.
This tells the platform how to call the Python class that will implement the assistant. Let’s look at an example of the metadata, and then an example of the python class for an assistant.
The python class would need to match both the package and class name, and also include an init constructor that handles all the options that have been defined.