This package contains a collection of samples and tools to help you get started with the Google Assistant SDK using Python.
You can install using pip:
pip install --upgrade google-assistant-sdk
This tool creates test credentials to authorize devices to call the Google Assistant API when prototyping.
Follow the steps to configure a Google API Console Project and a Google account to use with the Google Assistant SDK.
Download the
client_secret_XXXXX.json
file from the Google API Console Project credentials section and generate credentials:pip install --upgrade google-auth-oauthlib[tool] google-oauthlib-tool --client-secrets path/to/client_secret_XXXXX.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless
This tool verifies device setup for audio recording and playback.
Install the sample's dependencies:
sudo apt-get install portaudio19-dev libffi-dev libssl-dev pip install --upgrade google-assistant-sdk[samples]
Record 10 seconds of audio samples and play them back:
googlesamples-assistant-audiotest --record-time 10
Adjust the sound device block size and flush size for a soundcard with limited throughput:
googlesamples-assistant-audiotest --record-time 10 --audio-block-size=3200 --audio-flush-size=6400
The same --audio-block-size
and --audio-flush-size
options can
be used on the gRPC
samples included in the SDK.
This reference sample implements a simple but functional client for the Google Assistant gRPC API.
Install the sample's dependencies:
sudo apt-get install portaudio19-dev libffi-dev libssl-dev pip install --upgrade google-assistant-sdk[samples]
Try the push to talk sample:
googlesamples-assistant-pushtotalk
This reference sample implements a simple but functional client for the Google Assistant library (linux_arm7l
and linux_x86_64
).
Install the
google-assistant-library
package:pip install --upgrade google-assistant-library pip install --upgrade google-assistant-sdk[samples]
Try the hotword sample:
googlesamples-assistant-hotword
See MAINTAINER.md for more documentation on the development, maintainance and release of the Python package itself.
Contributions to this repository are always welcome and highly encouraged.
See CONTRIBUTING.md for more information on how to get started.
Copyright (C) 2017 Google Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.