How to Install Google Assistant on Windows 10: Google Assistant เป็นผู้ช่วยเสมือนจริงที่ Google เปิดตัวให้อุปกรณ์ Android เพื่อเข้าสู่ตลาด AI Assistants ปัจจุบันมี AI Assistants หลายตัวเด้งว่าดีที่สุด เช่น Siri, Amazon Alexa, Cortana แต่ Google Assistant ถือเป็นหนึ่งในที่ดีที่สุด ปัญหาคือ ไม่มีให้ PC ใช้งาน โดยมีเฉพาะ Mobile และ Smart Home Devices
เพื่อใช้ Google Assistant บน PC ต้องใช้คำสั่ง Command-line เท่านั้น มาเริ่มกันเลย
วิธีติดตั้ง Google Assistant บน Windows 10
สร้าง Restore Point ก่อนล่ะ
ข้อกำหนดเบื้องต้น (Prerequisites):
- ดาวน์โหลด Python บน PC ก่อน
- ดาวน์โหลด Python 3.6.4 คลิกสองครั้ง python-3.6.4.exe รัน Setup
- ติ๊ก "Add Python 3.6 to PATH" คลิก Customize installation
- ติ๊กทุกอย่างในหน้าต่าง คลิก Next
- หน้าต่างถัดไป ติ๊ก "Add Python to environment variables"
- คลิก Install รอ Python ติดตั้งเสร็จ
- ติดตั้งเสร็จ รีสตาร์ทคอมพิวเตอร์
- กด Windows Key + X เลือก Command Prompt (Admin)
- พิมพ์ python กด Enter
- ถ้าคำสั่งคืนค่า Python version ปัจจุบัน แสดงว่าติดตั้ง Python สำเร็จ
ขั้นตอนที่ 1: ตั้งค่า Google Assistant API
ขั้นตอนนี้ใช้ได้กับ Windows, Mac, Linux เพียงติดตั้ง Python บน OS แต่ละตัว
- ไปที่ Google Cloud Platform Console คลิก CREATE PROJECT
หมายเหตุ: อาจต้อง Sign in ด้วย Google Account - ตั้งชื่อ Project ให้เหมาะสม คลิก Create
หมายเหตุ: บันทึก Project ID ไว้ (เช่น windows10-201802) - รอสร้าง Project เสร็จ (จะเห็นวงกลมหมุนที่ไอคอน มุมขวาบน)
- เสร็จแล้ว คลิกไอคอน เลือก Project ของคุณ
- ในหน้า Project จากเมนูซ้าย คลิก APIs & Services > Library
- หน้า Library ค้นหา "Google Assistant" ใน Search Console
- คลิก Google Assistant API ผลลัพธ์ > คลิก Enable
- จากเมนูซ้าย คลิก Credentials > "Create credentials" > Help me choose
- ตอบคำถามในหน้า "Add credentials to your project":
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
- ตอบครบแล้ว คลิก "What credentials do I need?"
- เลือก Set up consent screen เลือก Application type เป็น Internal ใส่ชื่อ Project ใน Application name คลิก Save
- กลับไปหน้า "Add credentials to your project" อีกครั้ง คลิก Create Credentials > Help me choose ทำซ้ำขั้นตอนที่ 9
- ตั้งชื่อ Client ID (ตั้งชื่ออะไรก็ได้) เพื่อ Create OAuth 2.0 Client ID คลิก Create Client ID
- คลิก Done เปิด Tab ใหม่ ไปที่ Activity Controls จากลิงก์นี้
- เปิด Toggle ทั้งหมดให้ ON แล้วกลับไปที่ Credentials tab
- คลิกไอคอนดาวน์โหลด ขวามือ เพื่อ ดาวน์โหลด Credentials
หมายเหตุ: บันทึกไฟล์ Credentials ไว้ที่หาง่าย
ขั้นตอนที่ 2: ติดตั้ง Google Assistant Sample Python Project
- กด Windows Key + X เลือก Command Prompt (Admin)
- พิมพ์คำสั่ง:
py -m pip install google-assistant-sdk[samples]
- รอคำสั่งเสร็จ พิมพ์คำสั่งถัดไป:
pip install --upgrade google-auth-oauthlib[tool]
- ไปที่ไฟล์ JSON ที่ดาวน์โหลดไว้ คลิกขวา Properties คัดลอกชื่อไฟล์ วางใน Notepad
- พิมพ์คำสั่ง (แทนที่ path/to/client_secret_XXXXX.json ด้วย Path จริง):
google-oauthlib-tool --client-secrets path/to/client_secret_XXXXX.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless
- คำสั่งเสร็จ จะได้ URL เป็น Output คัดลอก URL นี้ไว้ จะใช้ในขั้นตอนถัดไป
หมายเหตุ: อย่าปิด Command Prompt - เปิด Browser ไปที่ URL นั้น เลือก Google Account เดียวกัน ที่ใช้ตั้งค่า Google Assistant API
- คลิก Allow ให้สิทธิ์รัน Google Assistant
- หน้าถัดไป จะมีโค้ดบางอย่าง เป็น Client's Access Token
- กลับไป Command Prompt วางโค้ดนั้นลงไป ถ้าผ่าน จะแสดงว่า Credentials ถูกบันทึกแล้ว
ขั้นตอนที่ 3: ทดสอบ Google Assistant บน Windows 10 PC
- กด Windows Key + X เลือก Command Prompt (Admin)
- ทดสอบ Microphone คำสั่งนี้จะบันทึกเสียง 5 วินาที:
py -m googlesamples.assistant.grpc.audio_helpers
- หา ได้ยินเสียง 5 วินาทีกลับมา ไปขั้นตอนต่อได้
ตัวเลือก: ใช้คำสั่งนี้แทนได้:googlesamples-assistant-audiotest --record-time 10
- ต้อง Register Device ก่อนใช้ Google Assistant ได้
- พิมพ์คำสั่ง:
cd C:\GoogleAssistant
- พิมพ์คำสั่ง (แทนที่ project-id ด้วย Project ID จริง เช่น windows10-201802):
googlesamples-assistant-devicetool --project-id register-model --manufacturer "Assistant SDK developer" --product-name "Assistant SDK light" --type LIGHT --model "GA4W"
- เพื่อเปิดใช้งาน Push to Talk (PTT) พิมพ์ (แทนที่ project-id):
py -m googlesamples.assistant.grpc.pushtotalk --device-model-id "GA4W" --project-id
หมายเหตุ: Google Assistant API รองรับทุกคำสั่งที่ Google Assistant บน Android และ Google Home รองรับ
คุณติดตั้งและตั้งค่า Google Assistant บน Windows 10 PC สำเร็จแล้ว! พิมพ์คำสั่งข้างบน กด Enter แล้วถามคำถามได้เลย ไม่ต้องพูด "OK, Google"
บทความแนะนำ:
- Completely uninstall Norton from Windows 10
- How to Setup Remote Desktop Connection on Windows 10
- Automatically disable Touchpad when Mouse is connected
- How to completely uninstall McAfee from Windows 10
หวังว่าคู่มือนี้จะช่วยให้คุณ ติดตั้ง Google Assistant บน Windows 10 PC ได้โดยไม่มีปัญหา หากยังมีคำถาม ถามในส่วนความคิดเห็นได้เลย