[PYTHON] How to use Google Assistant on Windows 10

Overview

I didn't have much information when I wanted to use Google Assistant on Windows, so I will summarize what I searched for. However, as of August 19, 2020, it seems that the available functions are limited. Details are summarized below.

Execution environment

・ Python == 3.6 ・ Windows10

Available features

I quoted from here. https://developers.google.com/assistant/sdk/overview

Supported architectures All gRPC platforms
Supported languages All gRPC languages
Hands-free activation No
Audio capture and playback Reference code is provided
Conversation state management Reference code is provided
Timers and alarms No
Playback of podcasts and news No
Broadcast voice messages No
Visual output (HTML5) of Assistant responses Yes

You can check the latest information from this URL. https://developers.google.com/assistant/sdk/release-notes

Environment

  1. Python environment construction is omitted here.

  2. Open Google Cloud Platform and click ** "Create Project" ** in the upper left. https://console.cloud.google.com/cloud-resource-manager 001.png

  3. Enter any name you like in Project name. (The project ID can be changed, but it must be all lowercase and end with a single-byte number.) 002.png

  4. Open the Google Assistant APIs in a separate tab. https://console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview 003.png自分の作ったプロジェクトを選択し、Openをクリック。 004.png

  5. Click ** "CREATEC REDENTIALS" ** on the upper right. 005.png

  6. Fill in the selection fields as shown in the image. Then click ** "What credentials do I need?" **. Then click ** "SET UP CONCENT SCREAN" **. 006.png

  7. Then select ** "External" ** ** "CREATE" ** 007.png

  8. Decide on a Project name. However, it may not be recognized that it contains a famous company name such as Google. Then click ** "SAVE" ** at the bottom. 008.png

  9. Go back to ** "Credentials" ** with the lock on the right. Select ** "Help me choose" ** from ** "+ CREATE CREDENTIALS" ** above. 004.png

  10. Fill the selection field again as shown in the image. 005.png

  11. Then decide on the name of ** "client id" **. Then click ** "Create OAuth client ID" **. 006.png

  12. Enter ** "Create ID" ** and press ** "Download" **. (The file downloaded here is not used.) 010.png

  13. Press ** "Done" ** and then press the arrow on the far right of your project column to download the json file. 011.png

  14. Create a folder directly under the C drive for the json file downloaded here and put it there. 007.png

  15. Install the Google Assistant SDK by typing the following from the command prompt.

py -m pip install google-assistant-sdk[samples]

16 Next, enter the following to install.

py -m pip install google-auth-oauthlib[tool]

17 Enter the following at the command prompt.

google-oauthlib-tool --client-secrets C:\The location of the json file\ --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless

18 Copy the displayed URL and search with a browser. Click Allow twice to allow integration with your account. You will see the code you need to sign in, so copy it. 008.png 009.png

19 Return to the command prompt, paste the copied code and press Enter. The information in the json file is saved in your account.

Once you have completed 20 or more operations, you can test the recording and playback with the following chords.

py -m googlesamples.assistant.grpc.audio_helpers

010.png

21 Move the json file to the folder where it is located on the command prompt.

22 Enter the following command on that folder.

googlesamples-assistant-devicetool --project-id my project ID register-model --manufacturer “Please decide the manufacturer name yourself”--product-name “Please decide the product name yourself”--type LIGHT --model “Anything is fine.”

23 Finally, enter the following command.

py -m googlesamples.assistant.grpc.pushtotalk --device-model-id “My model ID”--project-id your project ID

24 If successful, you will see ** "Please Enter to send a new request ..." **. After entering Enter, he will answer that you can talk. (However, it is in English at this time.)

reference

https://www.lifewire.com/google-assistant-on-windows-4628292

Recommended Posts

How to use Google Assistant on Windows 10
How to use Dataiku on Windows
How to use Google Colaboratory
How to use Django on Google App Engine / Python
Notes on how to use pywinauto
How to install pycrypto on Windows
Notes on how to use featuretools
How to use homebrew on Debian
[Memo] How to use Google MµG
Notes on how to use doctest
How to install music 21 on windows
How to use VS Code in venv environment on windows
[Kivy] How to install Kivy on Windows [Python]
How to use mecab, neologd-ipadic on colab
How to use Google Test in C
How to use Cmder with PyCharm (Windows)
Memorandum on how to use gremlin python
How to install richzhang / colorization on Windows 10
How to use xml.etree.ElementTree
How to use virtualenv
How to use Seaboan
How to use image-match
How to use shogun
How to use Pandas 2
How to use Virtualenv
How to use numpy.vectorize
How to use pytest_report_header
How to use partial
How to use SymPy
How to use x-means
Use pyvenv on Windows
How to use WikiExtractor.py
How to use IPython
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
How to use TokyoTechFes2015
How to use venv
How to use dictionary {}
How to use Pyenv
How to use list []
How to use python-kabusapi
Use Ansible on Windows
How to use OptParse
Use QuTiP on Windows
Use pip on Windows
How to use return
How to use dotenv
How to use pyenv-virtualenv
How to use Go.mod
How to use imutils
How to use import
How to use Python Kivy ④ ~ Execution on Android ~
How to quickly install h5py on Windows 10 [Unofficial]
How to use the Google Cloud Translation API
How to live a decent life on 2017 Windows
[Python] How to install OpenCV on Anaconda [Windows]
[Windows] Memo to use Keras on GPU [Tensorflow-GPU]
How to install / verify graphviz on anaconda / windows10
How to install Python [Windows]