This tutorial will help you get setup using api.ai with our sample project and Bespoken tools.
Ping us on gitter if you have any question.
This tutorial goes great with our Bespoken for Cloud Functions tutorial :-)
This tutorial assumes you have cloned the Super Simple Google Action repository.
If you have not already, do it with this command:
git clone https://github.com/bespoken/super-simple-google-action
Register/login to api.ai account
Go to the api.ai website:
Sign-in or create your account.
Create a new agent
Click on the "Create Agent" button.
Name the agent
Give the agent a name, then click "Save".
After clicking save, click the "Export and Import" tab.
Restore sample action
Select "Restore From Zip":
Click "Select File".
Browse to the directory where you cloned the Super Simple Google Action repository:
Choose "SuperSimpleGoogleAction.zip" from the file picker and click "Open".
If you the click on "Intents" on the left-hand side menu, you should now see the following:
Those intents will be available if the agent was properly restored.
Enable Webhook Fulfillment
Click on Fulfillment from the left-hand menu.
Toggle "Enabled" so that Webhook fulfillment is enabled:
This will cause the configured Intents to call out the specified URL for handling user requests.
The URL should be your
bst proxy endpoint. To find it, just type at the command-line:
bst proxy function index.js simpleFunction
Grab the URL from the console output, which should look like this:
After entering this, click "Save" at the top.
Enable Google Action integration
Select the "Integrations" tab on the left.
Enable the first option, "Actions on Google".
Enter the "World" for the "Invocation Name". If you have a Google Cloud Project setup, enter the ID on this screen. More information here.
If you want to use this Action on your Google Home device or in the Web Simulator, click "Preview".
To use this api.ai Google Action, follow our tutorial here.