Simple bulk intent upload in Dialogflow - google's chatbot creation platform
intentUpload.py
is the shitty version, wherein I used selenium webdriver to automate the clicking and entering of text directly into the Dialogflow console, to create new intent.This is very slow and painful and not recommended . It's just here for future me to refer back, if I need to.intentUpload_V2.py
is the better one. The steps to execute it are given below, with an example.
Extract it, and observe the intents folder. Each intent has two .json
files associated with it: {intentName}.json
and {intentName}_usersays_en.json
. We aim to reproduce these using fake.json
and fake_usersays_en.json
as templates.
Refer to the image below:
make sure you have the acronyms
folder created in the same directory (tho this can be easily also done in python). This uses fake.json
and fake_usersays_en.json
as templates to generate two files for each intent.
Zip the folder containing the intents folder, and select the Import from zip
option in the dialogflow console
This is under "export and import" in settings of the agent. Since there are no ID's for what we uploaded, they will be generated automatically by Dialogflow.