Computer >> Hướng Dẫn Máy Tính >  >> Xử Lý Sự Cố >> Lỗi Windows

Cài đặt Google Assistant trên Windows 10: Hướng dẫn từng bước chi tiết

Cách cài Google Assistant trên Windows 10: Google Assistant là trợ lý ảo AI hàng đầu (hơn Siri, Alexa, Cortana...), nhưng chỉ có trên mobile/smart home. Để dùng trên PC, phải dùng dòng lệnh (command-line) – cách duy nhất hiện nay.

Cài đặt Google Assistant trên Windows 10

Tạo điểm khôi phục hệ thống.

Điều kiện tiên quyết: Cài Python

  1. Tải Python 3.6.4 (hoặc mới hơn 3.x) từ python.org.
  2. Chạy file cài > QUAN TRỌNG: Tích "Add Python 3.6 to PATH" > Customize installation.
  3. Tích tất cả tính năng > Next.
  4. Tích "Add Python to environment variables" > Install.
  5. Đợi xong > Restart máy.
  6. Kiểm tra: Win + X > Command Prompt (Admin) > gõ python > Enter. Nên hiển thị phiên bản Python.

Bước 1: Cấu hình Google Assistant API

(Áp dụng Win/Mac/Linux, chỉ cần cài Python trên từng OS).

  1. Vào Google Cloud Platform Console > CREATE PROJECT (đăng nhập Google).
  2. Đặt tên dự án (ví dụ: windows10-assistant) > Create. Ghi nhớ Project ID.
  3. Đợi tạo xong (biểu tượng chuông quay) > Nhấn chuông > chọn project vừa tạo.
  4. Menu trái > APIs & Services > Library.
  5. Tìm "Google Assistant" > Click Google Assistant API > ENABLE.
  6. Menu trái > Credentials > Create credentials > Help me choose.
  7. Điền:
    • Which API: Google Assistant API
    • Calling from: Other UI (e.g. Windows, CLI tool)
    • Data accessed: User data
  8. Nhấn What credentials do I need?.
  9. Chọn Set up consent screen > Application type: Internal > Tên app = tên project > Save.
  10. Quay lại màn hình credentials > Create Credentials > Help me choose > làm lại bước 7 > Next.
  11. Đặt tên Client ID (tùy ý) > Create Client ID.
  12. Nhấn Done > Mở tab mới > vào Activity controls (myactivity.google.com/activitycontrols) > Bật TẤT CẢ toggle > Quay lại tab Credentials.
  13. Nhấn biểu tượng tải xuống (download) ở cột cuối cùng của Client ID vừa tạo > Lưu file JSON (credentials) nơi dễ tìm.

Bước 2: Cài đặt Google Assistant Sample Python Project

  1. Mở Command Prompt (Admin).
  2. Chạy:
    py -m pip install google-assistant-sdk[samples]
  3. Chạy tiếp:
    pip install --upgrade google-auth-oauthlib[tool]
  4. Tìm file JSON credentials vừa tải > chuột phải > Properties > Copy tên file (ví dụ: client_secret_XXXX.json) > dán vào Notepad.
  5. Chạy lệnh sau (thay đường dẫn file JSON thực tế):
    google-oauthlib-tool --client-secrets path/to/client_secret_XXXX.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless
  6. Lệnh sẽ trả về một URL. Copy URL này (không đóng CMD).
  7. Mở trình duyệt > dán URL > Chọn tài khoản Google dùng ở Bước 1 > Nhấn Allow cấp quyền.
  8. Trang tiếp theo hiển thị Access Token (mã code). Copy mã này.
  9. Quay lại CMD > dán mã code > Enter. Thông báo credentials have been saved.

Bước 3: Kiểm tra Google Assistant trên Windows 10

  1. Mở Command Prompt (Admin) mới.
  2. Test micro: chạy lệnh ghi âm 5s:
    py -m googlesamples.assistant.grpc.audio_helpers
    Hoặc: googlesamples-assistant-audiotest --record-time 10.
  3. Nếu nghe lại được âm thanh 5s > OK.
  4. Đăng ký thiết bị (Device Registration): chạy (thay project-id bằng Project ID Bước 1):
    googlesamples-assistant-devicetool --project-id YOUR_PROJECT_ID register-model --manufacturer "Assistant SDK developer" --product-name "Assistant SDK light" --type LIGHT --model "GA4W"
  5. Bật chế độ Push-to-Talk (PTT):
    py -m googlesamples.assistant.grpc.pushtotalk --device-model-id "GA4W" --project-id YOUR_PROJECT_ID

Sau khi chạy lệnh cuối, nhấn Enter và nói trực tiếp với Google Assistant (không cần nói "OK Google"). API hỗ trợ đầy đủ lệnh như trên Android/Google Home.

Bài viết liên quan:

  • Gỡ hoàn toàn Norton khỏi Windows 10
  • Thiết lập Remote Desktop Connection Windows 10
  • Tự động tắt Touchpad khi cắm chuột
  • Gỡ hoàn toàn McAfee khỏi Windows 10

Hy vọng hướng dẫn giúp bạn cài đặt Google Assistant trên Windows 10 thành công. Hãy bình luận nếu có thắc mắc!