Botium Connector for Google Assistant
MIT License
This is a Botium connector for testing your Action in Google Assistant.
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 registers itself with the Google Assistant SDK as "virtual device" to talk to your Google Action.
IMPORTANT: The Google Assistant SDK this Botium connector is buildling upon is currently in ALPHA state and not considered to be ready for production use
It can be used as any other Botium connector with all Botium Stack components:
#me
BUTTON yes
#bot
BUTTONS yes|no|cancel
#bot
MEDIA https://www.botium.at/images/logo.png
#bot
<speak>Hello <break time='300ms'/> World</speak>
#bot
Title of List
CARDS First|Second
#bot
simple response
MEDIA https://www.botium.at/images/logo.png
BUTTONS button1|button2
When using Botium CLI:
> npm install -g botium-cli
> npm install -g botium-connector-google-assistant
> botium-cli init
> botium-cli run
When using Botium Bindings:
> npm install -g botium-bindings
> npm install -g botium-connector-google-assistant
> botium-bindings init mocha
> npm install && npm run mocha
When using Botium Box:
Already integrated into Botium Box, no setup required
The connector repository includes a tool to compose the Botium capabilities (including private keys, access tokens etc). Create a project directory of your choice, and follow the steps below.
There are several ways of running this tool, depending on how you installed it:
When you are using the Botium CLI, then just run
> botium-cli init-google-assistant
When you installed the NPM package for this repository, then run
> npx botium-connector-google-assistant-init
When you cloned or downloaded this repository, and you are in the samples/convo folder, then run
> npm run init-google
or
> npx botium-connector-google-assistant-init
Follow the suggested steps:
A file named botium.json is generated containing the required capabilities to be used with Botium.
To check the configuration, run the emulator (Botium CLI required) to bring up a chat interface in your terminal window:
> botium-cli emulator
Botium setup is ready, you can begin to write your BotiumScript files.
There is a small tech demo in samples/convo with Botium Bindings. You can see there how to deal with different UI elements.
Before start create botium.json, and use this as Dialogflow project.
Start the test with:
> npm install
> npm test
Either set global with capabilities GOOGLE_ASSISTANT_LOCATION_LATITUDE and GOOGLE_ASSISTANT_LOCATION_LONGITUDE (see below).
Or with the UPDATE_CUSTOM logic hook in BotiumScript:
location
#begin
UPDATE_CUSTOM LOCATION|LATITUDE|48.210033
UPDATE_CUSTOM LOCATION|LONGITUDE|16.363449
#me
hi
#bot
...
Or for individual conversation steps (if this makes sense at all to switch location within a conversation ...):
location
#me
hi
UPDATE_CUSTOM LOCATION|LATITUDE|48.210033
UPDATE_CUSTOM LOCATION|LONGITUDE|16.363449
#bot
...
Set the capability CONTAINERMODE to google-assistant to activate this connector.
See downloaded credential file
See downloaded credential file
The simpliest way to acquire it, is the initialization tool described above
Set it to "authorized_user"
If you want Botium to launch your own Google Action before starting a test case. It is something like "Talk to my test app" if the name of your app is "my test app", which is the default value.
Use "Cancel"
Location latitude
Location longitude