HumanFirst supports importing Dialogflow ES agents into a workspace very easily. Dialogflow CX isn’t supported at the moment (see a comparison of the editions here). If you are interested in Dialogflow CX support, come give us a shout on our Slack community.
Let’s quickly explore how to import Dialogflow ES agents into HumanFirst!
- In Dialogflow ES, go to the `Export and Import` section of your agent’s settings, then export your agent to a zip file.
- Unzip the downloaded file.
- Open a terminal to the directory in which the agent was unzipped. This directory should contain a file named `agent.json`.
- Import the agent in a workspace by running:
hf dialogflow import — workspace [workspace id] — clear
$ hf dialogflow import — workspace playbook-55ZOH4OG3ZH6NNZXH6IG2ZXD — clearZipping agent.jsonZipping entities/car-type.jsonZipping entities/car-type_entries_en.jsonZipping intents/Buy a car.jsonZipping intents/Buy a car_usersays_en.jsonZipping intents/Default Fallback Intent.json...Zipping package.jsonAgent intents successfully imported into workspace 'playbook-55ZOH4OG3ZH6NNZXH6IG2ZXD'
5. You may now open the workspace in your browser.
Note: not all features of Dialogflow ES are supported yet since some features don’t have an equivalent in HumanFirst. For example, intents hierarchy with follow-up intents and responses are not supported. It is possible to import their structure in HumanFirst, but the follow-up structure may be lost when you import your agent back into Dialogflow.
Currently, HumanFirst doesn’t support entities. Importing a Dialogflow agent with entities should work, but exporting them back may not be fully supported. Support for them in the HumanFirst Studio user interface is on the roadmap, so stay tuned!
Hint: You can track changes that have been done in HumanFirst by initializing a git repository in the directory of your unzipped agent and then committing the initial files originating from Dialogflow. By doing this, you will be able to easily compare the changes by using `git diff`.
- Open a terminal to the directory in which an exported Dialogflow agent has been unzipped. This directory should contain a file named `agent.json`.
- Export a HumanFirst workspace into the directory by running: `hf dialogflow export — workspace [workspace id]`
$ hf dialogflow export — workspace playbook-55ZOH4OG3ZH6NNZXH6IG2ZXDWriting to /path/to/intents/question about team.jsonWriting to /path/to/intents/question about team — yes.jsonWriting to /path/to/intents/identity — custom.jsonWriting to /path/to/intents/identity.jsonWriting to /path/to/intents/Default Welcome Intent.json…Workspace ‘playbook-55ZOH4OG3ZH6NNZXH6IG2ZXD’ successfully exported
- Zip the agent directory: `zip -r agent.zip .`
- In Dialogflow ES, go to the `Export and Import` section of your agent’s settings, click on `Import from zip`, select the just-created `agent.zip` file and click on import.
Note: HumanFirst doesn’t export all files that are required for Dialogflow to be valid. This means that you’ll need to provide a base agent structure (i.e. a directory that contains the `agent.json` file) from an existing agent, or by simply creating a new agent in Dialogflow and exporting it.
- As previously mentioned, it is possible to mimic the follow-up intents hierarchy when importing the agent into HumanFirst. This will allow you to see the follow-up structure. Since HumanFirst doesn’t support follow-up intents yet, keep in mind that the follow-up structure may not be accurate when importing it back into Dialogflow. Use the
— followup-hierarchyoption at both the import and export to enable this option.