botium-connector-dialogflowcx
v0.2.10
Published
Botium Connector for Google Dialogflow CX
Downloads
146
Readme
Botium Connector for Google Dialogflow CX
This is a Botium connector for testing your Dialogflow CX Agents.
Did you read the Botium in a Nutshell articles ? Be warned, without prior knowledge of Botium you won't be able to properly use this library!
How it works ?
Botium runs your conversations against the Dialogflow CX API.
It can be used as any other Botium connector with all Botium Stack components:
Requirements
- Node.js and NPM
- a Dialogflow CX agent, and user account with administrative rights
- a project directory on your workstation to hold test cases and Botium configuration
Install Botium and Dialogflow CX Connector
When using Botium CLI:
> npm install -g botium-cli
> npm install -g botium-connector-dialogflowcx
> botium-cli init
> botium-cli run
When using Botium Bindings:
> npm install -g botium-bindings
> npm install -g botium-connector-dialogflowcx
> botium-bindings init mocha
> npm install && npm run mocha
When using Botium Box:
Already integrated into Botium Box, no setup required
Connecting Dialogflow Agent to Botium
Open the file botium.json in your working directory and add the Google credentials for accessing your Dialogflow agent. Project Id, Agent Id and Location can be found in the Dialogflow CX Console.
Following permissions/roles are required to use botium:
To test:
Permission:
dialogflow.sessions.detectIntent
We suggest to use one of the following roles:
roles/dialogflow.client roles/dialogflow.consoleSimulatorUser
To use downloader (optional):
Permissions:
dialogflow.intents.list dialogflow.agents.get dialogflow.flows.get dialogflow.pages.get
Many roles can be good, for example
roles/dialogflow.aamViewer
To use uploader (optional):
Permissions:
dialogflow.intents.*
Following role have this permission:
roles/dialogflow.intentAdmin
You can read about Google Dialogflow roles here
{
"botium": {
"Capabilities": {
"PROJECTNAME": "<whatever>",
"CONTAINERMODE": "dialogflowcx",
"DIALOGFLOWCX_PROJECT_ID": "<google project id>",
"DIALOGFLOWCX_AGENT_ID": "<agent id>",
"DIALOGFLOWCX_LOCATION": "<location>",
"DIALOGFLOWCX_CLIENT_EMAIL": "<service credentials email>",
"DIALOGFLOWCX_PRIVATE_KEY": "<service credentials private key>"
}
}
}
Supported Capabilities
Set the capability CONTAINERMODE to dialogflowcx to activate this connector.
DIALOGFLOWCX_PROJECT_ID
Google project id.
DIALOGFLOWCX_LOCATION
Location
DIALOGFLOWCX_AGENT_ID
Location
DIALOGFLOWCX_ENVIRONMENT
Dialogflow publishing environment name. See This article
DIALOGFLOWCX_CLIENT_EMAIL
Optional
Google client email. If not given, Google default authentication will be used.
DIALOGFLOWCX_PRIVATE_KEY
Optional
Google private key. If not given, Google default authentication will be used.
DIALOGFLOWCX_LANGUAGE_CODE
The language of this conversational query. See all languages.
DIALOGFLOWCX_QUERY_PARAMS
Query parameters as JSON struct.
DIALOGFLOWCX_WELCOME_TEXT
Welcome text(s) to send to the Dialogflow CX agent for initiating the session.
It is possible to send button/event instead of text
"DIALOGFLOWCX_WELCOME_TEXT": {"buttons": [{"payload": "MyCustomEvent"}]}