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!
Botium runs your conversations against the Dialogflow CX API.
It can be used as any other Botium connector with all Botium Stack components:
- 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
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
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:
dialogflow.sessions.detectIntent
roles/dialogflow.client roles/dialogflow.consoleSimulatorUser
dialogflow.intents.list dialogflow.agents.get dialogflow.flows.get dialogflow.pages.get
roles/dialogflow.aamViewer
dialogflow.intents.*
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>"
}
}
}
Set the capability CONTAINERMODE to dialogflowcx to activate this connector.
Google project id.
Location
Location
Dialogflow publishing environment name. See This article
Optional
Google client email. If not given, Google default authentication will be used.
Optional
Google private key. If not given, Google default authentication will be used.
The language of this conversational query. See all languages.
Query parameters as JSON struct.
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"}]}