Rasa
Overview of sample Rasa connector
Building a Connector
Connectors are used to convert a Voiceflow project into a format that can be used in other platforms. To build a connector, you will need to extract the relevant data from a Voiceflow project (.vf file) and transform it into the desired format.
Recommended reading
Sample Connector
Find the sample Voiceflow to Rasa connector here. This is a starter template which we expect will be evolved based on customer's conversation design system on the Voiceflow platform.
Overview
This repo contains a set of functions that allow for exporting a Rasa assistant from a Voiceflow project. The process involves reading the project data, parsing the data, and then generating the domain and stories files.
Usage
Create a Voiceflow project that has intent events and output steps following it (speak or text steps).
Export the Voiceflow project as a .vf
file.
You can leave this file where convenient (~/Desktop
, ~/Downloads
, ~/Documents
, etc.).
Node.js and Yarn are required.
On the root level of this repository,
- Run
yarn install
to install the dependencies - Run
yarn build
to compile the tool - Run
yarn start [PATH TO FILE]
, oryarn start
to convert aproject.vf
file stored in this directory
[PATH TO FILE]
is where the .vf
file was saved earlier.
If the file was called project.vf
was on my Desktop, it would be yarn start ~/Desktop/project.vf
This will produce a .zip file with the same name (ex. project.vf
-> project.zip
). This file contains a the domain.yml
, nlu.yml
, and stories.yml
files for use with Rasa.
Files
index.ts
index.ts
This file is the main entry point for the script. It reads the project data, parses it, and generates the Rasa assistant.
intent.ts
intent.ts
This file contains functions related to converting Voiceflow intents to Rasa intents.
types.ts
types.ts
This file contains type definitions used throughout the project.
diagram.ts
diagram.ts
This file contains functions related to reading and processing the Voiceflow diagram.
entity.ts
entity.ts
This file contains a mapping of Voiceflow entities to Rasa entities.
zip.ts
zip.ts
This file contains functions related to generating the zip file containing the Rasa intents.
utils.ts
utils.ts
This file contains utility functions used throughout the project.
Noteworthy functions
main()
main()
The main function of the project. It reads the JSON file, converts the Voiceflow intents and entities into their Rasa equivalents, and then creates a Rasa assistant using these converted intents and entities.
voiceflowToRasaIntent()
voiceflowToRasaIntent()
This function converts a Voiceflow intent into its Rasa equivalent.
generateRasaUtterancesForIntent()
generateRasaUtterancesForIntent()
This function generates Rasa utterances for a given Voiceflow intent and adds it to the nlu.yml file
sanitizeResourceName()
sanitizeResourceName()
This function sanitizes a resource name to remove any invalid characters.
Updated 4 months ago