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
- Tải Python 3.6.4 (hoặc mới hơn 3.x) từ python.org.
- Chạy file cài > QUAN TRỌNG: Tích "Add Python 3.6 to PATH" > Customize installation.
- Tích tất cả tính năng > Next.
- Tích "Add Python to environment variables" > Install.
- Đợi xong > Restart máy.
- 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).
- Vào Google Cloud Platform Console > CREATE PROJECT (đăng nhập Google).
- Đặt tên dự án (ví dụ: windows10-assistant) > Create. Ghi nhớ Project ID.
- Đợi tạo xong (biểu tượng chuông quay) > Nhấn chuông > chọn project vừa tạo.
- Menu trái > APIs & Services > Library.
- Tìm "Google Assistant" > Click Google Assistant API > ENABLE.
- Menu trái > Credentials > Create credentials > Help me choose.
- Điền:
- Which API: Google Assistant API
- Calling from: Other UI (e.g. Windows, CLI tool)
- Data accessed: User data
- Nhấn What credentials do I need?.
- Chọn Set up consent screen > Application type: Internal > Tên app = tên project > Save.
- Quay lại màn hình credentials > Create Credentials > Help me choose > làm lại bước 7 > Next.
- Đặt tên Client ID (tùy ý) > Create Client ID.
- 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.
- 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
- Mở Command Prompt (Admin).
- Chạy:
py -m pip install google-assistant-sdk[samples]
- Chạy tiếp:
pip install --upgrade google-auth-oauthlib[tool]
- 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. - 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
- Lệnh sẽ trả về một URL. Copy URL này (không đóng CMD).
- 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.
- Trang tiếp theo hiển thị Access Token (mã code). Copy mã này.
- 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
- Mở Command Prompt (Admin) mới.
- Test micro: chạy lệnh ghi âm 5s:
py -m googlesamples.assistant.grpc.audio_helpers
Hoặc:googlesamples-assistant-audiotest --record-time 10. - Nếu nghe lại được âm thanh 5s > OK.
- Đă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"
- 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!