This sample shows how to create an action for the Google Home/Assistant using the Actions SDK hosted on Cloud Functions. The sample action asks users to say a number and reads out the ordinal of that number.
e.g. If the user says "Twelve" the action will say "The ordinal of twelve is twelfth".
Further reading:
- Actions SDK: https://developers.google.com/actions/develop/sdk/getting-started#getting-started.
- Firebase SDK: https://firebase.google.com/docs/functions
See file functions/index.js for the code.
Handling the Google Actions requests is done using the Google Actions SDK.
The dependencies are listed in functions/package.json.
To test this sample action:
- Create a Firebase Project using the Firebase Developer Console
- Configure this sample to use your project using
firebase --use add
and select your project. - Deploy your project using
firebase deploy
- In the
action.json
file, update the two<YOUR_PROJECT_ID>
placeholders with your Firebase project ID. The URL should match theFunction URL (sayNumber):
that was printed out byfirebase deploy
. - Download the
gaction
CLI - Make your action available for testing using the
gactions preview action.json
- Test your Action on the Google Home Web Simulator by saying "Talk to My Action"