综合问答接口
更新时间:2024-07-25
Method:post
Path:/kmss/openapi/chihiro/qacore/dialog/simpleQaSummary
接口描述: 通用问答接口
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
content-type | header | string | 是 | |
token | header | string | 否 | 鉴权 token |
validate-authorities | header | string | 否 | 是否开启鉴权 |
accountid | header | string | 否 | 用户的主账号 id |
userid | header | string | 否 | 用户 id |
body | body | object | 否 | |
» query | body | string | 是 | 用户输入 query |
» dataSourceTypes | body | [integer] | 否 | 开启外网问答 1,开启内网问答 2 |
» nids | body | [string] | 否 | 指定片段id进行回答 |
» docIds | body | [string] | 否 | 制定文档 id 进行回答 |
» isRegenerated | body | boolean | 是 | 是否为重新生成 |
» filterQuerys | body | [object] | 否 | 过滤字段 |
» field | filterQuerys | string | 是 | 过滤的key |
» values | filterQuerys | [string] | 是 | 过滤的值 |
请求样例:
Plain Text
1curl -XPOST 'http://search-server:8662/chihiro/qacore/dialog/simpleQaSummary' \
2--header 'token: 369ca613c7a74a58b0f95be2cfd59257' \
3--header 'validate-authorities: false' \
4--header 'accountid: 46bee367035342a4aebe235b4bfcec32' \
5--header 'userid: 46bee367035342a4aebe235b4bfcec32' \
6--header 'content-type: application/json' \
7--data '{
8 "messageId": "azdtbNCMW3wFtjDQ-1716907784755",
9 "query": "《姜拂衣》的标签是什么",
10 "dataSourceTypes": [
11 2
12 ],
13 "filterQuerys": [
14 {
15 "field": "@type",
16 "values": [
17 "打点",
18 "在线"
19 ]
20 }
21 ],
22 "isRegenerated": false,
23 "sessionId": "dcd26bdd_3934a0fc-5da7-4075-a89f-fffafdb20370"
24}'
响应参数
event=message:
名称 | 类型 | 必选 | 说明 |
---|---|---|---|
answer | string | 否 | 回答片段 |
角标:
Plain Text
1<sup data-action-type=\"hover\" data-sources=\"83661d70a46d4a_text_2\">[1]</sup>
名称 | 类型 | 说明 |
---|---|---|
data-sources | string | 由 竖线 拼接的段落列表,对应于后面的 para_sources中的key |
event=extra:
名称 | 类型 | 必选 | 说明 |
---|---|---|---|
nids | [string] | 否 | 相似段落 id |
docs | [string] | 否 | 相似文档 id |
sources | [object] | 否 | 溯源信息 |
para_sources | [object] | 否 | 段落id与段落内容的映射map |