Dialogflow ES

note

The Dialogflow ES integration requires the usage of the hf command line tool. See how to install it here.

Intents#

Importing a Dialogflow ES agent#

  1. In Dialogflow ES, go to the Export and Import section of your agent’s settings, then export your agent to a zip file.

  2. Unzip the downloaded file.

  3. Open a terminal to the directory in which the agent was unzipped. This directory should contain a file named agent.json.

  4. Import the agent in a workspace by running: hf dialogflow es import --workspace <workspace id> --clear. To find out about workspace id, see this.

    Example:

$ hf dialogflow es import --workspace playbook-55ZOH4OG3ZH6NNZXH6IG2ZXD --clear
Zipping agent.json
Zipping entities/car-type.json
Zipping entities/car-type_entries_en.json
Zipping intents/Buy a car.json
Zipping intents/Buy a car_usersays_en.json
Zipping intents/Default Fallback Intent.json
...
Zipping package.json
Agent intents successfully imported into workspace 'playbook-55ZOH4OG3ZH6NNZXH6IG2ZXD'
  1. You may now open the workspace in your browser.

Exporting a Workspace#

tip

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.

  1. Open a terminal to the directory in which an exported Dialogflow agent has been unzipped. This directory should contain a file named agent.json.

  2. Export a HumanFirst workspace into the directory by running: hf dialogflow es export --workspace <workspace id>

    Example:

$ hf dialogflow es export --workspace playbook-55ZOH4OG3ZH6NNZXH6IG2ZXD
Writing to /path/to/intents/question about team.json
Writing to /path/to/intents/question about team - yes.json
Writing to /path/to/intents/identity - custom.json
Writing to /path/to/intents/identity.json
Writing to /path/to/intents/Default Welcome Intent.json
...
Workspace 'playbook-55ZOH4OG3ZH6NNZXH6IG2ZXD' successfully exported
  1. Zip the agent directory: zip -r agent.zip .
  2. 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.

Advanced usage#

  • 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-hierarchy option at both the import and export to enable this option.