IntentExampleCreate - 创建意图例句
更新时间:2025-01-17
API访问域名
请求方式 | POST |
---|---|
base url | https://keyue.cloud.baidu.com |
后缀接口 | /open/v1/api/v3/intent/createExample |
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 | 是 | 意图名称 | 意图名称 |
examples | array | 是 | 意图示例对象 | 详见examples子数据 |
examples子数据
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
exampleValue | array | 是 | 意图示例对象 | 详见exampleValue子数据 |
exampleValue子数据
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
text | string | 是 | 意图示例文本 | 创建意图示例 |
响应参数
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
time | integer | 是 | 时间 | 1716985128196 |
data | null | 是 | 数据 | 详见data子数据 |
code | integer | 是 | 状态码 | 200 |
msg | string | 是 | 状态信息 | OK |
data子数据
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
intentId | string | 是 | 意图Id | |
intentName | string | 是 | 意图名 | |
id | string | 是 | 意图例句Id | |
value | string | 是 | 意图例句 |
请求示例
Bash
1curl --location --request POST 'https://keyue.cloud.baidu.com/open/v1/api/v3/intent/createExample' \
2--header 'token: 6de9a5db-792c-434a-9d58-7711c974142a' \
3--header 'Content-Type: application/json' \
4--header 'uid: cf7d9692703d45d1b5517a30ab3efa53' \
5--header 'username: pnstest5' \
6--data '{
7 "nameZh": "创建意图",
8 "examples": [
9 {
10 "exampleValue": [
11 {
12 "text": "创建意图示例3"
13 }
14 ]
15 },
16 {
17 "exampleValue": [
18 {
19 "text": "创建意图示例2"
20 }
21 ]
22 }
23 ]
24}'