运行示例代码
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
此时,您可以运行该示例并执行查询了。
在以下命令中:
googlesamples-assistant-pushtotalk --project-id my-dev-project --device-model-id my-model
按 Enter 键,然后尝试以下某些查询:
如果 Google 助理没有响应,请按照问题排查说明操作。
如果你想更改 Google 助理的语言或启用个人信息相关结果功能,请按以下步骤操作:
使用 Google 助理应用。
查找设备实例 ID
当您第一次运行示例时,它会为您的
特定设备此设备实例将与设备型号相关联
指定用于运行示例的 ID。您也可以自行创建实例
使用注册工具注册。
该示例保存了模型 ID 和实例 ID。如果您在运行该示例时未提供
这些作为参数,则默认使用已保存的 ID。
在示例的输出中查找设备实例 ID。
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: '/home/pi/.config/googlesamples-assistant/device_config.json'
INFO:root:Registering device
INFO:root:Device registered: 0eea18ae-d17e-11e7-ac7a-b827ebb8010f # Device instance ID
Press Enter to send a new request...
下一步
现在,Google 助理已在设备上正常运行,是时候开始体验 Google 助理了。
进行扩展您可以点击此处查看一些可能的后续步骤
或继续创建设备操作。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-07。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-09-07。"],[[["Run the provided command, replacing placeholders with your project and model IDs, to initiate a sample query."],["Test the setup with example queries like \"Who am I?\", \"What time is it?\", or weather-related questions."],["Locate the device instance ID within the sample's output for future use and potential troubleshooting."],["Refer to provided resources for troubleshooting, language settings, and next steps in extending device functionality."]]],["To run the sample, replace placeholders in the provided command with your Google Cloud project ID and model name. Execute the command and try example queries. If no response, consult troubleshooting. The first run generates a unique device instance ID, displayed in the output, and saves it for future use. The command can be run without arguments if the ID was saved. You can change the language or add personal settings through the Google Assistant app. Further steps like extending or adding device actions are possible.\n"]]