Method: projects.matchIntents
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://actions.googleapis.com/v2/{project=projects/*}:matchIntents
网址采用 gRPC 转码语法。
路径参数
参数 |
project |
string
必需。被测项目,由项目 ID 表示。格式:projects/{project}
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"query": string,
"locale": string
} |
字段 |
query |
string
必需。纯文本格式的用户查询。
|
locale |
string
必需。用于评估查询的语言区域,例如“en”。格式应遵循 BCP 47 要求:https://tools.ietf.org/html/bcp47。如需查看支持的语言列表,请访问 https://developers.google.com/assistant/console/languages-locales
|
响应正文
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"matchedIntents": [
{
object (Intent )
}
]
} |
字段 |
matchedIntents[] |
object (Intent )
匹配的意图,按相关性从高到低排序。仅返回前 50 个匹配项。
|
意向
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
可选。符合此意图的最终用户输入或语音输入的内容。当根据用户输入匹配意图时,将填充此字段。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):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,[]]