IntentTemplateCreate - 创建意图模版
更新时间:2025-01-13
API访问域名
请求方式 | POST |
---|---|
base url | https://keyue.cloud.baidu.com |
后缀接口 | /open/v1/api/v3/intent/createTemplate |
Authentication | token为API Key |
说明
无
请求参数
Header参数
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
Content-Type | string | 是 | 内容类型 | 固定值:application/json |
token | string | 是 | API KEY | 集成-API-API Key处获取。 详细获取方式参考:准备工作 |
uid | string | 是 | 用户ID | 鼠标移动至页面右上角账户头像即可获取。 详细获取方式参考:准备工作 |
username | string | 是 | 用户名 | 鼠标移动至页面右上角账户头像即可获取。 详细获取方式参考:准备工作 |
Body参数
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
nameZh | string | 是 | 意图名称 | 意图名称 |
templates | array | 是 | 意图模板集合 | 详见templates子数据 |
templates子数据
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
template | array | 是 | 详见template子数据 |
template子数据
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
text | string | 是 | 模板文本类型 | 非实体、专业词的文本 |
id | string | 是 | 专业词库ID/实体ID | 专业词库:5ce5ab19-c6c6-4cb6-a6e3-f6b3cb5c82b5 实体:p2400677 |
name | string | 是 | 专业词库名称/实体标识 | 实体:p2400677 词库:磁力 |
nameZh | string | 是 | 实体名称 | 实体:手机号码 |
type | string | 是 | 模板引用类型: | entity:实体 voca:词库 |
响应参数
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
time | integer | 是 | 时间 | 1716985128196 |
data | null | 是 | 数据 | null |
code | integer | 是 | 状态码 | 200 |
msg | string | 是 | 状态信息 | OK |
请求示例
Bash
1curl --location --request POST 'https://keyue.cloud.baidu.com/open/v1/api/v3/intent/createTemplate' \
2--header 'token: 7f3894e7-01d8-4e2e-88d0-ef437ffd3f63' \
3--header 'uid: dd6283a283df42998bab14607e23f38d' \
4--header 'username: xxxxxxxx' \
5--header 'Content-Type: application/json' \
6--data '{"nameZh":"创建意图","templates":[{"template":[{"text":"[","id":null,"name":null,"nameZh":null,"type":null},{"text":"lf7ba930","id":"lf7ba930","name":"lf7ba930","nameZh":"人名","type":"entity"},{"text":"|中国人]","id":null,"name":null,"nameZh":null,"type":null}]}]}'