7

I'm looking at getting a very quick prototype together for a piece of software I'm demoing, and I'd like to be able to say a phrase to the Google Assistant and have it read back a phrase that's been set on the fly from the software.

I'm thinking of something along the lines of:

  1. I enter a phrase into my software and click some save button.
  2. My software saves this phrase in a document on Google Drive.
  3. I say a certain phrase to the assistant.
  4. The assistant reads back phrase from the Google Drive document.

Just to clarify, I'm only looking for help with point 4. The rest should be straightforward.

Is this possible at all? I don't mind a hacky solution as it's just for a short proof-of-concept demo.

5

To make this kind of experiment most easy is to use API.ai (a tool acquired by Google just before Google Home was born [1]).

In API.ai you can very easily imitate the flow with data that is given with one command and read with another, but with actual Google Drive it is also possible to build the exact flow you have.

Your described flow is done like this:

  1. Use an Intent to wake up API.ai and an Action to do sth with the data in Response [1]. In Action you will create a custom Fulfillment with for example Node.js [2] and there..
  2. ..get use of Node.js version of the REST api of Google Drive to handle the document.
  3. Use another Intent in API.ai to generate another Action and call another Fulfillment and to call another action..
  4. ..in Node.js to communicate to other direction and fetch the data from Google Drive REST API and call out the data in Response to the Intent in API.ai.

[1] https://www.smashingmagazine.com/2017/05/build-action-google-home-api-ai/#google-actions-and-api-ai

[2] https://medium.com/google-cloud/how-to-create-a-custom-private-google-home-action-260e2c512fc

[3] https://developers.google.com/drive/v3/web/quickstart/nodejs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.