The script is a tool for migrating chatbot data from Dialogflow to Rasa 3, specifically handling intents and entities by converting JSON files from Dialogflow into YAML files for Rasa.
Follow these steps to migrate your Dialogflow chatbot to Rasa:
Export your Dialogflow agent and place the agent.json
, package.json
, along with the entities
and intents
folders in the dialogflow
directory.
Run the command rasa init
to initialize a new Rasa project in the rasa
folder. This folder will be the destination for the migration output (Rasa files).
Ensure the rasa/domain.yml
reflects desired session configuration immediately after the version
line, as shown below:
version: "3.1"
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
intents:
- greet
The rasa/stories.yml should start empty to avoid warnings during training:
version: "3.1"
stories:
Run the migration script with the command: $ python DialogRasaMigrator.py
Review and adjust the rasa/config.yml as necessary for your project's needs.
Navigate to Rasa project directory and execute rasa train to generate model.
Refer to TroubleshootingDialogflowToRasa.pdf
for common errors and warnings.
Dialogflow-to-Rasa-Migration-Tool/
│
├── dialogflow/
│ ├── agent.json # Dialogflow agent configuration
│ ├── package.json # Dialogflow package information
│ ├── intents/ # Directory containing Dialogflow intent files
│ │ └── [intent files] # JSON files for each intent
│ └── entities/ # Directory containing Dialogflow entity files
│ └── [entity files] # JSON files for each entity
│
├── rasa/
│ ├── actions/ # Custom actions for Rasa
│ ├── data/ # Rasa training data
│ │ ├── nlu.yml
│ │ ├── rules.yml
│ │ ├── stories.yml
│ │ └── synonyms.yml # Synonyms file is generated by script
│ │
│ ├── config.yml # Rasa configuration file
│ ├── credentials.yml # Rasa credentials file
│ ├── domain.yml # Rasa domain file
│ └── endpoints.yml # Configuration of Rasa endpoints
│
├── DialogRasaMigrator.py # Main migration script
└── README.md # Project README file