ເມສາ 14, 2018

ວິທີການຕິດຕັ້ງຜູ້ຊ່ວຍ Google ໃນ Windows 10

How to Install Google Assistant on Windows 10: Google Assistant is a virtual personal assistant rolled out by Google to Android devices to enter the AI assistants’ market. Today, many AI assistants are claiming to be the best, like Siri, Amazon Alexa, Cortana, etc. However, by far, Google Assistant is one of the best available on the market. The only problem with Google Assistant is that it’s not available on PC, as it is only available on mobile and smart home devices.

ວິທີການຕິດຕັ້ງຜູ້ຊ່ວຍ Google ໃນ Windows 10

To get Google Assistant on PC, you need to follow command-line instructions, which is the only way to get it on PC. Anyway, without wasting any time, let’s see How to Get Google Assistant on Windows 10 with the below-listed guide’s help.

ວິທີການຕິດຕັ້ງຜູ້ຊ່ວຍ Google ໃນ Windows 10

ໃຫ້ແນ່ໃຈວ່າສ້າງຈຸດຟື້ນຟູພຽງແຕ່ໃນກໍລະນີທີ່ມີບາງຢ່າງຜິດພາດ.

ກໍາຫນົດເບື້ອງຕົ້ນ:

1. First, you need to download Python ເທິງຄອມພິວເຕີຂອງທ່ານ.

2. Download Python 3.6.4 from the link, then double-click on python-3.6.4.exe to run the setup.

3. ໝາຍຕິກ “Add Python 3.6 to PATH,” ຫຼັງ​ຈາກ​ນັ້ນ​ໃຫ້​ຄລິກ​ໃສ່​ Customize installation.

Checkmark 'Add Python 3.6 to PATH' then click on Customize installation

4. Make sure everything is checked in the window, then click ຕໍ່ໄປ.

Make sure everything is checked in the window then click Next

5. On the next screen, just make sure to ເຄື່ອງ ໝາຍ ກວດກາ "Add Python to environment variables. "

Checkmark Add Python to environment variables and click Install

6. Click Install, then wait for Python to get installed on your PC.

Click Install then wait for Python to get installed on your PC

7. Once the installation is complete, restart your PC.

8. Now, press Windows Key + X, then select Command Prompt (Admin).

ຄລິກຂວາໃສ່ປຸ່ມ Windows ແລະເລືອກ Command Prompt (Admin)

9. ພິມຄໍາສັ່ງຕໍ່ໄປນີ້ໃສ່ cmd ແລ້ວກົດ Enter:

python

Type python in command prompt and it should return the python version installed on your PC

10. If the above command will return the current Python version on your computer, then you have successfully installed Python NumPy on your PC.

ຂັ້ນຕອນທີ 1: ຕັ້ງຄ່າ Google Assistant API

With this step, you can use Google Assistant on Windows, Mac, or Linux. Just install the python on each of these OS to properly configure Google Assistant API.

1. ທໍາອິດ, ໃຫ້ໄປທີ່ Google Cloud Platform Console website ແລະຄລິກໃສ່ CREATE PROJECT. 

ຫມາຍ​ເຫດ​: You might need to sign in with your Google account.

On Google Cloud Platform Console website click CREATE PROJECT

2. Name your project appropriately, ຈາກນັ້ນກົດເຂົ້າ ສ້າງ.

ຫມາຍ​ເຫດ​: Make sure to note down the project ID, in our case, its windows10-201802. 

Name your project appropriately then click on Create

3. Wait till your new project is created (you will notice a spinning circle on the bell icon at the top right corner).

Wait till your new project is created

4. Once the process is done click on the bell icon and select your project.

Click on the bell icon and select your project

5. On the project page, from the left-hand menu, click on APIs & Services, ຫຼັງຈາກນັ້ນເລືອກເອົາ ຫ້ອງສະຫມຸດ

Click on APIs & Services then select Library

6. On the library page, search for “Google Assistant” (without quotes) in the search console.

On library page search for Google Assistant in the search console

7. Click on Google Assistant API search result and then click on ເປີດໃຊ້ງານ.

Click on Google Assistant from search result then click on Enable

8. Now, from the left-hand menu, click on Credentials, then click “ສ້າງ ສິດທິພິເສດ” ແລະ​ຫຼັງ​ຈາກ​ນັ້ນ​ເລືອກ​ເອົາ​ Help me choose.

From the left-hand menu click on Credentials then click Create credentials

9. Choose the following information on the “Add credentials to your project” screen:

Question: Which API are you using? 
Answer: Google Assistant API

Question: Where will you be calling the API form?
Answer: Other UI (e.g. Windows, CLI tool)

Question: What data will you be accessing?
Answer: User data

10. After answering all of the above questions, click on “What credentials do I need?".

Click on What credentials do I need

11 ເລືອກເອົາ Set up consent screen and choose the Application type to ພາຍໃນ. Type the project name in the Application name and click ຊ່ວຍປະຢັດ.

12. Again, go back to the “Add credentials to your project” screen, then click on ສ້າງຂໍ້ມູນປະຈໍາຕົວ ແລະເລືອກເອົາ ຊ່ວຍຂ້ອຍເລືອກ. Follow the same instructions as you did on step 9 and proceed forward.

