IntentLlmGenerate - 大模型生成意图例句
更新时间:2025-10-21
API访问域名
| 请求方式 | POST |
|---|---|
| base url | https://keyue.cloud.baidu.com |
| 后缀接口 | /open/v1/api/v3/intent/llm/generate/example |
| Authentication | token为API Key |
说明
无
请求参数
Header参数
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| Content-Type | string | 是 | 内容类型 | 固定值:application/json |
| token | string | 是 | API KEY | 机器人API KEY。 详细获取方式参考:准备工作 |
| uid | string | 是 | 用户ID | 详细获取方式参考:准备工作 |
| username | string | 是 | 用户名 | 详细获取方式参考:准备工作 |
Body参数
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| intent | string | 是 | 意图名称 | 意图名称 |
| count | int | 是 | 生成个数 | 可选值【1,3,5】,非可选值,默认值为:1 |
| examples | array | 是 | 意图示例对象 | |
| examples/text | string | 是 | 意图示例文本 | 创建意图示例 |
响应参数
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| time | integer | 是 | 时间 | 1716985128196 |
| data | null | 是 | 数据 | 详见data子数据 |
| code | integer | 是 | 状态码 | 200 |
| msg | string | 是 | 状态信息 | OK |
data子数据
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| generateList | array | 是 | 生成列表 | 详见generateList子数据 |
generateList子数据
| 名称 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|
| text | string | 是 | 示例 |
请求示例
Bash
1curl --location 'http://keyue-test.cloud.baidu.com/open/v1/api/v3/intent/create' \
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":"创建意图","description":"创建意图描述"}'
响应示例
1{
2 "time": 1720089138774,
3 "data": {
4 "generateList": [
5 [
6 {
7 "text": "请问今天天气如何?",
8 "id": null,
9 "name": null,
10 "nameZh": null,
11 "type": null
12 }
13 ]
14 ]
15 },
16 "code": 200,
17 "msg": "OK"
18}
1{
2 "time": 1719316175124,
3 "data": null,
4 "code": 4000177,
5 "msg": "意图创建失败\r\n意图名已存在\r\n"
6}
