Pattern - Add Pattern
将模式添加到应用程序的某个版本。
POST {Endpoint}/luis/api/v2.0/apps/{appId}/versions/{versionId}/patternrule
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
app
|
path | True |
string (uuid) |
应用程序 ID。 |
|
Endpoint
|
path | True |
string |
支持的认知服务终结点(协议和主机名,例如:https://westus.api.cognitive.microsoft.com)。 |
|
version
|
path | True |
string |
版本 ID。 |
请求头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | True |
string |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| intent |
string |
模式所属的意向名称。 |
| pattern |
string |
模式文本。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 201 Created |
创建的模式 |
|
| Other Status Codes |
错误响应。 |
安全性
Ocp-Apim-Subscription-Key
类型:
apiKey
在:
header
示例
Successful Add Pattern request
示例请求
POST {Endpoint}/luis/api/v2.0/apps/86226c53-b7a6-416f-876b-226b2b5ab07b/versions/0.1/patternrule
{
"pattern": "Who's {Name} reporting to?",
"intent": "report to"
}
示例响应
{
"id": "cc8fa554-cc6c-4bcc-97eb-c8e5bc2091b3",
"pattern": "who's {Name} reporting to?",
"intent": "report to"
}
定义
| 名称 | 说明 |
|---|---|
|
Error |
调用 API 上的作时出现错误响应。 |
|
Pattern |
用于创建模式的对象模型 |
|
Pattern |
模式规则 |
ErrorResponse
调用 API 上的作时出现错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| errorType |
string |
PatternRuleCreateObject
用于创建模式的对象模型
| 名称 | 类型 | 说明 |
|---|---|---|
| intent |
string |
模式所属的意向名称。 |
| pattern |
string |
模式文本。 |
PatternRuleInfo
模式规则
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (uuid) |
模式 ID。 |
| intent |
string |
模式所属的意向名称。 |
| pattern |
string |
模式文本。 |