Web Simulator Guide

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

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.

Actions SDK

  1. 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.

  1. Go to the web simulator and click Start. If prompted, authorize the web simulator to access the same Google account that you used with gactions.
  2. Start the action with "talk to <your agent name>".

API.AI

  1. Click on Integrations and then the Actions on Google card.
  2. 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.
  3. Click Authorize to give API.AI access to your Google Account to preview actions in. After the authorization flow, the PREVIEW button appears.
  4. Click PREVIEW and wait for the deployment to finish.
  5. 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.
  6. 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

  1. 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.
  2. In the Log area, copy and paste the URL from the debugInfo.sharedDebugInfo.debugInfo field 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 agentInfo.accountLinking object.
  3. Follow the OAuth login flow to completion. The account linking works if you are redirected to google.com with a URL param of result_code=SUCCESS.
  4. In the web simulator, invoke your action again using "talk to <invocation name>". Now, your action should initiate a dialog and an access_token is available in all HTTP requests to your fulfillment endpoint.