阻塞对话接口
更新时间:2024-11-04
流式对话接口
/core/v4/block/query
接口说明
以阻塞的方式返回大模型流式结果,可以避免由于流式协议引入的对接开发量;
但由于该接口是阻塞返回,响应时长有一定的增加,如果对即时性有要求,可以对接流式接口
接口地址
https://api-ngd.baidu.com/core/v4/block/query
请求方法: POST
请求header说明
名称 | 类型 | 必填 | 中文名 | 说明 |
---|---|---|---|---|
Authorization | string | 是 | token_info | 示例:NGD access_tokenaccess_token是bot的属性,通过bot管理列表获取,注意:字符“NGD”与access_token字符串中间有一空格 |
Uid | string | 否 | c 端用户id | |
Username | string | 否 | c 端用户名称 | |
ACTIVE | string | 否 | 调用环境 | online/offline 分别代表线上环境和测试环境公有云环境该参数不生效 |
请求参数说明
参数名 | 类型 | 必选 | 说明 |
---|---|---|---|
nlu | Boolean | 否 | 是否返回nlu识别信息(意图,实体,情感,态度) |
debug | Boolean | 否 | 是否打开调试模式,返回调试信息 |
queryId | String | 否 | 请求id,用于出现问题时快速定位排查,不传则系统生成uuid;建议用户设置,语音场景可能因为超时,丢失answer信息,通过请求query指定queryId,方便问题排查 |
POST body参数说明
参数名 | 类型 | 必选 | 说明 |
---|---|---|---|
queryText | String | 是 | 请求文本 |
sessionId | String | 否 | 会话id。 可不传值,由会话机器人生成; 若传值,使用业务方传入的sessionId,用户传入的sessionId必须保证唯一,如UUID. |
sources | List | 否 | 对话模式: 1. task_based:多轮 2. kg:知识图谱 3. faq:问答 4. chitchat:闲聊 5. 空或无该字段为智能对话 |
channel | String | 否 | 渠道信息,整个session周期固定 |
context | Map | 否 | 上下文信息。与当前的会话session中的上下文进行合并,若存在key冲突,以传入的key为准 |
collect | Boolean | 否 | 是否收集会话数据,用于用户标注。默认为false |
vad | String | 否 | 系统指令: silent:静默 interrupt:打断 |
ext | Map | 否 | 调用方回传参数,格式为json,数据不做处理用来后期分析使用; 示例:调用会话时传入{ "uid",001 } 会话日志中ext将会存储该信息用于后期分析。 |
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
code | int | 错误码 |
msg | String | 错误信息 |
data | Map<String, Object> | 返回答案的详细信息 |
data:
参数名 | 类型 | 说明 |
---|---|---|
sessionId | String | 会话id |
queryId | String | 请求id |
source | String | 会话模式(faq,task_based,chitchat,kg,clarify(澄清),none(澄清失败、系统默认回复等),auto_fill(实体自动填充),system(bot系统事件)、botEvent(bot自定义事件)第三方引擎ID、技能ID) |
solved | Boolean | 指定会话模式是否有答案.(多轮会话中,命中顶层节点且节点条件为anything_else,solved为false) |
confidence | Double | 相似度 |
nlu | Map | 当前query的nlu识别信息 |
answer | Map | 回复答案 |
queryTime | String | 请求时间,格式:yyyy-MM-dd HH:mm:ss:SSS |
responseTime | String | 响应时间,格式:yyyy-MM-dd HH:mm:ss:SS |
context | Map | 会话上下文信息 |
associateData | Map | 随路数据收集 |
actions | List |
透传的指令,如打断(interrupted ) |
webhook | Boolean | 是否使用webhook |
topAnythingElse | Boolean | 多轮是否命中顶层anythingElse节点 |
anythingElse | Boolean | 多轮是否命中anythingElse节点 |
debug | Map | 调试信息(开启debug模式后才会有值) |
flowOutput | Boolean | flowOutput = true:流式回复flowOutput = false:非流式回复(主要是富文本类型) |
nlu:
参数名 | 类型 | 说明 |
---|---|---|
intents | List | 识别的意图列表(格式同:debug → intents) |
entities | Map | 识别的实体列表(格式同:debug → entities) |
attitude | Map | 态度详情(格式同:debug → attitude) |
sentiment | Map | 情感详情(格式同:debug → sentiment) |
action | Map | 动作详情(格式同:debug → action) |
answer:
参数名 | 类型 | 说明 |
---|---|---|
clarify | Map | 澄清答案 |
clarifyType | String | 意图澄清:INTENT_CLARIFY 问答澄清:FAQ_CLARIFY 意图问答澄清:INTENT_FAQ_CLARIFY faq高置信度澄清:FAQ_HIGH_CLARIFY 问答核心词澄清:FAQ_CORE_CLARIFY 意图模版澄清:TEMPLATE_INTENT_CLARIFY 问答模版澄清:TEMPLATE_FAQ_CLARIFY 意图问答模版澄清:TEMPLATE_INTENT_FAQ_CLARIFY KG澄清:KG_CLARIFY 实体澄清:ENTITY_CLARIFY 第三方引擎澄清:THIRD_CLARIFY 技能澄清:SKILL_CLARIFY |
answerContents | List | 答案列表,元素类型有:1: 纯文本类型,2: link类型,3: 富文本类型,4: 图片类型,6: 录音类型,7: 录音拼变量类型,8: 列表类型 |
answerText | String | 根据answerContents列表拼接的文本推荐答案) |
recommendContents | List | 推荐答案列表,元素类型:8: 列表类型 |
clarify:
参数名 | 类型 | 说明 |
---|---|---|
voice | Map | 语音回复 |
text | Map | 文字回复 |
voice:
参数名 | 类型 | 说明 |
---|---|---|
content | String | 澄清语句 |
text:
参数名 | 类型 | 说明 |
---|---|---|
title | String | 澄清标题 |
list | List | 澄清问题列表 |
answerContents:
type: 1,纯文本类型
参数名 | 类型 | 说明 |
---|---|---|
type | int | 回复内容类型 1:纯文本 |
text | String | 回复内容 |
type: 2,link类型
参数名 | 类型 | 说明 |
---|---|---|
type | int | 回复内容类型 2:link |
text | String | 回复内容 |
url | String | url |
type: 3,富文本类型
参数名 | 类型 | 说明 |
---|---|---|
type | int | 回复内容类型 3:富文本 |
text | String | 富文本回复内容 |
type: 4,图片类型
参数名 | 类型 | 说明 |
---|---|---|
type | int | 回复内容类型 4:图片 |
url | String | 图片url |
type: 6,录音类型
参数名 | 类型 | 说明 |
---|---|---|
type | int | 回复内容类型 6:录音 |
audio | Map | 录音内容 |
audio:
参数名 | 类型 | 说明 |
---|---|---|
duration | int | 录音时长 |
name | String | 录音文件名称 |
id | String | 录音文件id |
text | String | 录音内容文本 |
url | String | 录音url |
textModify | String | 修改后的录音内容 |
type: 7,录音拼变量
参数名 | 类型 | 说明 |
---|---|---|
type | int | 回复内容类型 7:录音拼变量 |
values | List | 回复内容列表,列表中元素由类型6与类型1组成,即录音类型与文本类型组成 |
type: 8,列表类型
参数名 | 类型 | 说明 |
---|---|---|
type | int | 回复内容类型 8:列表类型 |
title | String | 回复标题 |
list | List< String> | 回复列表 |
debug:
参数名 | 类型 | 说明 |
---|---|---|
botId | String | 会话bot的id |
queryId | String | 请求id |
nlu | Map | nlu分析当前query的详细结果 |
detail | Map | debug信息详情 |
nlu:
参数名 | 类型 | 说明 |
---|---|---|
rawQuery | String | 原始query |
nluQuery | String | nlu识别的query |
nluChangedQuery | String | nlu上下文改写后的query |
nluCorrectedQuery | String | nlu纠错后的query |
intents | List | 识别的意图列表 |
clarifyIntents | List | 识别的澄清意图 |
clarifyTemplates | List | 识别的澄清模版意图 |
entities | Map | 识别的实体列表 |
clarifyEntities | Map | 识别的实体澄清列表 |
attitude | Map | 态度详情 |
sentiment | Map | 情感详情 |
action | Map | 动作详情 |
entityAutoFillVoMap | Map | 复合实体填充信息 |
sensitiveWordsList | List<SensitiveVo> | 敏感词详情 |
intents/clarifyIntents/clarifyTemplates:
参数名 | 类型 | 说明 |
---|---|---|
id | String | 意图id |
name | String | 意图标识 |
nameZh | String | 意图中文名称 |
description | String | 意图描述 |
system | String | 是否系统意图 |
source | String | 算法名称 |
alias | String | 意图别名 |
templateStr | String | 模版字符串 |
attitude:
参数名 | 类型 | 说明 |
---|---|---|
prob | String | 置信度 |
source | String | 识别模型 |
name | String | 态度标识 |
nameZh | String | 态度中文名 |
sentiment:
参数名 | 类型 | 说明 |
---|---|---|
prob | String | 置信度 |
source | String | 识别模型 |
name | String | 情感标识 |
nameZh | String | 情感中文名 |
action:
参数名 | 类型 | 说明 |
---|---|---|
prob | String | 置信度 |
source | String | 识别模型 |
name | String | 动作标识 |
nameZh | String | 动作中文名 |
SensitiveVo:
参数名 | 类型 | 说明 |
---|---|---|
sensitiveWord | String | 敏感词 |
repositoryName | String | 所属词库 |
detail:
多轮 task_based模式:
参数名 | 类型 | 说明 |
---|---|---|
dialogs | List | 触发会话树节点详情 |
confidence | Double | 置信度 |
nlu | Map | 答案对应的nlu结果(结构同 debug-->nlu) |
lastNodeId | String | 最近一次触发的会话树节点id |
dialogs:
参数名 | 类型 | 说明 |
---|---|---|
dialogNodeId | String | 会话树节点id |
dialogNodeName | String | 会话树节点名 |
processId | String | 流程片段id |
processName | String | 流程片段名 |
outputIndex | int | 执行模块下标 |
values | List | 当前会话树节点回复内容的格式配置 |
jumpBackValues | String | 外呼当前会话树节点跳回话术格式配置(字段格式和values⼀致) |
webhook | Boolean | 是否使用webhook |
action | String | 指令 |
webhookInfo | Map | webhook接口调用结果 |
tags | List | 节点标签 |
知识图谱 kg模式:
参数名 | 类型 | 说明 |
---|---|---|
nlpSessionId | String | KG_DM的会话id |
confidence | Double | 置信度 |
type | String | 答案类型。 SATISFY("satisfy", "答上来了") CLARIFY("clarify", "需要澄清") FAILURE("failure", "没答上来") |
sayText | String | 答案话术 |
kgPatternType | String | 句式类型 |
kgClassName | String | 类目名称 |
kgPropertyName | String 属性名称 | |
kgPropertyArray | String 属性名称多值 | |
kgModQueryText | String | 改写后的Query |
kgQueryPattern | String | 句式pattern |
values | List | 回复内容(格式与answer → answerContents格式一致) |
问答 faq模式:
参数名 | 类型 | 说明 |
---|---|---|
id | String | 标准问ID |
standardQuestion | String | 标准问问题 |
confidence | double | 相似度 |
extendQuestion | String | 扩展问问题 |
suggest | List< String> | 关联问题列表 |
answer | Map | 答案详情 |
answer 答案详情
参数名 | 类型 | 说明 |
---|---|---|
type | int | 答案类别: 1:纯文本 3:富文本(html tag) 4:pic url link 6:audio |
text | String | type为1或3时使用,回复内容 |
url | String | type为4时使用,图片url |
audio | Map | type为6时使用,录音回复内容,(格式与suggestionAnswers → answerValues中的录音类型格式一致) |
闲聊 chitchat模式:
参数名 | 类型 | 说明 |
---|---|---|
id | String | 标准问ID |
standardQuestion | String | 标准问问题 |
extendQuestion | String | 扩展问问题 |
confidence | double | 相似度 |
answer | Map | 答案详情 |
answer 答案详情:
参数名 | 类型 | 说明 |
---|---|---|
type | int | 答案类别 1:纯文本 |
text | String | 回复内容 |
自动填充 auto_fill模式:
参数名 | 类型 | 说明 |
---|---|---|
entityAutoFill | Map | 复合实体自动填充 |
entityAutoFill:
参数名 | 类型 | 说明 |
---|---|---|
entityAutoFillVo | Map | 复合实体自动填充 |
entityAutoFillName | String | 自动填充实体 |
fillText | String | 自动填充文本 |
entityAutoFillVo:
参数名 | 类型 | 说明 |
---|---|---|
entity | Map | 复合实体自动填充 |
entityFillType | int | 实体填充类型 |
propertyVoMap | Map | 属性详情列表 |
propertyNames | List |
属性名称列表 |
currentFillVo | Map | 当前填充话术 |
entity:
参数名 | 类型 | 说明 |
---|---|---|
entityId | String | 实体id |
entryId | String | 实体值id |
value | String | 实体值 |
original | String | 实体原始值 |
name | String | 实体名称 |
nameZh | String | 实体中文名称 |
subName | String | 实体子名称 |
offset | int | 偏移量 |
system | Boolean | 是否系统实体 |
display | String | 实体显示值 |
type | int | 实体类型 |
combineValue | String | 复合实体组合值 |
extra | Map | 扩展属性 |
currentFillVo:
参数名 | 类型 | 说明 |
---|---|---|
propertyName | String | 属性名称 |
fillText | String | 填充话术 |
澄清 clarify模式:
参数名 | 类型 | 说明 |
---|---|---|
clarifyType | String | 澄清类型 |
clarifyQuestions | Map | 澄清 |
entityClarify | Map | 实体澄清 |
keywordConfirmQuestions | List | 模版澄清 |
highConfirmQuestions | List | 高置信度澄清 |
keywordConfirmQuestions/highConfirmQuestions:
参数名 | 类型 | 说明 |
---|---|---|
sore | String | 分值 |
clickable | Map | 是否可点击 |
source | Map | 来源 |
question | List | 澄清内容 |
bot系统事件模式:
参数名 | 类型 | 说明 |
---|---|---|
name | String | 策略名称 |
index | int | 策略序号 |
count | int | 当前计数次数 |
reply | Map | 策略配置 |
reply 策略配置:
参数名 | 类型 | 说明 |
---|---|---|
count | int | 当前计数次数 |
symbol | String | 策略符号,例如:>,<等 |
isWebhook | boolean | 是否启用webhook |
action | String | 指令 |
type | int | 返回答案类型 |
text | String | 文本返回答案内容,type为1时使用 |
audio | Map | 录音返回答案内容,type为6时使用,格式同:faq-→ answer→ audio |
bot自定义事件模式:
参数名 | 类型 | 说明 |
---|---|---|
name | String | 事件名称 |
values | Map | 当前会话节点回复内容格式配置 |
webhook | Boolean | 是否使用webhook |
action | String | 指令 |
interrupted | Boolean | 打断标识 |
outputIndex | int | 执行策略序号 |
nlu | Map | nlu信息 |
技能模式:
参数名 | 类型 | 说明 |
---|---|---|
skillInfo | SkillInfo | 技能信息 |
engineInfo | Map | 技能命中的某个引擎调试信息(task_based、faq等),详见上述相关字段 |
SkillInfo:
参数名 | 类型 | 说明 |
---|---|---|
skill | boolean | 是否是技能 |
skillName | String | 技能名 |
skillId | String | 技能Id |
sourceAgentId | String | 共享agentId |
shareAgentId | String | 当前使用agentId |
originSource | String | 对应资源命中的引擎名(task_based、faq等) |
answerInterventionRules:
参数名 | 类型 | 说明 |
---|---|---|
name | String | 干预规则名称 |
type | int | 干预规则类型: 1:全部替换 2:增加前后缀 |
valueMaps | Map | 规则内容 |
valueMaps(type=1):
参数名 | 类型 | 说明 |
---|---|---|
values | Map | 全文,见上文values答案描述介绍 |
valueMaps(type=2):
参数名 | 类型 | 说明 |
---|---|---|
prefixValues | Map | 前缀,见上文values答案描述介绍 |
suffixValues | Map | 后缀,见上文values答案描述介绍 |
appendAnswers:
参数名 | 类型 | 说明 |
---|---|---|
type | int | 回复类型: 1:文本 6:语音 7:录音拼变量 (更多type详见answer:dialogs:values参数描述) |
text/audio/values | String/Map/List | 外呼类型机器人跳回话术回复内容 |
请求示例
Plain Text
1curl 'https://api-ngd.baidu.com/core/v4/block/query?debug=true' \
2 -H 'Authorization: NGD 75676418-a574-44b8-8d27-a0bc79f2224c' \
3 -H 'Content-Type: application/json;charset=UTF-8' \
4 -H 'requestFrom: NGD' \
5 --data-raw '{"queryText":"海淀公园","sessionId":"eb653f94-d9ff-412b-9cdb-7693cc1013df","collect":false,"sources":null,"vad":null}' \
6 --compressed
响应结果示例
任务式会话
Plain Text
1{
2 "time": 1586486514896,
3 "data": {
4 "sessionId": "11c8cddd-3d0c-493e-a33f-9a02ae5f99e5",
5 "source": "task_based",
6 "solved": true,
7 "confidence": 1,
8 "nlu": {
9 "sentiment": {
10 "query": "租车",
11 "label": 0,
12 "prob": 0.97234964,
13 "source": "model",
14 "name": "neutral",
15 "nameZh": "中立"
16 },
17 "intents": [
18 {
19 "id": "e5304670-6841-40f6-ba49-11bbca32c6a8",
20 "name": "rental",
21 "description": "",
22 "agentId": null,
23 "created": null,
24 "updated": null,
25 "confidence": 1,
26 "source": "knn",
27 "threshold": 0,
28 "system": false,
29 "alias": "",
30 "nameZh": "租车",
31 "examples": null,
32 "hasActiveCopy": false,
33 "templateStr": null,
34 "createdUserName": null,
35 "createdUserId": null,
36 "lastEditUserName": null,
37 "lastEditUserId": null,
38 "version": 0,
39 "industryIntent": false
40 }
41 ],
42 "entities": {},
43 "attitude": {
44 "query": "租车",
45 "label": 0,
46 "prob": 1,
47 "source": "model",
48 "name": "unknown",
49 "nameZh": "无态度"
50 }
51 },
52 "answer": {
53 "answerText": "指令级别的兜底话术请输入车型",
54 "answerContents": [
55 {
56 "original": "指令级别的兜底话术",
57 "text": "指令级别的兜底话术",
58 "type": 1
59 },
60 {
61 "type": 1,
62 "text": "请输入车型",
63 "original": "请输入车型"
64 }
65 ]
66 },
67 "context": {
68 "sys_counter": {
69 "租车": 1,
70 "检查车型实体节点_qwpg1bhv": 1
71 },
72 "api_response_status": false,
73 "sys_webhook_eval_success": false
74 },
75 "associateData": {},
76 "actions": [
77 "aciton"
78 ],
79 "webhook": true,
80 "debug": {
81 "responseTime": "2020-04-10 10:41:54:896",
82 "nlu": {
83 "clarifyEntities": {},
84 "sentiment": {
85 "query": "租车",
86 "label": 0,
87 "prob": 0.97234964,
88 "source": "model",
89 "name": "neutral",
90 "nameZh": "中立"
91 },
92 "intents": [
93 {
94 "id": "e5304670-6841-40f6-ba49-11bbca32c6a8",
95 "name": "rental",
96 "description": "",
97 "agentId": null,
98 "created": null,
99 "updated": null,
100 "confidence": 1,
101 "source": "knn",
102 "threshold": 0,
103 "system": false,
104 "alias": "",
105 "nameZh": "租车",
106 "examples": null,
107 "hasActiveCopy": false,
108 "templateStr": null,
109 "createdUserName": null,
110 "createdUserId": null,
111 "lastEditUserName": null,
112 "lastEditUserId": null,
113 "version": 0,
114 "industryIntent": false
115 }
116 ],
117 "nluQuery": "租车",
118 "entities": {},
119 "clarifyIntents": [],
120 "clarifyTemplates": [],
121 "attitude": {
122 "query": "租车",
123 "label": 0,
124 "prob": 1,
125 "source": "model",
126 "name": "unknown",
127 "nameZh": "无态度"
128 },
129 "rawQuery": "租车"
130 },
131 "queryTime": "2020-04-10 10:41:49:860",
132 "botId": "b4762b99-d0df-4d51-bb70-38000b5b3f79",
133 "detail": {
134 "nlu": {
135 "clarifyEntities": {},
136 "sentiment": {
137 "query": "租车",
138 "label": 0,
139 "prob": 0.97234964,
140 "source": "model",
141 "name": "neutral",
142 "nameZh": "中立"
143 },
144 "intents": {
145 "id": "e5304670-6841-40f6-ba49-11bbca32c6a8",
146 "name": "rental",
147 "description": "",
148 "agentId": null,
149 "created": null,
150 "updated": null,
151 "confidence": 1,
152 "source": "knn",
153 "threshold": 0,
154 "system": false,
155 "alias": "",
156 "nameZh": "租车",
157 "examples": null,
158 "hasActiveCopy": false,
159 "templateStr": null,
160 "createdUserName": null,
161 "createdUserId": null,
162 "lastEditUserName": null,
163 "lastEditUserId": null,
164 "version": 0,
165 "industryIntent": false
166 },
167 "nluQuery": "租车",
168 "entities": {},
169 "clarifyIntents": [],
170 "clarifyTemplates": [],
171 "source": "knn",
172 "attitude": {
173 "query": "租车",
174 "label": 0,
175 "prob": 1,
176 "source": "model",
177 "name": "unknown",
178 "nameZh": "无态度"
179 },
180 "rawQuery": "租车"
181 },
182 "confidence": 1,
183 "lastNodeId": "",
184 "dialogs": [
185 {
186 "dialogNodeName": "租车",
187 "webhook": true,
188 "values": {
189 "original": "指令级别的兜底话术",
190 "text": "指令级别的兜底话术",
191 "type": 1
192 },
193 "description": null,
194 "dialogNodeId": "3d2cdfb3-9158-4980-b78d-bb77586b1937",
195 "processVersion": 4,
196 "isBackTrack": false,
197 "endNode": false,
198 "outputIndex": 1,
199 "processId": "b229f5ec-5fe8-4401-8df3-9d329a69c329",
200 "processName": "fanlh",
201 "action": "aciton",
202 "processType": 0,
203 "isResult": false,
204 "value": "指令级别的兜底话术"
205 },
206 {
207 "dialogNodeName": "检查车型实体节点_qwpg1bhv",
208 "webhook": false,
209 "values": {
210 "type": 1,
211 "text": "请输入车型",
212 "original": "请输入车型"
213 },
214 "description": "检查车型实体节点",
215 "dialogNodeId": "b017e30c-3550-4fce-be32-f09d84d1dce1",
216 "processVersion": 4,
217 "isBackTrack": false,
218 "endNode": false,
219 "outputIndex": 1,
220 "processId": "b229f5ec-5fe8-4401-8df3-9d329a69c329",
221 "processName": "fanlh",
222 "processType": 0,
223 "isResult": false,
224 "value": "请输入车型"
225 }
226 ]
227 },
228 "queryId": "05903c5c-54b6-4565-8a27-c6d19fce01b2"
229 },
230 "code": 200,
231 "msg": "OK"
232 }
233}
Faq:
Plain Text
1{
2 "time": 1586499361098,
3 "data": {
4 "sessionId": "11c8cddd-3d0c-493e-a33f-9a02ae5f99e5",
5 "source": "faq",
6 "solved": true,
7 "confidence": 1,
8 "nlu": {
9 "sentiment": {
10 "query": "问答吗",
11 "label": 0,
12 "prob": 0.9999976,
13 "source": "model",
14 "name": "neutral",
15 "nameZh": "中立"
16 },
17 "intents": [],
18 "entities": {},
19 "attitude": {
20 "query": "问答吗",
21 "label": 0,
22 "prob": 0.9965682,
23 "source": "model",
24 "name": "unknown",
25 "nameZh": "无态度"
26 }
27 },
28 "answer": {
29 "answerText": "是的 这里是问答",
30 "answerContents": [
31 {
32 "original": "是的 这里是问答",
33 "text": "是的 这里是问答",
34 "type": 1
35 }
36 ]
37 },
38 "context": {},
39 "webhook": false,
40 "debug": {
41 "responseTime": "2020-04-10 14:16:01:098",
42 "nlu": {
43 "clarifyEntities": {},
44 "sentiment": {
45 "query": "问答吗",
46 "label": 0,
47 "prob": 0.9999976,
48 "source": "model",
49 "name": "neutral",
50 "nameZh": "中立"
51 },
52 "intents": [],
53 "nluQuery": "问答吗",
54 "entities": {},
55 "clarifyIntents": [],
56 "clarifyTemplates": [],
57 "attitude": {
58 "query": "问答吗",
59 "label": 0,
60 "prob": 0.9965682,
61 "source": "model",
62 "name": "unknown",
63 "nameZh": "无态度"
64 },
65 "rawQuery": "问答吗"
66 },
67 "queryTime": "2020-04-10 14:15:58:132",
68 "botId": "b4762b99-d0df-4d51-bb70-38000b5b3f79",
69 "detail": {
70 "standardQuestion": "这里是问答吗?",
71 "extentQuestion": "问答吗?",
72 "answer": {
73 "original": "是的 这里是问答",
74 "text": "是的 这里是问答",
75 "type": 1
76 },
77 "confidence": 1,
78 "id": "12837cac-215b-4d41-81cb-16636ab5a21d",
79 "suggest": []
80 },
81 "queryId": "49d7f755-7c92-4489-be9c-42924ca25083"
82 }
83 },
84 "code": 200,
85 "msg": "OK"
86}
澄清:
Plain Text
1{
2 "queryId": "87aff1df-9517-499a-a09d-c0208187473e",
3 "sessionId": "6cd8cd6a-ceff-4714-b39f-90313d0ee8bb",
4 "source": "clarify",
5 "solved": true,
6 "confidence": 0,
7 "answer": {
8 "clarify": {
9 "voice": "请问您想问的是租个车吗?",
10 "text": {
11 "title": "请问您想咨询的是?",
12 "list": [
13 "租个车"
14 ]
15 }
16 },
17 "clarifyType": "INTENT_CLARIFY"
18 },
19 "queryTime": "2021-08-16 16:14:12:787",
20 "answerTime": "2021-08-16 16:14:13:241",
21 "actions": [],
22 "webhook": false,
23 "topAnythingElse": false,
24 "anythingElse": false,
25 "debug": {
26 "botName": "call_in_bot",
27 "nlu": {
28 "clarifyEntities": {},
29 "sentiment": {
30 "query": "车",
31 "label": 0,
32 "prob": 0.9802588,
33 "source": "model",
34 "name": "neutral",
35 "nameZh": "中立"
36 },
37 "intents": [],
38 "nluQuery": "车",
39 "clarifyIntents": [
40 {
41 "_effect": 0,
42 "id": "23bba558-79a6-4507-82c2-33d66a310f12",
43 "name": "car_rental",
44 "description": "",
45 "agentId": null,
46 "created": null,
47 "updated": null,
48 "confidence": 0.717866837978363,
49 "source": "knn",
50 "threshold": 0,
51 "system": false,
52 "needClarify": false,
53 "alias": "租个车",
54 "nameZh": "租车",
55 "examples": null,
56 "hasActiveCopy": false,
57 "templateStr": null,
58 "createdUserName": null,
59 "createdUserId": null,
60 "lastEditUserName": null,
61 "lastEditUserId": null,
62 "version": 0,
63 "industryIntent": false,
64 "knnExampleStr": "租车",
65 "noResponse": false
66 }
67 ],
68 "clarifyTemplates": [],
69 "nluCorrectedQuery": null,
70 "entities": {},
71 "nluChangedQuery": null,
72 "action": null,
73 "sensitiveWordsList": [],
74 "entityAutoFillVoMap": null,
75 "attitude": {
76 "query": "车",
77 "label": 0,
78 "prob": 1,
79 "source": "model",
80 "name": "unknown",
81 "nameZh": "无态度"
82 },
83 "rawQuery": "车"
84 },
85 "botId": "c46e1b75-bf24-4562-aa88-834243aecf86",
86 "detail": {
87 "clarifyType": "INTENT_CLARIFY",
88 "answerInterventionRules": null,
89 "appendAnswers": null,
90 "confirmQuestions": [
91 {
92 "score": 0.717866837978363,
93 "clickable": true,
94 "source": "task_based",
95 "question": "租个车",
96 "faqId": null
97 }
98 ],
99 "clarifyTypeDesc": "意图澄清",
100 "highConfirmQuestions": null,
101 "clarifyQuestions": {
102 "voice": "请问您想问的是租个车吗?",
103 "text": {
104 "title": "请问您想咨询的是?",
105 "list": [
106 "租个车"
107 ]
108 }
109 },
110 "keywordConfirmQuestions": null,
111 "entityClarify": null
112 },
113 "queryId": "87aff1df-9517-499a-a09d-c0208187473e"
114 }
115}
闲聊:
Plain Text
1{
2 "time": 1586502732524,
3 "data": {
4 "sessionId": "11c8cddd-3d0c-493e-a33f-9a02ae5f99e5",
5 "source": "chitchat",
6 "solved": true,
7 "confidence": 1,
8 "nlu": {
9 "sentiment": {
10 "query": "闲聊吗",
11 "label": 0,
12 "prob": 0.9999223,
13 "source": "model",
14 "name": "neutral",
15 "nameZh": "中立"
16 },
17 "intents": [],
18 "entities": {},
19 "attitude": {
20 "query": "闲聊吗",
21 "label": 0,
22 "prob": 0.9947141,
23 "source": "model",
24 "name": "unknown",
25 "nameZh": "无态度"
26 }
27 },
28 "answer": {
29 "answerText": "这是闲聊",
30 "answerContents": [
31 {
32 "type": 1,
33 "text": "这是闲聊"
34 }
35 ]
36 },
37 "debug": {
38 "responseTime": "2020-04-10 15:12:12:524",
39 "nlu": {
40 "clarifyEntities": {},
41 "sentiment": {
42 "query": "闲聊吗",
43 "label": 0,
44 "prob": 0.9999223,
45 "source": "model",
46 "name": "neutral",
47 "nameZh": "中立"
48 },
49 "intents": [],
50 "nluQuery": "闲聊吗",
51 "entities": {},
52 "clarifyIntents": [],
53 "clarifyTemplates": [],
54 "attitude": {
55 "query": "闲聊吗",
56 "label": 0,
57 "prob": 0.9947141,
58 "source": "model",
59 "name": "unknown",
60 "nameZh": "无态度"
61 },
62 "rawQuery": "闲聊吗"
63 },
64 "queryTime": "2020-04-10 15:12:09:114",
65 "botId": "b4762b99-d0df-4d51-bb70-38000b5b3f79",
66 "detail": {
67 "standardQuestion": "闲聊吗",
68 "extentQuestion": null,
69 "answer": {
70 "type": 1,
71 "text": "这是闲聊"
72 },
73 "confidence": 1,
74 "id": "0ea8b370-f0b4-44fe-a0b7-bf25ffa20365"
75 },
76 "queryId": "cb204ea7-f6ec-4a3a-a72f-9cf58647485f"
77 }
78 },
79 "code": 200,
80 "msg": "OK"
81}
bot系统事件:
Plain Text
1 {
2 "queryId": "ffd58556-2cd8-4c63-a6d1-d79e3c2cc424",
3 "sessionId": "2375914d-ab78-4035-81dd-ede33297b0a0",
4 "source": "system",
5 "solved": true,
6 "confidence": 0,
7 "answer": {
8 "answerText": "silent",
9 "answerContents": [
10 {
11 "text": "silent",
12 "type": 1
13 }
14 ],
15 "recommendContents": []
16 },
17 "queryTime": "2021-08-16 16:39:25:445",
18 "answerTime": "2021-08-16 16:39:25:535",
19 "actions": [],
20 "webhook": false,
21 "topAnythingElse": false,
22 "anythingElse": false,
23 "debug": {
24 "botName": "call_in_bot",
25 "nlu": {
26 "clarifyEntities": null,
27 "sentiment": null,
28 "intents": null,
29 "nluQuery": "",
30 "clarifyIntents": null,
31 "clarifyTemplates": null,
32 "nluCorrectedQuery": null,
33 "entities": null,
34 "nluChangedQuery": null,
35 "action": null,
36 "sensitiveWordsList": [],
37 "entityAutoFillVoMap": null,
38 "attitude": null,
39 "rawQuery": ""
40 },
41 "botId": "c46e1b75-bf24-4562-aa88-834243aecf86",
42 "detail": {
43 "answerInterventionRules": null,
44 "appendAnswers": null,
45 "name": "silent",
46 "count": 1,
47 "index": 1,
48 "reply": {
49 "symbol": "=",
50 "count": 1,
51 "type": 1,
52 "text": "silent",
53 "audio": null,
54 "isWebhook": false,
55 "action": "",
56 "actionName": ""
57 }
58 },
59 "queryId": "ffd58556-2cd8-4c63-a6d1-d79e3c2cc424"
60 }
61}