0

我不知道他为什么不能创建实例。

首先它说:

C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-id                         assi
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\.....\\AppData\\...
INFO:root:Registering device
ERROR:root:Option --device-model-id required when registering a device instance.

下一次尝试--device-model-id

C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-model-id assi
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\Users\\Thomas\\AppData\\Roaming\\googlesamples-assistant\\device_config.json'
INFO:root:Registering device
ERROR:root:Option --project-id required when registering a device instance.

接下来尝试--project-id

C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-model-id assi --project-id evil-assist
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\Users\\Thomas\\AppData\\Roaming\\googlesamples-assistant\\device_config.json'
INFO:root:Registering device
ERROR:root:Failed to register device: {
  "error": {
    "code": 400,
    "message": "Could not create the device instance. Client type need to be specified as SDK_LIBRARY or SDK_SERVICE.",
    "status": "INVALID_ARGUMENT"
  }
}

我还在developers.google.com 上注册了该设备。

C:\Users\Thomas\Desktop>googlesamples-assistant-devicetool list --model
Device Model Id: assi
        Project Id: evil-assist
        Device Type: action.devices.types.LIGHT
        Trait action.devices.traits.OnOff

C:\Users\Thomas\Desktop>googlesamples-assistant-devicetool list --device
Device Instance Id: assi
    Nickname: assi
    Model: assi

任何想法为什么它不起作用?

4

3 回答 3

0

SDK 库已更新至 0.4.1 以解决此问题。

https://github.com/googlesamples/assistant-sdk-python/commit/f00df5ff40672942bdc6d1b27c10c49076f994f2

于 2018-01-16T06:36:47.387 回答
0

资助解决方案..

使用更新库

python -m pip install --upgrade google-assistant-sdk[samples]

我前两天更新了,好像那个版本有bug。现在它起作用了。

于 2018-01-12T21:46:08.657 回答
0

您应该像 Thomas Mayer 提到的那样更新库。

googlesamples-assistant-devicetool

略有变化。要创建设备实例 ID,请使用以下命令:

googlesamples-assistant-devicetool --project-id myand
roidthings-5dba4 register-device --device 123456 --model myandroidthings-xxxxxx-myproduct-yyyyyy --client-type LIBRARY

除此之外https://developers.google.com/assistant/sdk/guides/library/python/似乎是最新的

最后一个选项取决于您支持的平台:https ://developers.google.com/assistant/sdk/overview#features SERVICE 适用于所有 gRPC 平台。LIBRARY 用于 linux-armv7l 和 linux-x86_64

于 2018-07-02T17:36:18.093 回答