- A base class you subclass. You import it from
rasa.api.<stage>.<version>. The import names the version, for examplerasa.api.locks.v1. - A Python module in a Python package next to
agent.yml. - A YAML key in
integrations.ymlthat names your class by its module path.
Stages
<version> is the published version of that stage. In this release it is v1
for every stage. Shared audio types for speech are in rasa.api.voice.<version>.
See Versioning.
Get started
- Find your integration in the table and open its how-to.
- Write the class in a package next to
agent.yml, for exampleaddons/. Add an empty__init__.pyfile in that folder so Python can import it. - Name the class in
integrations.ymlwith the YAML key for its stage. - Run
rasa trainfrom the project root. For every integration except knowledge stores, train imports your class and fails if it is not a subclass of the base. Knowledge stores are different because Mantle does not load them at train or at runtime yet, so train only checks that each entry hasid,type, andembeddings. See Custom knowledge store.
Versioning
The version is part of the import.rasa.api.locks.v1 names version 1 of the
lock store API. YAML does not name a version, so the lock_store.type value
stays the same when a new version ships.
Rasa supports the current version of each stage and one previous version. A
version stays supported until the version after it ships:
- While
v1is current, writefrom rasa.api.locks.v1 import BaseLockStore. - When
v2ships,v1is deprecated.v2becomes current andv1becomes the previous version. Your class keeps loading through an adapter that Rasa owns, and you do not changeintegrations.yml. New classes importv2. - When
v3ships,v1is no longer supported. Startup fails and names the import that is no longer supported. Move your import to a supported version before you upgrade.
v2 does not exist yet, so this example is
hypothetical:
See also
integrations.ymlfor the field tables of each key above