對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
Method: projects.matchIntents
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
POST https://actions.googleapis.com/v2/{project=projects/*}:matchIntents
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
project |
string
必要欄位。接受測試的專案,以專案 ID 表示。格式:projects/{project}
|
要求主體
要求主體的資料會採用以下結構:
JSON 表示法 |
{
"query": string,
"locale": string
} |
回應主體
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"matchedIntents": [
{
object (Intent )
}
]
} |
欄位 |
matchedIntents[] |
object (Intent )
意圖相符,依關聯性由高到低排序。系統只會傳回前 50 個相符項目。
|
Intent
JSON 表示法 |
{
"name": string,
"params": {
string: {
object (IntentParameterValue )
},
...
},
"query": string
} |
欄位 |
name |
string
必要欄位。最後一個相符意圖的名稱。
|
params |
map (key: string, value: object (IntentParameterValue ))
必要欄位。代表做為意圖比對的一部分參數。此為已識別參數的名稱與透過使用者輸入內容識別的參數值對應。這裡會顯示相符意圖中定義的所有參數。 這個物件中包含 "key": value 組合的清單,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" } 。
|
query |
string
選用設定。針對符合這項意圖的使用者輸入或口說的輸入內容。比對意圖時,系統會根據使用者輸入內容填入這項資訊。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eFinds the intents that match a given user query, returning the top 50 matches ranked by relevance.\u003c/p\u003e\n"],["\u003cp\u003eRequires a \u003ccode\u003ePOST\u003c/code\u003e request to the specified endpoint, including the project ID and user query.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain the user query as plain text and the locale for evaluation.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes a list of matched intents, each with its name, parameters, and the original query.\u003c/p\u003e\n"],["\u003cp\u003eEach intent object provides details like the intent name, identified parameters, and the portion of the user input that triggered the match.\u003c/p\u003e\n"]]],["This document details the process of matching user queries to intents via a `POST` request to `https://actions.googleapis.com/v2/{project=projects/*}:matchIntents`. The request requires a `project` path parameter, a JSON body with `query` and `locale` strings. The response returns a JSON object with `matchedIntents`, an array of matched intents, each with `name`, `params` (parameter name-value pairs), and `query` fields. Only the first 50 matching intents are returned, ordered from most to least relevant.\n"],null,[]]