You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nicolas Garnier
dc2519ea4a
|
8 years ago | |
---|---|---|
.. | ||
functions | 8 years ago | |
README.md | 8 years ago | |
action.json | 8 years ago | |
firebase.json | 8 years ago |
README.md
Google Assistant action that reads the ordinal of a number.
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
Functions Code
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.
Deploy and test
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"