Dialogflow CX
note
The Dialogflow CX integration requires the usage of the hf
command line tool. See how to install it here.
#
Prerequisites#
Google cloud CLIIn order for the hf
CLI to access your Dialogflow CX project, Google gcloud's CLI tool must be installed and configured.
Follow this guide to install the tool and authenticate with your Google project.
#
ConfigurationAll DialogFlow related commands require the project and location to be set in the environment. The Google project ID can be found
in the URL of your DialogFlow project (https://dialogflow.cloud.google.com/cx/projects/<YOUR PROJECT ID>/locations
). The location
of the agent corresponds to the value in the Region of the list of agents. The list of supported locations can be found
here.
note
These environment variables need to be set every time your terminal session is restarted.
#
Listing agentsTo list the agents in your project and configured location, run:
note
The id
column corresponds to the agent-id
that can be used in all other commands.
#
Agent backupsThe command line tool can be used to backup and restore a DialogFlow CX agent. It is to be noted that on every
export of a workspace to an existing agent, the CLI tool automatically creates a backup of the existing agent in
the current working directory (filename: <agent-id>-<date>.blob
)
To backup an existing agent, run:
To restore an agent from a backup, run:
#
Importing an agentTo import an existing DialogFlow CX agent into HumanFirst, run:
To find where to find the workspace id, see this.
Different options are available to control the import process:
Option | Description |
---|---|
--clear | Clears the workspace before import. |
--language value | Language code in which data is imported (ex: en, en-us). See the list of supported languages. |
--output-file value | Don't import the agent to workspace but write it to a JSON file instead. |
--skip-default-intents | Don't import DialogFlow default intents (ex: Default welcome intent and Default negative intent). |
--hierarchical-delimiter value | Use the given delimiter to parse hierarchy from intents name (default: "/") |
--flat hierarchical-delimiter | Don't import intents as a hierarchy (see hierarchical-delimiter option) |
#
Exporting a workspaceTo export a workspace from HumanFirst to an existing DialogFlow CX agent, run:
To find where to find the workspace id, see this.
To export a workspace from HumanFirst to a new DialogFlow CX agent, run:
Different options are available to control the export process:
Option | Description |
---|---|
--workspace value | Specifies the workspace id to export |
--agent value | Specifies the DialogFlow agent identifier to export to (unique id or unique display name) |
--create | Create a new agent |
--language value | Language code from which data is exported (ex: en, en-us). See the list of supported languages. |
--no-backup | Don't backup the agent to a local file before exporting to it |
--hierarchical-delimiter value | Use the given delimiter to encode hierarchy in intents name (default: "/") |
--flat hierarchical-delimiter | Don't export intents as a hierarchy (see hierarchical-delimiter option) |
--skip-empty-intents | Don't export intents that don't have any training phrases |
--intent-tag-predicate value | Intent selection predicate (ex: tag1 -tag2 +tag3) |