The web simulator lets you preview actions that you've built in API.AI or the Actions SDK in an easy-to-use interface with debugging and voice input. It helps you make sure that your Conversation Actions actually sound conversational and let you use the device without having hardware
Previewing actions makes them available only within the Google account that you use for development. This allows you to test actions before deploying them to production.
Run the following command to deploy an action:
./gactions preview -action_package=<project-dir>/agent.json -invocation_name="your agent name"
You should receive a message to authorize
gactions to access your Google account and
Google developer project. Follow the onscreen instructions to do so.
- Go to the web simulator and
click Start. If prompted,
authorize the web simulator to access the same Google account that you used with
- Start the action with "talk to <your agent name>".
- Click on Integrations and then the Actions on Google card.
- Enter the following information to preview your action:
- Invocation name for testing - Your agent name
- TTS voice - Select a voice that fits your agent's persona
- Welcome Intent - Your default welcome intent.
- Additional triggering intents - Any other deep link invocation intents.
- Click Authorize to give API.AI access to your Google Account to preview actions in. After the authorization flow, the PREVIEW button appears.
- Click PREVIEW and wait for the deployment to finish.
- Go to the web simulator and click Start. If prompted, authorize the web simulator to access the same Google account that you used with API.AI.
- Start the action with "talk to
Testing account linking
To test out if account linking works you have two choices: on a Google Home device or with the Google Home web simulator. We recommend that you use Google Home device to see the actual flow users go through on their mobile devices.
Testing on a Google Home device
Open the Google Home app and go to the Discover tab. You will see a Live Card that will launch to the account linking flow. The Home app and the Google Home device must be signed into the same account that you used to preview the action.
Testing on the Google Home web simulator
- Invoke your action for the first time using "talk to <invocation name>". Since it is your first time invoking the action with your Google account, the Google Assistant notifies you that you must link your account.
- In the Log area, copy and paste the URL from the
debugInfo.sharedDebugInfo.debugInfofield into your web browser. You will be redirected to the authentication URL for your own server that was specified in API.AI or in your action package's
- Follow the OAuth login flow to completion. The account linking works if you are redirected to google.com with a URL param of
- In the web simulator, invoke your action again using "talk to <invocation name>".
Now, your action should initiate a dialog and an
access_tokenis available in all HTTP requests to your fulfillment endpoint.