13. ຕໍ່ໄປ, type the name of the Client ID (name it anything you like) to create OAuth 2.0 client ID ແລະຄລິກໃສ່ Create Client ID ປຸ່ມ.

Next type the name of the Client ID and click Create Client ID

14. ຄລິກ ແລ້ວໆ, then open a new tab and go to Activity controls from ການເຊື່ອມຕໍ່ນີ້.

Make sure all the toggles are turned ON in Activity Controls page

15​. Make sure all the toggles are turned ON ແລະຫຼັງຈາກນັ້ນກັບໄປທີ່ Credentials tab.

16​. ຄລິກທີ່ໄອຄອນດາວໂຫຼດ in the far right of the screen to download the credentials.

Click the download icon in the far right of the screen to download the credentials

ຫມາຍ​ເຫດ​: Save the credentials file somewhere easily accessible.

ຂັ້ນຕອນທີ 2: Install Google Assistant Sample Python Project

1. ກົດ Windows Key + X ຈາກນັ້ນເລືອກ Command Prompt (Admin).

ຄລິກຂວາໃສ່ປຸ່ມ Windows ແລະເລືອກ Command Prompt (Admin)

2. ພິມຄໍາສັ່ງຕໍ່ໄປນີ້ໃສ່ cmd ແລ້ວກົດ Enter ຫຼັງຈາກແຕ່ລະອັນ:

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

Use install pip command into Command Prompt

3. Once the above command finishes executing, type the below command and hit Enter.

pip install --upgrade google-auth-oauthlib[tool]

4. Navigate to the JSON file location that you downloaded earlier and ຄລິກຂວາໃສ່ມັນ ແລະເລືອກຄຸນສົມບັດ. In the name field, copy the file name and paste it inside notepad.

5. Now enter the below command but make sure to replace the “path/to/client_secret_XXXXX.json” with the actual path of your JSON file which you copied above:

google-oauthlib-tool --client-secrets path/to/client_secret_XXXXX.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless

Authorize the URL by visiting & then enter the authorization code

6. Once the above command finishes processing, you get a URL as the output. ໃຫ້ແນ່ໃຈວ່າ copy this URL as you will require it in the next step. 

ຫມາຍ​ເຫດ​: Don’t close the Command Prompt just yet.

Authorize the URL by visiting & then enter the authorization code

7. Open your Web browser and navigate to this URL, then select the same ບັນຊີ Google that you used to configure the Google Assistant API.

Select the same Google account that you used to configure the Google Assistant API

8. ໃຫ້ແນ່ໃຈວ່າໃຫ້ຄລິກໃສ່ ອະນຸຍາດໃຫ້ to grant the necessary permission to run Google Assitant.

9. On the next page, you will see some code that will be your client’s Access Token.

On the next page you will see Client’s Access Token

10. Now switch back to the Command prompt and copy this code & paste it into cmd. If everything goes alright you see an output that says that your credentials have been saved.

If everything goes alright you see an output which says that your credentials have been saved

ຂັ້ນຕອນທີ 3: Testing Google Assistant on Windows 10 PC

1. ກົດ Windows Key + X ຈາກນັ້ນເລືອກ Command Prompt (Admin).

ຄລິກຂວາໃສ່ປຸ່ມ Windows ແລະເລືອກ Command Prompt (Admin)

2. Now we need to test if Google Assistant can properly access your microphone. Type the below command into cmd and hit Enter, which will start a 5-second audio recording:

py -m googlesamples.assistant.grpc.audio_helpers

3. If you can successfully hear the 5-second audio recording back, you can move to the next step.

ຫມາຍ​ເຫດ​: You can also use the below command as an alternative:

googlesamples-assistant-audiotest --record-time 10

Record 10 seconds of audio samples and play them back

4. You need to Register your Device before you can start using Google Assistant on Windows 10 PC.

5. Next, type the below command and press Enter:

cd C:GoogleAssistant

6. Now type the following command but replace the “project-id” with the actual project id that you have created in the first step. In our case it was windows10-201802.

googlesamples-assistant-devicetool --project-id register-model --manufacturer "Assistant SDK developer" --product-name "Assistant SDK light" --type LIGHT --model "GA4W"

successfully register the device model

7. Next, to enable Google Assistant Push to Talk (PTT) capabilities, enter the below command below but make sure to replace “project-id” with the actual project id:

py -m googlesamples.assistant.grpc.pushtotalk --device-model-id “GA4W” --project-id

ຫມາຍ​ເຫດ​: The Google Assistant API supports every command that Google Assistant supports on Android and Google Home.

You have successfully installed & configured Google Assistant on your Windows 10 PC. Once you enter the above command, simply press Enter and you can ask any questions directly to Google Assistant without having to say “OK, Google” command.

ແນະນໍາໃຫ້:

ພວກເຮົາຫວັງວ່າຄູ່ມືນີ້ເປັນປະໂຫຍດແລະທ່ານສາມາດ install Google Assistant on Windows 10 PC without any issues. But if you still have any questions regarding this guide, then feel free to ask them in the comment section.