對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
執行程式碼範例
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
此時,您可以執行範例並執行查詢。
在下列指令中:
googlesamples-assistant-pushtotalk --project-id my-dev-project --device-model-id my-model
按下 Enter 鍵並嘗試下列查詢:
如果 Google 助理沒有回應,請按照疑難排解操作說明操作。
如要變更 Google 助理的語言或啟用個人化搜尋結果,請按照下列步驟操作:
使用 Google 助理應用程式。
找出裝置執行個體 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 助理,接下來就是
然後擴充該元件您可以前往這裡查看一些後續步驟。
或繼續建立裝置動作。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間: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"]],["上次更新時間: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"]]