树莓派Google Voice客户端执行代码报错:需指定SDK客户端类型
I've run into this exact issue before when setting up the Google Assistant SDK on a Raspberry Pi. That error message spells out exactly what's wrong—you need to specify a client type (SDK_LIBRARY or SDK_SERVICE) when registering your device instance.
Why This Happens
Google updated the Assistant SDK to require explicitly declaring what kind of client your device is. The two valid options are:
- SDK_LIBRARY: For embedded/local hardware like your Raspberry Pi (this is the one you’ll want for your setup)
- SDK_SERVICE: For cloud-hosted service applications
Step-by-Step Fix
Register Your Device with the Required Client Type
Open your terminal and run this command, replacingyour-device-idwith a custom name for your device (e.g.,pi-assistant-01):googlesamples-assistant-devicetool register-device --project-id inner-bonus-190416 --device-model-id inner-bonus-190416 --device-id your-device-id --client-type SDK_LIBRARYThis command will generate the missing
device_config.jsonfile in/home/pi/.config/googlesamples-assistant/that the initial warning referenced.Launch the Push-to-Talk Assistant Again
Now re-run your original command, making sure to include the--device-idyou just set:googlesamples-assistant-pushtotalk --project-id inner-bonus-190416 --device-model-id inner-bonus-190416 --device-id your-device-id
That should get you connected to the Assistant service without hitting the 400 error.
内容的提问来源于stack exchange,提问作者John Clark

