-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetupGoogleAssistant.sh
50 lines (35 loc) · 1.67 KB
/
setupGoogleAssistant.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
CURRENT_DIR="$(pwd)"
INSTALL_BASE=${INSTALL_BASE:-"$CURRENT_DIR"}
echo "Enter informations for Google Assistant SDK."
read -r -p "Your credentiail JSON filename:" credentialfilename
echo ""
read -r -p "Your Google Cloud Console Project-Id: " projectid
echo ""
read -r -p "Device Model ID of your device:" modelid
echo ""
# for google Assistant
sudo apt-get -y install python3-dev python3-venv # Use python3.4-venv if the package cannot be found.
sudo apt-get -y install portaudio19-dev libffi-dev libssl-dev
python3 -m venv env
env/bin/python -m pip install --upgrade pip setuptools wheel
source env/bin/activate
python -m pip install --upgrade google-assistant-library
python -m pip install --upgrade google-assistant-sdk[samples]
python -m pip install --upgrade google-auth-oauthlib[tool]
google-oauthlib-tool --client-secrets "$CURRENT_DIR/$credentialfilename" --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless
python -m pip install posix_ipc
cp patch/GoogleAssistant/posixqueue.py env/lib/python*/site-packages/googlesamples/assistant/grpc
cp patch/GoogleAssistant/googlesamples-assistant-posixqueue env/bin/
chmod 755 env/bin/googlesamples-assistant-posixqueue
cat << EOF > "startGoogleAssistant.sh"
#!/bin/bash
source env/bin/activate
googlesamples-assistant-posixqueue --project-id $projectid --device-model-id $modelid --display
EOF
chmod +x startGoogleAssistant.sh
echo "================================================================"
echo 'Install finished.'
echo 'You can run Google Assistant hotword sample following command.'
echo '"./startGoogleAssistant.sh"'
echo "================================================================"